{ "clientLibrary": { "name": "cloud.google.com/go/chat/apiv1", "version": "0.15.1", "language": "GO", "apis": [ { "id": "google.chat.v1", "version": "v1" } ] }, "snippets": [ { "regionTag": "chat_v1_generated_ChatService_CompleteImportSpace_sync", "title": "chat CompleteImportSpace Sample", "description": "CompleteImportSpace completes the\n[import process](https: //developers.google.com/workspace/chat/import-data)\nfor the specified space and makes it visible to users.\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nand domain-wide delegation with the [authorization\nscope](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.import`\n\nFor more information, see [Authorize Google\nChat apps to import\ndata](https: //developers.google.com/workspace/chat/authorize-import).", "file": "Client/CompleteImportSpace/main.go", "language": "GO", "clientMethod": { "shortName": "CompleteImportSpace", "fullName": "google.chat.v1.Client.CompleteImportSpace", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.CompleteImportSpaceRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.CompleteImportSpaceResponse", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "CompleteImportSpace", "fullName": "google.chat.v1.ChatService.CompleteImportSpace", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_CreateCustomEmoji_sync", "title": "chat CreateCustomEmoji Sample", "description": "CreateCustomEmoji creates a custom emoji.\n\nCustom emojis are only available for Google Workspace accounts, and the\nadministrator must turn custom emojis on for the organization. For more\ninformation, see [Learn about custom emojis in Google\nChat](https: //support.google.com/chat/answer/12800149) and\n[Manage custom emoji\npermissions](https: //support.google.com/a/answer/12850085).\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith the [authorization\nscope](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.customemojis`", "file": "Client/CreateCustomEmoji/main.go", "language": "GO", "clientMethod": { "shortName": "CreateCustomEmoji", "fullName": "google.chat.v1.Client.CreateCustomEmoji", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.CreateCustomEmojiRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.CustomEmoji", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "CreateCustomEmoji", "fullName": "google.chat.v1.ChatService.CreateCustomEmoji", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_CreateMembership_sync", "title": "chat CreateMembership Sample", "description": "CreateMembership creates a membership for the calling Chat app, a user, or a Google Group.\nCreating memberships for other Chat apps isn't supported.\nWhen creating a membership, if the specified member has their auto-accept\npolicy turned off, then they're invited, and must accept the space\ninvitation before joining. Otherwise, creating a membership adds the member\ndirectly to the specified space.\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith [administrator approval](https: //support.google.com/a?p=chat-app-auth)\nand the authorization scope: \n- `https: //www.googleapis.com/auth/chat.app.memberships`\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.memberships`\n- `https: //www.googleapis.com/auth/chat.memberships.app` (to add the\ncalling app to the space)\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces\nonly)\n- User authentication grants administrator privileges when an\nadministrator account authenticates, `use_admin_access` is `true`, and\nthe following authorization scope is used: \n- `https: //www.googleapis.com/auth/chat.admin.memberships`\n\nApp authentication is not supported for the following use cases: \n\n- Inviting users external to the Workspace organization that owns the\nspace.\n- Adding a Google Group to a space.\n- Adding a Chat app to a space.\n\nFor example usage, see: \n\n- [Invite or add a user to a\nspace](https: //developers.google.com/workspace/chat/create-members#create-user-membership).\n- [Invite or add a Google Group to a\nspace](https: //developers.google.com/workspace/chat/create-members#create-group-membership).\n- [Add the Chat app to a\nspace](https: //developers.google.com/workspace/chat/create-members#create-membership-calling-api).", "file": "Client/CreateMembership/main.go", "language": "GO", "clientMethod": { "shortName": "CreateMembership", "fullName": "google.chat.v1.Client.CreateMembership", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.CreateMembershipRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Membership", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "CreateMembership", "fullName": "google.chat.v1.ChatService.CreateMembership", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_CreateMessage_sync", "title": "chat CreateMessage Sample", "description": "CreateMessage creates a message in a Google Chat space. For an example, see [Send a\nmessage](https: //developers.google.com/workspace/chat/create-messages).\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith the authorization scope: \n- `https: //www.googleapis.com/auth/chat.bot`\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.messages.create`\n- `https: //www.googleapis.com/auth/chat.messages`\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces\nonly)\n\nChat attributes the message sender differently depending on the type of\nauthentication that you use in your request.\n\nThe following image shows how Chat attributes a message when you use app\nauthentication. Chat displays the Chat app as the message\nsender. The content of the message can contain text (`text`), cards\n(`cardsV2`), and accessory widgets (`accessoryWidgets`).\n\n![Message sent with app\nauthentication](https: //developers.google.com/workspace/chat/images/message-app-auth.svg)\n\nThe following image shows how Chat attributes a message when you use user\nauthentication. Chat displays the user as the message sender and attributes\nthe Chat app to the message by displaying its name. The content of message\ncan only contain text (`text`).\n\n![Message sent with user\nauthentication](https: //developers.google.com/workspace/chat/images/message-user-auth.svg)\n\nThe maximum message size, including the message contents, is 32,000 bytes.\n\nFor\n[webhook](https: //developers.google.com/workspace/chat/quickstart/webhooks)\nrequests, the response doesn't contain the full message. The response only\npopulates the `name` and `thread.name` fields in addition to the\ninformation that was in the request.", "file": "Client/CreateMessage/main.go", "language": "GO", "clientMethod": { "shortName": "CreateMessage", "fullName": "google.chat.v1.Client.CreateMessage", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.CreateMessageRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Message", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "CreateMessage", "fullName": "google.chat.v1.ChatService.CreateMessage", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_CreateReaction_sync", "title": "chat CreateReaction Sample", "description": "CreateReaction creates a reaction and adds it to a message. For an example, see\n[Add a reaction to a\nmessage](https: //developers.google.com/workspace/chat/create-reactions).\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following [authorization\nscopes](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.messages.reactions.create`\n- `https: //www.googleapis.com/auth/chat.messages.reactions`\n- `https: //www.googleapis.com/auth/chat.messages`\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces only)", "file": "Client/CreateReaction/main.go", "language": "GO", "clientMethod": { "shortName": "CreateReaction", "fullName": "google.chat.v1.Client.CreateReaction", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.CreateReactionRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Reaction", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "CreateReaction", "fullName": "google.chat.v1.ChatService.CreateReaction", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_CreateSpace_sync", "title": "chat CreateSpace Sample", "description": "CreateSpace creates a space. Can be used to create a named space, or a\ngroup chat in `Import mode`. For an example, see [Create a\nspace](https: //developers.google.com/workspace/chat/create-spaces).\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith [administrator approval](https: //support.google.com/a?p=chat-app-auth)\nand one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.app.spaces.create`\n- `https: //www.googleapis.com/auth/chat.app.spaces`\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.spaces.create`\n- `https: //www.googleapis.com/auth/chat.spaces`\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces\nonly)\n\nWhen authenticating as an app, the `space.customer` field must be set in\nthe request.\n\nWhen authenticating as an app, the Chat app is added as a member of the\nspace. However, unlike human authentication, the Chat app is not added as a\nspace manager. By default, the Chat app can be removed from the space by\nall space members. To allow only space managers to remove the app from a\nspace, set `space.permission_settings.manage_apps` to `managers_allowed`.\n\nSpace membership upon creation depends on whether the space is created in\n`Import mode`: \n\n* **Import mode: ** No members are created.\n* **All other modes: ** The calling user is added as a member. This is: \n* The app itself when using app authentication.\n* The human user when using user authentication.\n\nIf you receive the error message `ALREADY_EXISTS` when creating\na space, try a different `displayName`. An existing space within\nthe Google Workspace organization might already use this display name.", "file": "Client/CreateSpace/main.go", "language": "GO", "clientMethod": { "shortName": "CreateSpace", "fullName": "google.chat.v1.Client.CreateSpace", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.CreateSpaceRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Space", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "CreateSpace", "fullName": "google.chat.v1.ChatService.CreateSpace", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_DeleteCustomEmoji_sync", "title": "chat DeleteCustomEmoji Sample", "description": "DeleteCustomEmoji deletes a custom emoji. By default, users can only delete custom emoji they\ncreated. [Emoji managers](https: //support.google.com/a/answer/12850085)\nassigned by the administrator can delete any custom emoji in the\norganization. See [Learn about custom emojis in Google\nChat](https: //support.google.com/chat/answer/12800149).\n\nCustom emojis are only available for Google Workspace accounts, and the\nadministrator must turn custom emojis on for the organization. For more\ninformation, see [Learn about custom emojis in Google\nChat](https: //support.google.com/chat/answer/12800149) and\n[Manage custom emoji\npermissions](https: //support.google.com/a/answer/12850085).\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith the [authorization\nscope](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.customemojis`", "file": "Client/DeleteCustomEmoji/main.go", "language": "GO", "clientMethod": { "shortName": "DeleteCustomEmoji", "fullName": "google.chat.v1.Client.DeleteCustomEmoji", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.DeleteCustomEmojiRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "DeleteCustomEmoji", "fullName": "google.chat.v1.ChatService.DeleteCustomEmoji", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 51, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_DeleteMembership_sync", "title": "chat DeleteMembership Sample", "description": "DeleteMembership deletes a membership. For an example, see\n[Remove a user or a Google Chat app from a\nspace](https: //developers.google.com/workspace/chat/delete-members).\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith [administrator approval](https: //support.google.com/a?p=chat-app-auth)\nand the authorization scope: \n- `https: //www.googleapis.com/auth/chat.app.memberships`\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.memberships`\n- `https: //www.googleapis.com/auth/chat.memberships.app` (to remove\nthe calling app from the space)\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces\nonly)\n- User authentication grants administrator privileges when an\nadministrator account authenticates, `use_admin_access` is `true`, and\nthe following authorization scope is used: \n- `https: //www.googleapis.com/auth/chat.admin.memberships`\n\nApp authentication is not supported for the following use cases: \n\n- Removing a Google Group from a space.\n- Removing a Chat app from a space.\n\nTo delete memberships for space managers, the requester\nmust be a space manager. If you're using [app\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nthe Chat app must be the space creator.", "file": "Client/DeleteMembership/main.go", "language": "GO", "clientMethod": { "shortName": "DeleteMembership", "fullName": "google.chat.v1.Client.DeleteMembership", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.DeleteMembershipRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Membership", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "DeleteMembership", "fullName": "google.chat.v1.ChatService.DeleteMembership", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_DeleteMessage_sync", "title": "chat DeleteMessage Sample", "description": "DeleteMessage deletes a message.\nFor an example, see [Delete a\nmessage](https: //developers.google.com/workspace/chat/delete-messages).\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith the authorization scope: \n- `https: //www.googleapis.com/auth/chat.bot`\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.messages`\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces\nonly)\n\nWhen using app authentication, requests can only delete messages\ncreated by the calling Chat app.", "file": "Client/DeleteMessage/main.go", "language": "GO", "clientMethod": { "shortName": "DeleteMessage", "fullName": "google.chat.v1.Client.DeleteMessage", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.DeleteMessageRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "DeleteMessage", "fullName": "google.chat.v1.ChatService.DeleteMessage", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 51, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_DeleteReaction_sync", "title": "chat DeleteReaction Sample", "description": "DeleteReaction deletes a reaction to a message. For an example, see\n[Delete a\nreaction](https: //developers.google.com/workspace/chat/delete-reactions).\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following [authorization\nscopes](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.messages.reactions`\n- `https: //www.googleapis.com/auth/chat.messages`\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces only)", "file": "Client/DeleteReaction/main.go", "language": "GO", "clientMethod": { "shortName": "DeleteReaction", "fullName": "google.chat.v1.Client.DeleteReaction", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.DeleteReactionRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "DeleteReaction", "fullName": "google.chat.v1.ChatService.DeleteReaction", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 51, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_DeleteSpace_sync", "title": "chat DeleteSpace Sample", "description": "DeleteSpace deletes a named space. Always performs a cascading delete, which means\nthat the space's child resources—like messages posted in the space and\nmemberships in the space—are also deleted. For an example, see\n[Delete a\nspace](https: //developers.google.com/workspace/chat/delete-spaces).\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith [administrator\napproval](https: //support.google.com/a?p=chat-app-auth) and the\nauthorization scope: \n- `https: //www.googleapis.com/auth/chat.app.delete` (only in\nspaces the app created)\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.delete`\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces\nonly)\n- User authentication grants administrator privileges when an\nadministrator account authenticates, `use_admin_access` is `true`, and\nthe following authorization scope is used: \n- `https: //www.googleapis.com/auth/chat.admin.delete`", "file": "Client/DeleteSpace/main.go", "language": "GO", "clientMethod": { "shortName": "DeleteSpace", "fullName": "google.chat.v1.Client.DeleteSpace", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.DeleteSpaceRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "DeleteSpace", "fullName": "google.chat.v1.ChatService.DeleteSpace", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 51, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_FindDirectMessage_sync", "title": "chat FindDirectMessage Sample", "description": "FindDirectMessage returns the existing direct message with the specified user. If no direct\nmessage space is found, returns a `404 NOT_FOUND` error. For an example,\nsee\n[Find a direct message](/chat/api/guides/v1/spaces/find-direct-message).\n\nWith [app\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app),\nreturns the direct message space between the specified user and the calling\nChat app.\n\nWith [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user),\nreturns the direct message space between the specified user and the\nauthenticated user.\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith the authorization scope: \n- `https: //www.googleapis.com/auth/chat.bot`\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.spaces.readonly`\n- `https: //www.googleapis.com/auth/chat.spaces`", "file": "Client/FindDirectMessage/main.go", "language": "GO", "clientMethod": { "shortName": "FindDirectMessage", "fullName": "google.chat.v1.Client.FindDirectMessage", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.FindDirectMessageRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Space", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "FindDirectMessage", "fullName": "google.chat.v1.ChatService.FindDirectMessage", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_GetAttachment_sync", "title": "chat GetAttachment Sample", "description": "GetAttachment gets the metadata of a message attachment. The attachment data is fetched\nusing the [media\nAPI](https: //developers.google.com/workspace/chat/api/reference/rest/v1/media/download).\nFor an example, see\n[Get metadata about a message\nattachment](https: //developers.google.com/workspace/chat/get-media-attachments).\n\nRequires [app\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith the [authorization\nscope](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.bot`", "file": "Client/GetAttachment/main.go", "language": "GO", "clientMethod": { "shortName": "GetAttachment", "fullName": "google.chat.v1.Client.GetAttachment", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.GetAttachmentRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Attachment", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "GetAttachment", "fullName": "google.chat.v1.ChatService.GetAttachment", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_GetCustomEmoji_sync", "title": "chat GetCustomEmoji Sample", "description": "GetCustomEmoji returns details about a custom emoji.\n\nCustom emojis are only available for Google Workspace accounts, and the\nadministrator must turn custom emojis on for the organization. For more\ninformation, see [Learn about custom emojis in Google\nChat](https: //support.google.com/chat/answer/12800149) and\n[Manage custom emoji\npermissions](https: //support.google.com/a/answer/12850085).\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following [authorization\nscopes](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.customemojis.readonly`\n- `https: //www.googleapis.com/auth/chat.customemojis`", "file": "Client/GetCustomEmoji/main.go", "language": "GO", "clientMethod": { "shortName": "GetCustomEmoji", "fullName": "google.chat.v1.Client.GetCustomEmoji", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.GetCustomEmojiRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.CustomEmoji", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "GetCustomEmoji", "fullName": "google.chat.v1.ChatService.GetCustomEmoji", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_GetMembership_sync", "title": "chat GetMembership Sample", "description": "GetMembership returns details about a membership. For an example, see\n[Get details about a user's or Google Chat app's\nmembership](https: //developers.google.com/workspace/chat/get-members).\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.bot`\n- `https: //www.googleapis.com/auth/chat.app.memberships` (requires\n[administrator approval](https: //support.google.com/a?p=chat-app-auth))\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.memberships.readonly`\n- `https: //www.googleapis.com/auth/chat.memberships`\n- User authentication grants administrator privileges when an\nadministrator account authenticates, `use_admin_access` is `true`, and\none of the following authorization scopes is used: \n- `https: //www.googleapis.com/auth/chat.admin.memberships.readonly`\n- `https: //www.googleapis.com/auth/chat.admin.memberships`", "file": "Client/GetMembership/main.go", "language": "GO", "clientMethod": { "shortName": "GetMembership", "fullName": "google.chat.v1.Client.GetMembership", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.GetMembershipRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Membership", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "GetMembership", "fullName": "google.chat.v1.ChatService.GetMembership", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_GetMessage_sync", "title": "chat GetMessage Sample", "description": "GetMessage returns details about a message.\nFor an example, see [Get details about a\nmessage](https: //developers.google.com/workspace/chat/get-messages).\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith the authorization scope: \n- `https: //www.googleapis.com/auth/chat.bot`\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.messages.readonly`\n- `https: //www.googleapis.com/auth/chat.messages`\n\nNote: Might return a message from a blocked member or space.", "file": "Client/GetMessage/main.go", "language": "GO", "clientMethod": { "shortName": "GetMessage", "fullName": "google.chat.v1.Client.GetMessage", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.GetMessageRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Message", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "GetMessage", "fullName": "google.chat.v1.ChatService.GetMessage", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_GetSpace_sync", "title": "chat GetSpace Sample", "description": "GetSpace returns details about a space. For an example, see\n[Get details about a\nspace](https: //developers.google.com/workspace/chat/get-spaces).\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.bot`\n- `https: //www.googleapis.com/auth/chat.app.spaces` with [administrator\napproval](https: //support.google.com/a?p=chat-app-auth)\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.spaces.readonly`\n- `https: //www.googleapis.com/auth/chat.spaces`\n- User authentication grants administrator privileges when an\nadministrator account authenticates, `use_admin_access` is `true`, and\none of the following authorization scopes is used: \n- `https: //www.googleapis.com/auth/chat.admin.spaces.readonly`\n- `https: //www.googleapis.com/auth/chat.admin.spaces`\n\nApp authentication has the following limitations: \n\n- `space.access_settings` is only populated when using the\n`chat.app.spaces` scope.\n- `space.predefind_permission_settings` and `space.permission_settings` are\nonly populated when using the `chat.app.spaces` scope, and only for\nspaces the app created.", "file": "Client/GetSpace/main.go", "language": "GO", "clientMethod": { "shortName": "GetSpace", "fullName": "google.chat.v1.Client.GetSpace", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.GetSpaceRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Space", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "GetSpace", "fullName": "google.chat.v1.ChatService.GetSpace", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_GetSpaceEvent_sync", "title": "chat GetSpaceEvent Sample", "description": "GetSpaceEvent returns an event from a Google Chat space. The [event\npayload](https: //developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload)\ncontains the most recent version of the resource that changed. For example,\nif you request an event about a new message but the message was later\nupdated, the server returns the updated `Message` resource in the event\npayload.\n\nNote: The `permissionSettings` field is not returned in the Space\nobject of the Space event data for this request.\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith an [authorization\nscope](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes)\nappropriate for reading the requested data: \n\n- `https: //www.googleapis.com/auth/chat.spaces.readonly`\n- `https: //www.googleapis.com/auth/chat.spaces`\n- `https: //www.googleapis.com/auth/chat.messages.readonly`\n- `https: //www.googleapis.com/auth/chat.messages`\n- `https: //www.googleapis.com/auth/chat.messages.reactions.readonly`\n- `https: //www.googleapis.com/auth/chat.messages.reactions`\n- `https: //www.googleapis.com/auth/chat.memberships.readonly`\n- `https: //www.googleapis.com/auth/chat.memberships`\n\nTo get an event, the authenticated user must be a member of the space.\n\nFor an example, see [Get details about an\nevent from a Google Chat\nspace](https: //developers.google.com/workspace/chat/get-space-event).", "file": "Client/GetSpaceEvent/main.go", "language": "GO", "clientMethod": { "shortName": "GetSpaceEvent", "fullName": "google.chat.v1.Client.GetSpaceEvent", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.GetSpaceEventRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.SpaceEvent", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "GetSpaceEvent", "fullName": "google.chat.v1.ChatService.GetSpaceEvent", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_GetSpaceNotificationSetting_sync", "title": "chat GetSpaceNotificationSetting Sample", "description": "GetSpaceNotificationSetting gets the space notification setting. For an example, see [Get the\ncaller's space notification\nsetting](https: //developers.google.com/workspace/chat/get-space-notification-setting).\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith the [authorization\nscope](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.users.spacesettings`", "file": "Client/GetSpaceNotificationSetting/main.go", "language": "GO", "clientMethod": { "shortName": "GetSpaceNotificationSetting", "fullName": "google.chat.v1.Client.GetSpaceNotificationSetting", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.GetSpaceNotificationSettingRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.SpaceNotificationSetting", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "GetSpaceNotificationSetting", "fullName": "google.chat.v1.ChatService.GetSpaceNotificationSetting", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_GetSpaceReadState_sync", "title": "chat GetSpaceReadState Sample", "description": "GetSpaceReadState returns details about a user's read state within a space, used to identify\nread and unread messages. For an example, see [Get details about a user's\nspace read\nstate](https: //developers.google.com/workspace/chat/get-space-read-state).\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following [authorization\nscopes](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.users.readstate.readonly`\n- `https: //www.googleapis.com/auth/chat.users.readstate`", "file": "Client/GetSpaceReadState/main.go", "language": "GO", "clientMethod": { "shortName": "GetSpaceReadState", "fullName": "google.chat.v1.Client.GetSpaceReadState", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.GetSpaceReadStateRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.SpaceReadState", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "GetSpaceReadState", "fullName": "google.chat.v1.ChatService.GetSpaceReadState", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_GetThreadReadState_sync", "title": "chat GetThreadReadState Sample", "description": "GetThreadReadState returns details about a user's read state within a thread, used to identify\nread and unread messages. For an example, see [Get details about a user's\nthread read\nstate](https: //developers.google.com/workspace/chat/get-thread-read-state).\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following [authorization\nscopes](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.users.readstate.readonly`\n- `https: //www.googleapis.com/auth/chat.users.readstate`", "file": "Client/GetThreadReadState/main.go", "language": "GO", "clientMethod": { "shortName": "GetThreadReadState", "fullName": "google.chat.v1.Client.GetThreadReadState", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.GetThreadReadStateRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.ThreadReadState", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "GetThreadReadState", "fullName": "google.chat.v1.ChatService.GetThreadReadState", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_ListCustomEmojis_sync", "title": "chat ListCustomEmojis Sample", "description": "ListCustomEmojis lists custom emojis visible to the authenticated user.\n\nCustom emojis are only available for Google Workspace accounts, and the\nadministrator must turn custom emojis on for the organization. For more\ninformation, see [Learn about custom emojis in Google\nChat](https: //support.google.com/chat/answer/12800149) and\n[Manage custom emoji\npermissions](https: //support.google.com/a/answer/12850085).\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following [authorization\nscopes](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.customemojis.readonly`\n- `https: //www.googleapis.com/auth/chat.customemojis`", "file": "Client/ListCustomEmojis/main.go", "language": "GO", "clientMethod": { "shortName": "ListCustomEmojis", "fullName": "google.chat.v1.Client.ListCustomEmojis", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.ListCustomEmojisRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "CustomEmojiIterator", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "ListCustomEmojis", "fullName": "google.chat.v1.ChatService.ListCustomEmojis", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 66, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_ListMemberships_sync", "title": "chat ListMemberships Sample", "description": "ListMemberships lists memberships in a space. For an example, see [List users and Google\nChat apps in a\nspace](https: //developers.google.com/workspace/chat/list-members). Listing\nmemberships with [app\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nlists memberships in spaces that the Chat app has\naccess to, but excludes Chat app memberships,\nincluding its own. Listing memberships with\n[User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nlists memberships in spaces that the authenticated user has access to.\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.bot`\n- `https: //www.googleapis.com/auth/chat.app.memberships` (requires\n[administrator approval](https: //support.google.com/a?p=chat-app-auth))\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.memberships.readonly`\n- `https: //www.googleapis.com/auth/chat.memberships`\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces\nonly)\n- User authentication grants administrator privileges when an\nadministrator account authenticates, `use_admin_access` is `true`, and\none of the following authorization scopes is used: \n- `https: //www.googleapis.com/auth/chat.admin.memberships.readonly`\n- `https: //www.googleapis.com/auth/chat.admin.memberships`", "file": "Client/ListMemberships/main.go", "language": "GO", "clientMethod": { "shortName": "ListMemberships", "fullName": "google.chat.v1.Client.ListMemberships", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.ListMembershipsRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "MembershipIterator", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "ListMemberships", "fullName": "google.chat.v1.ChatService.ListMemberships", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 66, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_ListMessages_sync", "title": "chat ListMessages Sample", "description": "ListMessages lists messages in a space that the caller is a member of, including\nmessages from blocked members and spaces. If you list messages from a\nspace with no messages, the response is an empty object. When using a\nREST/HTTP interface, the response contains an empty JSON object, `{}`.\nFor an example, see\n[List\nmessages](https: //developers.google.com/workspace/chat/api/guides/v1/messages/list).\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following [authorization\nscopes](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.messages.readonly`\n- `https: //www.googleapis.com/auth/chat.messages`\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces only)", "file": "Client/ListMessages/main.go", "language": "GO", "clientMethod": { "shortName": "ListMessages", "fullName": "google.chat.v1.Client.ListMessages", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.ListMessagesRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "MessageIterator", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "ListMessages", "fullName": "google.chat.v1.ChatService.ListMessages", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 66, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_ListReactions_sync", "title": "chat ListReactions Sample", "description": "ListReactions lists reactions to a message. For an example, see\n[List reactions for a\nmessage](https: //developers.google.com/workspace/chat/list-reactions).\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following [authorization\nscopes](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.messages.reactions.readonly`\n- `https: //www.googleapis.com/auth/chat.messages.reactions`\n- `https: //www.googleapis.com/auth/chat.messages.readonly`\n- `https: //www.googleapis.com/auth/chat.messages`", "file": "Client/ListReactions/main.go", "language": "GO", "clientMethod": { "shortName": "ListReactions", "fullName": "google.chat.v1.Client.ListReactions", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.ListReactionsRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "ReactionIterator", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "ListReactions", "fullName": "google.chat.v1.ChatService.ListReactions", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 66, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_ListSpaceEvents_sync", "title": "chat ListSpaceEvents Sample", "description": "ListSpaceEvents lists events from a Google Chat space. For each event, the\n[payload](https: //developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload)\ncontains the most recent version of the Chat resource. For example, if you\nlist events about new space members, the server returns `Membership`\nresources that contain the latest membership details. If new members were\nremoved during the requested period, the event payload contains an empty\n`Membership` resource.\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith an [authorization\nscope](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes)\nappropriate for reading the requested data: \n\n- `https: //www.googleapis.com/auth/chat.spaces.readonly`\n- `https: //www.googleapis.com/auth/chat.spaces`\n- `https: //www.googleapis.com/auth/chat.messages.readonly`\n- `https: //www.googleapis.com/auth/chat.messages`\n- `https: //www.googleapis.com/auth/chat.messages.reactions.readonly`\n- `https: //www.googleapis.com/auth/chat.messages.reactions`\n- `https: //www.googleapis.com/auth/chat.memberships.readonly`\n- `https: //www.googleapis.com/auth/chat.memberships`\n\nTo list events, the authenticated user must be a member of the space.\n\nFor an example, see [List events from a Google Chat\nspace](https: //developers.google.com/workspace/chat/list-space-events).", "file": "Client/ListSpaceEvents/main.go", "language": "GO", "clientMethod": { "shortName": "ListSpaceEvents", "fullName": "google.chat.v1.Client.ListSpaceEvents", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.ListSpaceEventsRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "SpaceEventIterator", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "ListSpaceEvents", "fullName": "google.chat.v1.ChatService.ListSpaceEvents", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 66, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_ListSpaces_sync", "title": "chat ListSpaces Sample", "description": "ListSpaces lists spaces the caller is a member of. Group chats and DMs aren't listed\nuntil the first message is sent. For an example, see\n[List\nspaces](https: //developers.google.com/workspace/chat/list-spaces).\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith the authorization scope: \n- `https: //www.googleapis.com/auth/chat.bot`\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.spaces.readonly`\n- `https: //www.googleapis.com/auth/chat.spaces`\n\nTo list all named spaces by Google Workspace organization, use the\n[`spaces.search()`](https: //developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search)\nmethod using Workspace administrator privileges instead.", "file": "Client/ListSpaces/main.go", "language": "GO", "clientMethod": { "shortName": "ListSpaces", "fullName": "google.chat.v1.Client.ListSpaces", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.ListSpacesRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "SpaceIterator", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "ListSpaces", "fullName": "google.chat.v1.ChatService.ListSpaces", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 66, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_SearchSpaces_sync", "title": "chat SearchSpaces Sample", "description": "SearchSpaces returns a list of spaces in a Google Workspace organization based on an\nadministrator's search.\n\nRequires [user\nauthentication with administrator\nprivileges](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges)\nand one of the following [authorization\nscopes](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.admin.spaces.readonly`\n- `https: //www.googleapis.com/auth/chat.admin.spaces`\n\nIn the request, set `use_admin_access` to `true`.", "file": "Client/SearchSpaces/main.go", "language": "GO", "clientMethod": { "shortName": "SearchSpaces", "fullName": "google.chat.v1.Client.SearchSpaces", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.SearchSpacesRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "SpaceIterator", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "SearchSpaces", "fullName": "google.chat.v1.ChatService.SearchSpaces", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 66, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_SetUpSpace_sync", "title": "chat SetUpSpace Sample", "description": "SetUpSpace creates a space and adds specified users to it. The calling user is\nautomatically added to the space, and shouldn't be specified as a\nmembership in the request. For an example, see\n[Set up a space with initial\nmembers](https: //developers.google.com/workspace/chat/set-up-spaces).\n\nTo specify the human members to add, add memberships with the appropriate\n`membership.member.name`. To add a human user, use `users/{user}`, where\n`{user}` can be the email address for the user. For users in the same\nWorkspace organization `{user}` can also be the `id` for the person from\nthe People API, or the `id` for the user in the Directory API. For example,\nif the People API Person profile ID for `user@example.com` is `123456789`,\nyou can add the user to the space by setting the `membership.member.name`\nto `users/user@example.com` or `users/123456789`.\n\nTo specify the Google groups to add, add memberships with the\nappropriate `membership.group_member.name`. To add or invite a Google\ngroup, use `groups/{group}`, where `{group}` is the `id` for the group from\nthe Cloud Identity Groups API. For example, you can use [Cloud Identity\nGroups lookup\nAPI](https: //cloud.google.com/identity/docs/reference/rest/v1/groups/lookup)\nto retrieve the ID `123456789` for group email `group@example.com`, then\nyou can add the group to the space by setting the\n`membership.group_member.name` to `groups/123456789`. Group email is not\nsupported, and Google groups can only be added as members in named spaces.\n\nFor a named space or group chat, if the caller blocks, or is blocked\nby some members, or doesn't have permission to add some members, then\nthose members aren't added to the created space.\n\nTo create a direct message (DM) between the calling user and another human\nuser, specify exactly one membership to represent the human user. If\none user blocks the other, the request fails and the DM isn't created.\n\nTo create a DM between the calling user and the calling app, set\n`Space.singleUserBotDm` to `true` and don't specify any memberships. You\ncan only use this method to set up a DM with the calling app. To add the\ncalling app as a member of a space or an existing DM between two human\nusers, see\n[Invite or add a user or app to a\nspace](https: //developers.google.com/workspace/chat/create-members).\n\nIf a DM already exists between two users, even when one user blocks the\nother at the time a request is made, then the existing DM is returned.\n\nSpaces with threaded replies aren't supported. If you receive the error\nmessage `ALREADY_EXISTS` when setting up a space, try a different\n`displayName`. An existing space within the Google Workspace organization\nmight already use this display name.\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following [authorization\nscopes](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.spaces.create`\n- `https: //www.googleapis.com/auth/chat.spaces`", "file": "Client/SetUpSpace/main.go", "language": "GO", "clientMethod": { "shortName": "SetUpSpace", "fullName": "google.chat.v1.Client.SetUpSpace", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.SetUpSpaceRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Space", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "SetUpSpace", "fullName": "google.chat.v1.ChatService.SetUpSpace", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_UpdateMembership_sync", "title": "chat UpdateMembership Sample", "description": "UpdateMembership updates a membership. For an example, see [Update a user's membership in\na space](https: //developers.google.com/workspace/chat/update-members).\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith [administrator\napproval](https: //support.google.com/a?p=chat-app-auth) and the\nauthorization scope: \n- `https: //www.googleapis.com/auth/chat.app.memberships` (only in\nspaces the app created)\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.memberships`\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces\nonly)\n- User authentication grants administrator privileges when an\nadministrator account authenticates, `use_admin_access` is `true`, and\nthe following authorization scope is used: \n- `https: //www.googleapis.com/auth/chat.admin.memberships`", "file": "Client/UpdateMembership/main.go", "language": "GO", "clientMethod": { "shortName": "UpdateMembership", "fullName": "google.chat.v1.Client.UpdateMembership", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.UpdateMembershipRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Membership", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "UpdateMembership", "fullName": "google.chat.v1.ChatService.UpdateMembership", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_UpdateMessage_sync", "title": "chat UpdateMessage Sample", "description": "UpdateMessage updates a message. There's a difference between the `patch` and `update`\nmethods. The `patch`\nmethod uses a `patch` request while the `update` method uses a `put`\nrequest. We recommend using the `patch` method. For an example, see\n[Update a\nmessage](https: //developers.google.com/workspace/chat/update-messages).\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith the authorization scope: \n- `https: //www.googleapis.com/auth/chat.bot`\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.messages`\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces\nonly)\n\nWhen using app authentication, requests can only update messages\ncreated by the calling Chat app.", "file": "Client/UpdateMessage/main.go", "language": "GO", "clientMethod": { "shortName": "UpdateMessage", "fullName": "google.chat.v1.Client.UpdateMessage", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.UpdateMessageRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Message", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "UpdateMessage", "fullName": "google.chat.v1.ChatService.UpdateMessage", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_UpdateSpace_sync", "title": "chat UpdateSpace Sample", "description": "UpdateSpace updates a space. For an example, see\n[Update a\nspace](https: //developers.google.com/workspace/chat/update-spaces).\n\nIf you're updating the `displayName` field and receive the error message\n`ALREADY_EXISTS`, try a different display name.. An existing space within\nthe Google Workspace organization might already use this display name.\n\nSupports the following types of\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize): \n\n- [App\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-app)\nwith [administrator approval](https: //support.google.com/a?p=chat-app-auth)\nand one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.app.spaces`\n\n- [User\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following authorization scopes: \n- `https: //www.googleapis.com/auth/chat.spaces`\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces\nonly)\n- User authentication grants administrator privileges when an\nadministrator account authenticates, `use_admin_access` is `true`, and\nthe following authorization scopes is used: \n- `https: //www.googleapis.com/auth/chat.admin.spaces`\n\nApp authentication has the following limitations: \n\n- To update either `space.predefined_permission_settings` or\n`space.permission_settings`, the app must be the space creator.\n- Updating the `space.access_settings.audience` is not supported for app\nauthentication.", "file": "Client/UpdateSpace/main.go", "language": "GO", "clientMethod": { "shortName": "UpdateSpace", "fullName": "google.chat.v1.Client.UpdateSpace", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.UpdateSpaceRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.Space", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "UpdateSpace", "fullName": "google.chat.v1.ChatService.UpdateSpace", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_UpdateSpaceNotificationSetting_sync", "title": "chat UpdateSpaceNotificationSetting Sample", "description": "UpdateSpaceNotificationSetting updates the space notification setting. For an example, see [Update\nthe caller's space notification\nsetting](https: //developers.google.com/workspace/chat/update-space-notification-setting).\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith the [authorization\nscope](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.users.spacesettings`", "file": "Client/UpdateSpaceNotificationSetting/main.go", "language": "GO", "clientMethod": { "shortName": "UpdateSpaceNotificationSetting", "fullName": "google.chat.v1.Client.UpdateSpaceNotificationSetting", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.UpdateSpaceNotificationSettingRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.SpaceNotificationSetting", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "UpdateSpaceNotificationSetting", "fullName": "google.chat.v1.ChatService.UpdateSpaceNotificationSetting", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_UpdateSpaceReadState_sync", "title": "chat UpdateSpaceReadState Sample", "description": "UpdateSpaceReadState updates a user's read state within a space, used to identify read and\nunread messages. For an example, see [Update a user's space read\nstate](https: //developers.google.com/workspace/chat/update-space-read-state).\n\nRequires [user\nauthentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith the [authorization\nscope](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.users.readstate`", "file": "Client/UpdateSpaceReadState/main.go", "language": "GO", "clientMethod": { "shortName": "UpdateSpaceReadState", "fullName": "google.chat.v1.Client.UpdateSpaceReadState", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.UpdateSpaceReadStateRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.SpaceReadState", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "UpdateSpaceReadState", "fullName": "google.chat.v1.ChatService.UpdateSpaceReadState", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] }, { "regionTag": "chat_v1_generated_ChatService_UploadAttachment_sync", "title": "chat UploadAttachment Sample", "description": "UploadAttachment uploads an attachment. For an example, see\n[Upload media as a file\nattachment](https: //developers.google.com/workspace/chat/upload-media-attachments).\n\nRequires user\n[authentication](https: //developers.google.com/workspace/chat/authenticate-authorize-chat-user)\nwith one of the following [authorization\nscopes](https: //developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): \n\n- `https: //www.googleapis.com/auth/chat.messages.create`\n- `https: //www.googleapis.com/auth/chat.messages`\n- `https: //www.googleapis.com/auth/chat.import` (import mode spaces only)\n\nYou can upload attachments up to 200 MB. Certain file types aren't\nsupported. For details, see [File types blocked by Google\nChat](https: //support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat).", "file": "Client/UploadAttachment/main.go", "language": "GO", "clientMethod": { "shortName": "UploadAttachment", "fullName": "google.chat.v1.Client.UploadAttachment", "parameters": [ { "type": "context.Context", "name": "ctx" }, { "type": "chatpb.UploadAttachmentRequest", "name": "req" }, { "type": "...gax.CallOption", "name": "opts" } ], "resultType": "*chatpb.UploadAttachmentResponse", "client": { "shortName": "Client", "fullName": "google.chat.v1.Client" }, "method": { "shortName": "UploadAttachment", "fullName": "google.chat.v1.ChatService.UploadAttachment", "service": { "shortName": "ChatService", "fullName": "google.chat.v1.ChatService" } } }, "origin": "API_DEFINITION", "segments": [ { "start": 18, "end": 53, "type": "FULL" } ] } ] }