| // Copyright 2024 Google LLC |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // https://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| // Code generated by protoc-gen-go_gapic. DO NOT EDIT. |
| |
| package chat_test |
| |
| import ( |
| "context" |
| |
| chat "cloud.google.com/go/chat/apiv1" |
| chatpb "cloud.google.com/go/chat/apiv1/chatpb" |
| "google.golang.org/api/iterator" |
| ) |
| |
| func ExampleNewClient() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| // TODO: Use client. |
| _ = c |
| } |
| |
| func ExampleNewRESTClient() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewRESTClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| // TODO: Use client. |
| _ = c |
| } |
| |
| func ExampleClient_CompleteImportSpace() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.CompleteImportSpaceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#CompleteImportSpaceRequest. |
| } |
| resp, err := c.CompleteImportSpace(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateMembership() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.CreateMembershipRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#CreateMembershipRequest. |
| } |
| resp, err := c.CreateMembership(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateMessage() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.CreateMessageRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#CreateMessageRequest. |
| } |
| resp, err := c.CreateMessage(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateReaction() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.CreateReactionRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#CreateReactionRequest. |
| } |
| resp, err := c.CreateReaction(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateSpace() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.CreateSpaceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#CreateSpaceRequest. |
| } |
| resp, err := c.CreateSpace(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_DeleteMembership() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.DeleteMembershipRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#DeleteMembershipRequest. |
| } |
| resp, err := c.DeleteMembership(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_DeleteMessage() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.DeleteMessageRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#DeleteMessageRequest. |
| } |
| err = c.DeleteMessage(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_DeleteReaction() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.DeleteReactionRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#DeleteReactionRequest. |
| } |
| err = c.DeleteReaction(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_DeleteSpace() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.DeleteSpaceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#DeleteSpaceRequest. |
| } |
| err = c.DeleteSpace(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_FindDirectMessage() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.FindDirectMessageRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#FindDirectMessageRequest. |
| } |
| resp, err := c.FindDirectMessage(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetAttachment() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.GetAttachmentRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#GetAttachmentRequest. |
| } |
| resp, err := c.GetAttachment(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetMembership() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.GetMembershipRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#GetMembershipRequest. |
| } |
| resp, err := c.GetMembership(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetMessage() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.GetMessageRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#GetMessageRequest. |
| } |
| resp, err := c.GetMessage(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetSpace() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.GetSpaceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#GetSpaceRequest. |
| } |
| resp, err := c.GetSpace(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetSpaceReadState() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.GetSpaceReadStateRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#GetSpaceReadStateRequest. |
| } |
| resp, err := c.GetSpaceReadState(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetThreadReadState() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.GetThreadReadStateRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#GetThreadReadStateRequest. |
| } |
| resp, err := c.GetThreadReadState(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_ListMemberships() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.ListMembershipsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#ListMembershipsRequest. |
| } |
| it := c.ListMemberships(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| |
| // If you need to access the underlying RPC response, |
| // you can do so by casting the `Response` as below. |
| // Otherwise, remove this line. Only populated after |
| // first call to Next(). Not safe for concurrent access. |
| _ = it.Response.(*chatpb.ListMembershipsResponse) |
| } |
| } |
| |
| func ExampleClient_ListMessages() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.ListMessagesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#ListMessagesRequest. |
| } |
| it := c.ListMessages(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| |
| // If you need to access the underlying RPC response, |
| // you can do so by casting the `Response` as below. |
| // Otherwise, remove this line. Only populated after |
| // first call to Next(). Not safe for concurrent access. |
| _ = it.Response.(*chatpb.ListMessagesResponse) |
| } |
| } |
| |
| func ExampleClient_ListReactions() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.ListReactionsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#ListReactionsRequest. |
| } |
| it := c.ListReactions(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| |
| // If you need to access the underlying RPC response, |
| // you can do so by casting the `Response` as below. |
| // Otherwise, remove this line. Only populated after |
| // first call to Next(). Not safe for concurrent access. |
| _ = it.Response.(*chatpb.ListReactionsResponse) |
| } |
| } |
| |
| func ExampleClient_ListSpaces() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.ListSpacesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#ListSpacesRequest. |
| } |
| it := c.ListSpaces(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| |
| // If you need to access the underlying RPC response, |
| // you can do so by casting the `Response` as below. |
| // Otherwise, remove this line. Only populated after |
| // first call to Next(). Not safe for concurrent access. |
| _ = it.Response.(*chatpb.ListSpacesResponse) |
| } |
| } |
| |
| func ExampleClient_SetUpSpace() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.SetUpSpaceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#SetUpSpaceRequest. |
| } |
| resp, err := c.SetUpSpace(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateMembership() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.UpdateMembershipRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#UpdateMembershipRequest. |
| } |
| resp, err := c.UpdateMembership(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateMessage() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.UpdateMessageRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#UpdateMessageRequest. |
| } |
| resp, err := c.UpdateMessage(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateSpace() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.UpdateSpaceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#UpdateSpaceRequest. |
| } |
| resp, err := c.UpdateSpace(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateSpaceReadState() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.UpdateSpaceReadStateRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#UpdateSpaceReadStateRequest. |
| } |
| resp, err := c.UpdateSpaceReadState(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UploadAttachment() { |
| ctx := context.Background() |
| // This snippet has been automatically generated and should be regarded as a code template only. |
| // It will require modifications to work: |
| // - It may require correct/in-range values for request initialization. |
| // - It may require specifying regional endpoints when creating the service client as shown in: |
| // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| c, err := chat.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &chatpb.UploadAttachmentRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/chat/apiv1/chatpb#UploadAttachmentRequest. |
| } |
| resp, err := c.UploadAttachment(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |