From 0730fb1e6bce2ddb6e0cd0c38424ca03cf740cb5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:10:42 -0800 Subject: [PATCH] feat: [chat] Add missing field annotations in space.proto, message.proto, reaction.proto, space_event.proto, membership.proto, attachment.proto (#5870) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add missing field annotations in space.proto, message.proto, reaction.proto, space_event.proto, membership.proto, attachment.proto docs: Update field annotations in space.proto, message.proto, reaction.proto, space_event.proto, membership.proto, attachment.proto There are unrelated changes related to filed annotations, but verified those are in the public dev docs fix!: Changed field behavior for an existing field `update_mask` and `emoji` PiperOrigin-RevId: 704249815 Source-Link: https://github.com/googleapis/googleapis/commit/27c0c3c9fb0d9ee17dd3b5fe0329bb9b0d0c2b69 Source-Link: https://github.com/googleapis/googleapis-gen/commit/6c7adc4b90abcb67d118b47dec1de688ad73ea67 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNoYXQvLk93bEJvdC55YW1sIiwiaCI6IjZjN2FkYzRiOTBhYmNiNjdkMTE4YjQ3ZGVjMWRlNjg4YWQ3M2VhNjcifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../protos/google/chat/v1/attachment.proto | 28 +- .../protos/google/chat/v1/chat_service.proto | 240 ++++++--- .../google/chat/v1/deletion_metadata.proto | 3 +- .../protos/google/chat/v1/membership.proto | 84 ++-- .../protos/google/chat/v1/message.proto | 117 +++-- .../protos/google/chat/v1/reaction.proto | 28 +- .../protos/google/chat/v1/space.proto | 138 ++++-- .../protos/google/chat/v1/space_event.proto | 8 +- packages/google-chat/protos/protos.d.ts | 112 +++++ packages/google-chat/protos/protos.js | 285 +++++++++++ packages/google-chat/protos/protos.json | 283 +++++++++-- .../v1/chat_service.create_membership.js | 38 +- .../v1/chat_service.create_message.js | 5 + .../generated/v1/chat_service.create_space.js | 6 +- .../v1/chat_service.delete_membership.js | 2 +- .../v1/chat_service.delete_message.js | 4 +- .../generated/v1/chat_service.delete_space.js | 2 +- .../v1/chat_service.get_membership.js | 6 +- .../generated/v1/chat_service.get_space.js | 2 +- .../v1/chat_service.list_memberships.js | 2 +- .../v1/chat_service.list_messages.js | 21 +- .../v1/chat_service.list_space_events.js | 4 +- .../v1/chat_service.update_membership.js | 2 +- .../v1/chat_service.update_message.js | 3 +- .../generated/v1/chat_service.update_space.js | 5 +- .../v1/snippet_metadata_google.chat.v1.json | 46 +- .../google-chat/src/v1/chat_service_client.ts | 468 +++++++++++------- 27 files changed, 1401 insertions(+), 541 deletions(-) diff --git a/packages/google-chat/protos/google/chat/v1/attachment.proto b/packages/google-chat/protos/google/chat/v1/attachment.proto index c500959e5b7..69ecd8b37a3 100644 --- a/packages/google-chat/protos/google/chat/v1/attachment.proto +++ b/packages/google-chat/protos/google/chat/v1/attachment.proto @@ -47,9 +47,9 @@ message Attachment { UPLOADED_CONTENT = 2; } - // Resource name of the attachment, in the form + // Optional. Resource name of the attachment, in the form // `spaces/{space}/messages/{message}/attachments/{attachment}`. - string name = 1; + string name = 1 [(google.api.field_behavior) = OPTIONAL]; // Output only. The original file name for the content, not the full path. string content_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -59,9 +59,11 @@ message Attachment { // The data reference to the attachment. oneof data_ref { - // A reference to the attachment data. This field is used with the media API - // to download the attachment data. - AttachmentDataRef attachment_data_ref = 4; + // Optional. A reference to the attachment data. This field is used to + // create or update messages with attachments, or with the media API to + // download the attachment data. + AttachmentDataRef attachment_data_ref = 4 + [(google.api.field_behavior) = OPTIONAL]; // Output only. A reference to the Google Drive attachment. This field is // used with the Google Drive API. @@ -90,14 +92,14 @@ message DriveDataRef { // A reference to the attachment data. message AttachmentDataRef { - // The resource name of the attachment data. This field is used with the media - // API to download the attachment data. - string resource_name = 1; - - // Opaque token containing a reference to an uploaded attachment. Treated by - // clients as an opaque string and used to create or update Chat messages with - // attachments. - string attachment_upload_token = 2; + // Optional. The resource name of the attachment data. This field is used with + // the media API to download the attachment data. + string resource_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Opaque token containing a reference to an uploaded attachment. + // Treated by clients as an opaque string and used to create or update Chat + // messages with attachments. + string attachment_upload_token = 2 [(google.api.field_behavior) = OPTIONAL]; } // Request to get an attachment. diff --git a/packages/google-chat/protos/google/chat/v1/chat_service.proto b/packages/google-chat/protos/google/chat/v1/chat_service.proto index 8b19ca34613..f051a885451 100644 --- a/packages/google-chat/protos/google/chat/v1/chat_service.proto +++ b/packages/google-chat/protos/google/chat/v1/chat_service.proto @@ -69,8 +69,11 @@ service ChatService { // Creates a message in a Google Chat space. For an example, see [Send a // message](https://developers.google.com/workspace/chat/create-messages). // - // The `create()` method requires either user or app authentication. Chat - // attributes the message sender differently depending on the type of + // The `create()` method requires either [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // or [app + // authentication](https://developers.google.com/workspace/chat/authorize-import). + // Chat attributes the message sender differently depending on the type of // authentication that you use in your request. // // The following image shows how Chat attributes a message when you use app @@ -90,6 +93,12 @@ service ChatService { // authentication](https://developers.google.com/workspace/chat/images/message-user-auth.svg) // // The maximum message size, including the message contents, is 32,000 bytes. + // + // For + // [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks) + // requests, the response doesn't contain the full message. The response only + // populates the `name` and `thread.name` fields in addition to the + // information that was in the request. rpc CreateMessage(CreateMessageRequest) returns (Message) { option (google.api.http) = { post: "/v1/{parent=spaces/*}/messages" @@ -105,6 +114,7 @@ service ChatService { // For an example, see // [List // messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list). + // // Requires [user // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse) { @@ -126,13 +136,16 @@ service ChatService { // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) // lists memberships in spaces that the authenticated user has access to. // - // Requires - // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - // Supports - // [app + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + // + // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - // and [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // You can authenticate and authorize this method with administrator + // privileges by setting the `use_admin_access` field in the request. rpc ListMemberships(ListMembershipsRequest) returns (ListMembershipsResponse) { option (google.api.http) = { @@ -145,13 +158,16 @@ service ChatService { // [Get details about a user's or Google Chat app's // membership](https://developers.google.com/workspace/chat/get-members). // - // Requires - // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - // Supports - // [app + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + // + // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - // and [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // You can authenticate and authorize this method with administrator + // privileges by setting the `use_admin_access` field in the request. rpc GetMembership(GetMembershipRequest) returns (Membership) { option (google.api.http) = { get: "/v1/{name=spaces/*/members/*}" @@ -163,13 +179,14 @@ service ChatService { // For an example, see [Get details about a // message](https://developers.google.com/workspace/chat/get-messages). // - // Requires - // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - // Supports - // [app + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + // + // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - // and [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) // // Note: Might return a message from a blocked member or space. rpc GetMessage(GetMessageRequest) returns (Message) { @@ -186,13 +203,15 @@ service ChatService { // [Update a // message](https://developers.google.com/workspace/chat/update-messages). // - // Requires - // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - // Supports - // [app + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + // + // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - // and [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // // When using app authentication, requests can only update messages // created by the calling Chat app. rpc UpdateMessage(UpdateMessageRequest) returns (Message) { @@ -211,13 +230,15 @@ service ChatService { // For an example, see [Delete a // message](https://developers.google.com/workspace/chat/delete-messages). // - // Requires - // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - // Supports - // [app + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + // + // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - // and [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // // When using app authentication, requests can only delete messages // created by the calling Chat app. rpc DeleteMessage(DeleteMessageRequest) returns (google.protobuf.Empty) { @@ -245,6 +266,7 @@ service ChatService { // Uploads an attachment. For an example, see // [Upload media as a file // attachment](https://developers.google.com/workspace/chat/upload-media-attachments). + // // Requires user // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). // @@ -264,16 +286,14 @@ service ChatService { // [List // spaces](https://developers.google.com/workspace/chat/list-spaces). // - // Requires - // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - // Supports - // [app + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + // + // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - // and [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). // - // Lists spaces visible to the caller or authenticated user. Group chats - // and DMs aren't listed until the first message is sent. + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) // // To list all named spaces by Google Workspace organization, use the // [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) @@ -286,7 +306,9 @@ service ChatService { } // Returns a list of spaces in a Google Workspace organization based on an - // administrator's search. Requires [user + // administrator's search. + // + // Requires [user // authentication with administrator // privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges). // In the request, set `use_admin_access` to `true`. @@ -301,13 +323,16 @@ service ChatService { // [Get details about a // space](https://developers.google.com/workspace/chat/get-spaces). // - // Requires - // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - // Supports - // [app + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + // + // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - // and [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // You can authenticate and authorize this method with administrator + // privileges by setting the `use_admin_access` field in the request. rpc GetSpace(GetSpaceRequest) returns (Space) { option (google.api.http) = { get: "/v1/{name=spaces/*}" @@ -315,21 +340,27 @@ service ChatService { option (google.api.method_signature) = "name"; } - // Creates a space with no members. Can be used to create a named space. - // Spaces grouped by topics aren't supported. For an example, see - // [Create a + // Creates a space with no members. Can be used to create a named space, or a + // group chat in `Import mode`. For an example, see [Create a // space](https://developers.google.com/workspace/chat/create-spaces). // // If you receive the error message `ALREADY_EXISTS` when creating // a space, try a different `displayName`. An existing space within // the Google Workspace organization might already use this display name. // - // If you're a member of the [Developer Preview - // program](https://developers.google.com/workspace/preview), you can create a - // group chat in import mode using `spaceType.GROUP_CHAT`. + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): // - // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // - [App + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with [administrator approval](https://support.google.com/a?p=chat-app-auth) + // in [Developer Preview](https://developers.google.com/workspace/preview) + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // + // When authenticating as an app, the `space.customer` field must be set in + // the request. rpc CreateSpace(CreateSpaceRequest) returns (Space) { option (google.api.http) = { post: "/v1/spaces" @@ -405,8 +436,18 @@ service ChatService { // `ALREADY_EXISTS`, try a different display name.. An existing space within // the Google Workspace organization might already use this display name. // - // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + // + // - [App + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with [administrator approval](https://support.google.com/a?p=chat-app-auth) + // in [Developer Preview](https://developers.google.com/workspace/preview) + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // You can authenticate and authorize this method with administrator + // privileges by setting the `use_admin_access` field in the request. rpc UpdateSpace(UpdateSpaceRequest) returns (Space) { option (google.api.http) = { patch: "/v1/{space.name=spaces/*}" @@ -420,9 +461,19 @@ service ChatService { // memberships in the space—are also deleted. For an example, see // [Delete a // space](https://developers.google.com/workspace/chat/delete-spaces). - // Requires [user + // + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + // + // - [App + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with [administrator approval](https://support.google.com/a?p=chat-app-auth) + // in [Developer Preview](https://developers.google.com/workspace/preview) + // + // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - // from a user who has permission to delete the space. + // You can authenticate and authorize this method with administrator + // privileges by setting the `use_admin_access` field in the request. rpc DeleteSpace(DeleteSpaceRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=spaces/*}" @@ -433,8 +484,11 @@ service ChatService { // Completes the // [import process](https://developers.google.com/workspace/chat/import-data) // for the specified space and makes it visible to users. - // Requires app authentication and domain-wide delegation. For more - // information, see [Authorize Google Chat apps to import + // + // Requires [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // and domain-wide delegation. For more information, see [Authorize Google + // Chat apps to import // data](https://developers.google.com/workspace/chat/authorize-import). rpc CompleteImportSpace(CompleteImportSpaceRequest) returns (CompleteImportSpaceResponse) { @@ -449,20 +503,24 @@ service ChatService { // see // [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). // + // With [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), + // returns the direct message space between the specified user and the calling + // Chat app. + // // With [user // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), // returns the direct message space between the specified user and the // authenticated user. // - // With [app - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), - // returns the direct message space between the specified user and the calling - // Chat app. + // // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): // - // Requires [user + // - [App + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // + // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - // or [app - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). rpc FindDirectMessage(FindDirectMessageRequest) returns (Space) { option (google.api.http) = { get: "/v1/spaces:findDirectMessage" @@ -475,8 +533,19 @@ service ChatService { // policy turned off, then they're invited, and must accept the space // invitation before joining. Otherwise, creating a membership adds the member // directly to the specified space. - // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + // + // - [App + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with [administrator approval](https://support.google.com/a?p=chat-app-auth) + // in [Developer Preview](https://developers.google.com/workspace/preview) + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // You can authenticate and authorize this method with administrator + // privileges by setting the `use_admin_access` field in the request. // // For example usage, see: // @@ -499,8 +568,18 @@ service ChatService { // Updates a membership. For an example, see [Update a user's membership in // a space](https://developers.google.com/workspace/chat/update-members). // - // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + // + // - [App + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with [administrator approval](https://support.google.com/a?p=chat-app-auth) + // in [Developer Preview](https://developers.google.com/workspace/preview) + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // You can authenticate and authorize this method with administrator + // privileges by setting the `use_admin_access` field in the request. rpc UpdateMembership(UpdateMembershipRequest) returns (Membership) { option (google.api.http) = { patch: "/v1/{membership.name=spaces/*/members/*}" @@ -513,8 +592,18 @@ service ChatService { // [Remove a user or a Google Chat app from a // space](https://developers.google.com/workspace/chat/delete-members). // - // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + // + // - [App + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with [administrator approval](https://support.google.com/a?p=chat-app-auth) + // in [Developer Preview](https://developers.google.com/workspace/preview) + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // You can authenticate and authorize this method with administrator + // privileges by setting the `use_admin_access` field in the request. rpc DeleteMembership(DeleteMembershipRequest) returns (Membership) { option (google.api.http) = { delete: "/v1/{name=spaces/*/members/*}" @@ -526,6 +615,7 @@ service ChatService { // supported. For an example, see // [Add a reaction to a // message](https://developers.google.com/workspace/chat/create-reactions). + // // Requires [user // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). rpc CreateReaction(CreateReactionRequest) returns (Reaction) { @@ -539,6 +629,7 @@ service ChatService { // Lists reactions to a message. For an example, see // [List reactions for a // message](https://developers.google.com/workspace/chat/list-reactions). + // // Requires [user // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). rpc ListReactions(ListReactionsRequest) returns (ListReactionsResponse) { @@ -552,6 +643,7 @@ service ChatService { // For an example, see // [Delete a // reaction](https://developers.google.com/workspace/chat/delete-reactions). + // // Requires [user // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). rpc DeleteReaction(DeleteReactionRequest) returns (google.protobuf.Empty) { diff --git a/packages/google-chat/protos/google/chat/v1/deletion_metadata.proto b/packages/google-chat/protos/google/chat/v1/deletion_metadata.proto index 4b208755efc..5ca7c148efc 100644 --- a/packages/google-chat/protos/google/chat/v1/deletion_metadata.proto +++ b/packages/google-chat/protos/google/chat/v1/deletion_metadata.proto @@ -28,7 +28,8 @@ option ruby_package = "Google::Apps::Chat::V1"; // Information about a deleted message. A message is deleted when `delete_time` // is set. message DeletionMetadata { - // Who deleted the message and how it was deleted. + // Who deleted the message and how it was deleted. More values may be added in + // the future. enum DeletionType { // This value is unused. DELETION_TYPE_UNSPECIFIED = 0; diff --git a/packages/google-chat/protos/google/chat/v1/membership.proto b/packages/google-chat/protos/google/chat/v1/membership.proto index 5222a49b0be..0aef1bad3d1 100644 --- a/packages/google-chat/protos/google/chat/v1/membership.proto +++ b/packages/google-chat/protos/google/chat/v1/membership.proto @@ -78,12 +78,10 @@ message Membership { ROLE_MANAGER = 2; } - // Resource name of the membership, assigned by the server. + // Identifier. Resource name of the membership, assigned by the server. // // Format: `spaces/{space}/members/{member}` - string name = 1 [ - (google.api.resource_reference) = { type: "chat.googleapis.com/Membership" } - ]; + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // Output only. State of the membership. MembershipState state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -97,16 +95,19 @@ message Membership { // Member associated with this membership. Other member types might be // supported in the future. oneof memberType { - // The Google Chat user or app the membership corresponds to. + // Optional. The Google Chat user or app the membership corresponds to. // If your Chat app [authenticates as a // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), // the output populates the // [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) // `name` and `type`. - User member = 3; + User member = 3 [(google.api.field_behavior) = OPTIONAL]; - // The Google Group the membership corresponds to. - Group group_member = 5; + // Optional. The Google Group the membership corresponds to. + // + // Reading or mutating memberships for Google Groups requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + Group group_member = 5 [(google.api.field_behavior) = OPTIONAL]; } // Optional. Immutable. The creation time of the membership, such as when a @@ -140,24 +141,45 @@ message CreateMembershipRequest { ]; // Required. The membership relation to create. + // // The `memberType` field must contain a user with the `user.name` and // `user.type` fields populated. The server will assign a resource name // and overwrite anything specified. + // // When a Chat app creates a membership relation for a human user, it must use - // the `chat.memberships` scope, set `user.type` to `HUMAN`, and set - // `user.name` with format `users/{user}`, where `{user}` can be the email - // address for the user. For users in the same Workspace organization `{user}` - // can also be the `id` of the - // [person](https://developers.google.com/people/api/rest/v1/people) from the - // People API, or the `id` for the user in the Directory API. For example, if - // the People API Person profile ID for `user@example.com` is `123456789`, you - // can add the user to the space by setting the `membership.member.name` to - // `users/user@example.com` or `users/123456789`. When a Chat app creates a - // membership relation for itself, it must use the `chat.memberships.app` - // scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + // certain authorization scopes and set specific values for certain fields: + // + // - When [authenticating as a + // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + // the `chat.memberships` authorization scope is required. + // + // - When [authenticating as an + // app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), + // the `chat.app.memberships` authorization scope is required. + // Authenticating as an app is available in [Developer + // Preview](https://developers.google.com/workspace/preview). + // + // - Set `user.type` to `HUMAN`, and set `user.name` with format + // `users/{user}`, where `{user}` can be the email address for the user. For + // users in the same Workspace organization `{user}` can also be the `id` of + // the [person](https://developers.google.com/people/api/rest/v1/people) from + // the People API, or the `id` for the user in the Directory API. For example, + // if the People API Person profile ID for `user@example.com` is `123456789`, + // you can add the user to the space by setting the `membership.member.name` + // to `users/user@example.com` or `users/123456789`. + // + // Inviting users external to the Workspace organization that owns the space + // requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // + // When a Chat app creates a membership relation for itself, it must + // [authenticate as a + // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // and use the `chat.memberships.app` scope, set `user.type` to `BOT`, and set + // `user.name` to `users/app`. Membership membership = 2 [(google.api.field_behavior) = REQUIRED]; - // When `true`, the method runs using the user's Google Workspace + // Optional. When `true`, the method runs using the user's Google Workspace // administrator privileges. // // The calling user must be a Google Workspace administrator with the @@ -170,7 +192,7 @@ message CreateMembershipRequest { // Creating app memberships or creating memberships for users outside the // administrator's Google Workspace organization isn't supported using admin // access. - bool use_admin_access = 5; + bool use_admin_access = 5 [(google.api.field_behavior) = OPTIONAL]; } // Request message for updating a membership. @@ -188,7 +210,7 @@ message UpdateMembershipRequest { google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; - // When `true`, the method runs using the user's Google Workspace + // Optional. When `true`, the method runs using the user's Google Workspace // administrator privileges. // // The calling user must be a Google Workspace administrator with the @@ -197,7 +219,7 @@ message UpdateMembershipRequest { // // Requires the `chat.admin.memberships` [OAuth 2.0 // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). - bool use_admin_access = 3; + bool use_admin_access = 3 [(google.api.field_behavior) = OPTIONAL]; } // Request message for listing memberships. @@ -290,7 +312,7 @@ message ListMembershipsRequest { // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). bool show_invited = 7 [(google.api.field_behavior) = OPTIONAL]; - // When `true`, the method runs using the user's Google Workspace + // Optional. When `true`, the method runs using the user's Google Workspace // administrator privileges. // // The calling user must be a Google Workspace administrator with the @@ -302,7 +324,7 @@ message ListMembershipsRequest { // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). // // Listing app memberships in a space isn't supported when using admin access. - bool use_admin_access = 8; + bool use_admin_access = 8 [(google.api.field_behavior) = OPTIONAL]; } // Response to list memberships of the space. @@ -326,9 +348,7 @@ message GetMembershipRequest { // // Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` // - // When [authenticated as a - // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), - // you can use the user's email as an alias for `{member}`. For example, + // You can use the user's email as an alias for `{member}`. For example, // `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the // email of the Google Chat user. string name = 1 [ @@ -336,7 +356,7 @@ message GetMembershipRequest { (google.api.resource_reference) = { type: "chat.googleapis.com/Membership" } ]; - // When `true`, the method runs using the user's Google Workspace + // Optional. When `true`, the method runs using the user's Google Workspace // administrator privileges. // // The calling user must be a Google Workspace administrator with the @@ -348,7 +368,7 @@ message GetMembershipRequest { // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). // // Getting app memberships in a space isn't supported when using admin access. - bool use_admin_access = 3; + bool use_admin_access = 3 [(google.api.field_behavior) = OPTIONAL]; } // Request to delete a membership in a space. @@ -372,7 +392,7 @@ message DeleteMembershipRequest { (google.api.resource_reference) = { type: "chat.googleapis.com/Membership" } ]; - // When `true`, the method runs using the user's Google Workspace + // Optional. When `true`, the method runs using the user's Google Workspace // administrator privileges. // // The calling user must be a Google Workspace administrator with the @@ -383,5 +403,5 @@ message DeleteMembershipRequest { // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). // // Deleting app memberships in a space isn't supported using admin access. - bool use_admin_access = 2; + bool use_admin_access = 2 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-chat/protos/google/chat/v1/message.proto b/packages/google-chat/protos/google/chat/v1/message.proto index 09a3f4d489b..bc054012e0e 100644 --- a/packages/google-chat/protos/google/chat/v1/message.proto +++ b/packages/google-chat/protos/google/chat/v1/message.proto @@ -48,7 +48,7 @@ message Message { pattern: "spaces/{space}/messages/{message}" }; - // Resource name of the message. + // Identifier. Resource name of the message. // // Format: `spaces/{space}/messages/{message}` // @@ -63,7 +63,7 @@ message Message { // `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name // a // message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). - string name = 1; + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // Output only. The user who created the message. // If your Chat app [authenticates as a @@ -95,16 +95,16 @@ message Message { google.protobuf.Timestamp delete_time = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Plain-text body of the message. The first link to an image, video, or web - // page generates a - // [preview chip](https://developers.google.com/workspace/chat/preview-links). - // You can also [@mention a Google Chat + // Optional. Plain-text body of the message. The first link to an image, + // video, or web page generates a [preview + // chip](https://developers.google.com/workspace/chat/preview-links). You can + // also [@mention a Google Chat // user](https://developers.google.com/workspace/chat/format-messages#messages-@mention), // or everyone in the space. // // To learn about creating text messages, see [Send a // message](https://developers.google.com/workspace/chat/create-messages). - string text = 4; + string text = 4 [(google.api.field_behavior) = OPTIONAL]; // Output only. Contains the message `text` with markups added to communicate // formatting. This field might not capture all formatting visible in the UI, @@ -139,7 +139,7 @@ message Message { // `cards_v2` can have a maximum size of 32 KB. repeated ContextualAddOnMarkup.Card cards = 5 [deprecated = true]; - // An array of + // Optional. An array of // [cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards). // // Only Chat apps can create cards. If your Chat app [authenticates as a @@ -150,7 +150,7 @@ message Message { // message](https://developers.google.com/workspace/chat/create-messages). // // [Card builder](https://addons.gsuite.google.com/uikit/builder) - repeated CardWithId cards_v2 = 22; + repeated CardWithId cards_v2 = 22 [(google.api.field_behavior) = OPTIONAL]; // Output only. Annotations associated with the `text` in this message. repeated Annotation annotations = 10 @@ -161,16 +161,16 @@ message Message { // thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). Thread thread = 11; - // If your Chat app [authenticates as a + // Output only. If your Chat app [authenticates as a // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), - // the output populates the + // the output only populates the // [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) // `name`. - Space space = 12; + Space space = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - // A plain-text description of the message's cards, used when the actual cards - // can't be displayed—for example, mobile notifications. - string fallback_text = 13; + // Optional. A plain-text description of the message's cards, used when the + // actual cards can't be displayed—for example, mobile notifications. + string fallback_text = 13 [(google.api.field_behavior) = OPTIONAL]; // Input only. Parameters that a Chat app can use to configure how its // response is posted. @@ -184,8 +184,8 @@ message Message { // Output only. Slash command information, if applicable. SlashCommand slash_command = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; - // User-uploaded attachment. - repeated Attachment attachment = 18; + // Optional. User-uploaded attachment. + repeated Attachment attachment = 18 [(google.api.field_behavior) = OPTIONAL]; // Output only. A URL in `spaces.messages.text` that matches a link preview // pattern. For more information, see [Preview @@ -206,16 +206,17 @@ message Message { // [`messageId`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) // field when you create the message. For details, see [Name a // message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). - string client_assigned_message_id = 32; + string client_assigned_message_id = 32 + [(google.api.field_behavior) = OPTIONAL]; // Output only. The list of emoji reaction summaries on the message. repeated EmojiReactionSummary emoji_reaction_summaries = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Immutable. Input for creating a message, otherwise output only. The user - // that can view the message. When set, the message is private and only - // visible to the specified user and the Chat app. To include this field in - // your request, you must call the Chat API using [app + // Optional. Immutable. Input for creating a message, otherwise output only. + // The user that can view the message. When set, the message is private and + // only visible to the specified user and the Chat app. To include this field + // in your request, you must call the Chat API using [app // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) // and omit the following: // @@ -225,7 +226,10 @@ message Message { // // For details, see [Send a message // privately](https://developers.google.com/workspace/chat/create-messages#private). - User private_message_viewer = 36 [(google.api.field_behavior) = IMMUTABLE]; + User private_message_viewer = 36 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; // Output only. Information about a deleted message. A message is deleted when // `delete_time` is set. @@ -241,16 +245,17 @@ message Message { repeated AttachedGif attached_gifs = 42 [(google.api.field_behavior) = OUTPUT_ONLY]; - // One or more interactive widgets that appear at the bottom of a message. - // You can add accessory widgets to messages that contain text, cards, or both - // text and cards. Not supported for messages that contain dialogs. For - // details, see [Add interactive widgets at the bottom of a + // Optional. One or more interactive widgets that appear at the bottom of a + // message. You can add accessory widgets to messages that contain text, + // cards, or both text and cards. Not supported for messages that contain + // dialogs. For details, see [Add interactive widgets at the bottom of a // message](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets). // // Creating a message with accessory widgets requires [app // authentication] // (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). - repeated AccessoryWidget accessory_widgets = 44; + repeated AccessoryWidget accessory_widgets = 44 + [(google.api.field_behavior) = OPTIONAL]; } // A GIF image that's specified by a URL. @@ -293,10 +298,10 @@ message Thread { pattern: "spaces/{space}/threads/{thread}" }; - // Resource name of the thread. + // Identifier. Resource name of the thread. // // Example: `spaces/{space}/threads/{thread}` - string name = 1; + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // Optional. Input for creating or updating a thread. Otherwise, output only. // ID for the thread. Supports up to 4000 characters. @@ -345,8 +350,8 @@ message ActionResponse { repeated google.apps.card.v1.SelectionInput.SelectionItem items = 1; } - // The response of the updated widget. - // Used to provide autocomplete options for a widget. + // For `selectionInput` widgets, returns autocomplete suggestions for a + // multiselect menu. message UpdatedWidget { // The widget updated in response to a user action. oneof updated_widget { @@ -417,14 +422,14 @@ message DeleteMessageRequest { (google.api.resource_reference) = { type: "chat.googleapis.com/Message" } ]; - // When `true`, deleting a message also deletes its threaded replies. When - // `false`, if a message has threaded replies, deletion fails. + // Optional. When `true`, deleting a message also deletes its threaded + // replies. When `false`, if a message has threaded replies, deletion fails. // // Only applies when [authenticating as a // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). // Has no effect when [authenticating as a Chat app] // (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). - bool force = 2; + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; } // Request to update a message. @@ -449,7 +454,8 @@ message UpdateMessageRequest { // // - `accessory_widgets` (Requires [app // authentication](/chat/api/guides/auth/service-accounts).) - google.protobuf.FieldMask update_mask = 2; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; // Optional. If `true` and the message isn't found, a new message is created // and `updateMask` is ignored. The specified message ID must be @@ -512,6 +518,12 @@ message CreateMessageRequest { // Optional. Specifies whether a message starts a thread or replies to one. // Only supported in named spaces. + // + // When [responding to user + // interactions](https://developers.google.com/workspace/chat/receive-respond-interactions), + // this field is ignored. For interactions within a thread, the reply is + // created in the same thread. Otherwise, the reply is created as a new + // thread. MessageReplyOption message_reply_option = 8 [(google.api.field_behavior) = OPTIONAL]; @@ -545,8 +557,8 @@ message ListMessagesRequest { } ]; - // The maximum number of messages returned. The service might return fewer - // messages than this value. + // Optional. The maximum number of messages returned. The service might return + // fewer messages than this value. // // If unspecified, at most 25 are returned. // @@ -554,19 +566,17 @@ message ListMessagesRequest { // automatically changed to 1000. // // Negative values return an `INVALID_ARGUMENT` error. - int32 page_size = 2; + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional, if resuming from a previous query. - // - // A page token received from a previous list messages call. Provide this - // parameter to retrieve the subsequent page. + // Optional. A page token received from a previous list messages call. Provide + // this parameter to retrieve the subsequent page. // // When paginating, all other parameters provided should match the call that // provided the page token. Passing different values to the other parameters // might lead to unexpected results. - string page_token = 3; + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - // A query filter. + // Optional. A query filter. // // You can filter messages by date (`create_time`) and thread (`thread.name`). // @@ -603,23 +613,22 @@ message ListMessagesRequest { // // Invalid queries are rejected by the server with an `INVALID_ARGUMENT` // error. - string filter = 4; + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional, if resuming from a previous query. - // - // How the list of messages is ordered. Specify a value to order by an - // ordering operation. Valid ordering operation values are as follows: + // Optional. How the list of messages is ordered. Specify a value to order by + // an ordering operation. Valid ordering operation values are as follows: // // - `ASC` for ascending. // // - `DESC` for descending. // // The default ordering is `create_time ASC`. - string order_by = 5; + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; - // Whether to include deleted messages. Deleted messages include deleted time - // and metadata about their deletion, but message content is unavailable. - bool show_deleted = 6; + // Optional. Whether to include deleted messages. Deleted messages include + // deleted time and metadata about their deletion, but message content is + // unavailable. + bool show_deleted = 6 [(google.api.field_behavior) = OPTIONAL]; } // Response message for listing messages. diff --git a/packages/google-chat/protos/google/chat/v1/reaction.proto b/packages/google-chat/protos/google/chat/v1/reaction.proto index 9639b1f5b29..a08903bb1ef 100644 --- a/packages/google-chat/protos/google/chat/v1/reaction.proto +++ b/packages/google-chat/protos/google/chat/v1/reaction.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.chat.v1; import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; import "google/api/resource.proto"; import "google/chat/v1/user.proto"; @@ -36,24 +37,24 @@ message Reaction { pattern: "spaces/{space}/messages/{message}/reactions/{reaction}" }; - // The resource name of the reaction. + // Identifier. The resource name of the reaction. // // Format: `spaces/{space}/messages/{message}/reactions/{reaction}` - string name = 1; + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // Output only. The user who created the reaction. User user = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The emoji used in the reaction. - Emoji emoji = 3; + // Required. The emoji used in the reaction. + Emoji emoji = 3 [(google.api.field_behavior) = REQUIRED]; } // An emoji that is used as a reaction to a message. message Emoji { - // The content of the emoji. + // Required. The content of the emoji. oneof content { - // A basic emoji represented by a unicode string. - string unicode = 1; + // Optional. A basic emoji represented by a unicode string. + string unicode = 1 [(google.api.field_behavior) = OPTIONAL]; // Output only. A custom emoji. CustomEmoji custom_emoji = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -63,16 +64,19 @@ message Emoji { // Represents a custom emoji. message CustomEmoji { // Output only. Unique key for the custom emoji resource. - string uid = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + string uid = 1 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; } // The number of people who reacted to a message with a specific emoji. message EmojiReactionSummary { - // Emoji associated with the reactions. - Emoji emoji = 1; + // Output only. Emoji associated with the reactions. + Emoji emoji = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The total number of reactions using the associated emoji. - optional int32 reaction_count = 2; + // Output only. The total number of reactions using the associated emoji. + optional int32 reaction_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Creates a reaction to a message. diff --git a/packages/google-chat/protos/google/chat/v1/space.proto b/packages/google-chat/protos/google/chat/v1/space.proto index 47b1aa1ac54..5b6edb5fd38 100644 --- a/packages/google-chat/protos/google/chat/v1/space.proto +++ b/packages/google-chat/protos/google/chat/v1/space.proto @@ -95,22 +95,23 @@ message Space { // discussion topic, functional purpose, or participants. // // Supports up to 150 characters. - string description = 1; + string description = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. The space's rules, expectations, and etiquette. // // Supports up to 5,000 characters. - string guidelines = 2; + string guidelines = 2 [(google.api.field_behavior) = OPTIONAL]; } // Represents the count of memberships of a space, grouped into categories. message MembershipCount { - // Count of human users that have directly joined the space, not counting - // users joined by having membership in a joined group. - int32 joined_direct_human_user_count = 4; + // Output only. Count of human users that have directly joined the space, + // not counting users joined by having membership in a joined group. + int32 joined_direct_human_user_count = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Count of all groups that have directly joined the space. - int32 joined_group_count = 5; + // Output only. Count of all groups that have directly joined the space. + int32 joined_group_count = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Represents the [access @@ -131,6 +132,9 @@ message Space { // invited to the space can also discover and access the space. To learn // more, see [Make a space discoverable to specific // users](https://developers.google.com/workspace/chat/space-target-audience). + // + // Creating discoverable spaces requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). DISCOVERABLE = 2; } @@ -150,8 +154,23 @@ message Space { // To use the default target audience for the Google Workspace organization, // set to `audiences/default`. // + // Reading the target audience supports: + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // + // - [App + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with [administrator + // approval](https://support.google.com/a?p=chat-app-auth) + // with the `chat.app.spaces` scope in [Developer + // Preview](https://developers.google.com/workspace/preview). + // // This field is not populated when using the `chat.bot` scope with [app // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + // + // Setting the target audience requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). string audience = 3 [(google.api.field_behavior) = OPTIONAL]; } @@ -178,42 +197,50 @@ message Space { // To set permission settings when creating a space, specify the // `PredefinedPermissionSettings` field in your request. message PermissionSettings { - // Setting for managing members and groups in a space. - optional PermissionSetting manage_members_and_groups = 1; + // Optional. Setting for managing members and groups in a space. + optional PermissionSetting manage_members_and_groups = 1 + [(google.api.field_behavior) = OPTIONAL]; - // Setting for updating space name, avatar, description and guidelines. - optional PermissionSetting modify_space_details = 2; + // Optional. Setting for updating space name, avatar, description and + // guidelines. + optional PermissionSetting modify_space_details = 2 + [(google.api.field_behavior) = OPTIONAL]; - // Setting for toggling space history on and off. - optional PermissionSetting toggle_history = 3; + // Optional. Setting for toggling space history on and off. + optional PermissionSetting toggle_history = 3 + [(google.api.field_behavior) = OPTIONAL]; - // Setting for using @all in a space. - optional PermissionSetting use_at_mention_all = 4; + // Optional. Setting for using @all in a space. + optional PermissionSetting use_at_mention_all = 4 + [(google.api.field_behavior) = OPTIONAL]; - // Setting for managing apps in a space. - optional PermissionSetting manage_apps = 5; + // Optional. Setting for managing apps in a space. + optional PermissionSetting manage_apps = 5 + [(google.api.field_behavior) = OPTIONAL]; - // Setting for managing webhooks in a space. - optional PermissionSetting manage_webhooks = 6; + // Optional. Setting for managing webhooks in a space. + optional PermissionSetting manage_webhooks = 6 + [(google.api.field_behavior) = OPTIONAL]; // Output only. Setting for posting messages in a space. optional PermissionSetting post_messages = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Setting for replying to messages in a space. - optional PermissionSetting reply_messages = 8; + // Optional. Setting for replying to messages in a space. + optional PermissionSetting reply_messages = 8 + [(google.api.field_behavior) = OPTIONAL]; } // Represents a space permission setting. message PermissionSetting { - // Whether spaces managers have this permission. - bool managers_allowed = 1; + // Optional. Whether spaces managers have this permission. + bool managers_allowed = 1 [(google.api.field_behavior) = OPTIONAL]; - // Whether non-manager members have this permission. - bool members_allowed = 2; + // Optional. Whether non-manager members have this permission. + bool members_allowed = 2 [(google.api.field_behavior) = OPTIONAL]; } - // Resource name of the space. + // Identifier. Resource name of the space. // // Format: `spaces/{space}` // @@ -223,15 +250,15 @@ message Space { // method or from the space URL. For example, if the space URL // is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID // is `AAAAAAAAA`. - string name = 1; + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // Output only. Deprecated: Use `space_type` instead. // The type of a space. Type type = 2 [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - // The type of space. Required when creating a space or updating the space - // type of a space. Output only for other usage. - SpaceType space_type = 10; + // Optional. The type of space. Required when creating a space or updating the + // space type of a space. Output only for other usage. + SpaceType space_type = 10 [(google.api.field_behavior) = OPTIONAL]; // Optional. Whether the space is a DM between a Chat app and a single // human. @@ -242,7 +269,7 @@ message Space { bool threaded = 5 [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - // The space's display name. Required when [creating a + // Optional. The space's display name. Required when [creating a // space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) // with a `spaceType` of `SPACE`. If you receive the error message // `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a @@ -252,32 +279,39 @@ message Space { // For direct messages, this field might be empty. // // Supports up to 128 characters. - string display_name = 3; + string display_name = 3 [(google.api.field_behavior) = OPTIONAL]; - // Immutable. Whether this space permits any Google Chat user as a member. - // Input when creating a space in a Google Workspace organization. Omit this - // field when creating spaces in the following conditions: + // Optional. Immutable. Whether this space permits any Google Chat user as a + // member. Input when creating a space in a Google Workspace organization. + // Omit this field when creating spaces in the following conditions: // // * The authenticated user uses a consumer account (unmanaged user // account). By default, a space created by a consumer account permits any // Google Chat user. // // For existing spaces, this field is output only. - bool external_user_allowed = 8 [(google.api.field_behavior) = IMMUTABLE]; + bool external_user_allowed = 8 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; // Output only. The threading state in the Chat space. SpaceThreadingState space_threading_state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Details about the space including description and rules. - SpaceDetails space_details = 11; + // Optional. Details about the space including description and rules. + SpaceDetails space_details = 11 [(google.api.field_behavior) = OPTIONAL]; - // The message history state for messages and threads in this space. - HistoryState space_history_state = 13; + // Optional. The message history state for messages and threads in this space. + HistoryState space_history_state = 13 + [(google.api.field_behavior) = OPTIONAL]; // Optional. Whether this space is created in `Import Mode` as part of a data // migration into Google Workspace. While spaces are being imported, they // aren't visible to users until the import is complete. + // + // Creating a space in `Import Mode`requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). bool import_mode = 16 [(google.api.field_behavior) = OPTIONAL]; // Optional. Immutable. For spaces created in Chat, the time the space was @@ -322,6 +356,9 @@ message Space { // Represents the [permission settings] // (https://support.google.com/chat/answer/13340792) of a space. Only // populated when the `space_type` is `SPACE`. + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). oneof space_permission_settings { // Optional. Input only. Predefined space permission settings, input only // when creating a space. If the field is not set, a collaboration space is @@ -353,15 +390,13 @@ message Space { // A request to create a named space with no members. message CreateSpaceRequest { // Required. The `displayName` and `spaceType` fields must be populated. Only - // `SpaceType.SPACE` is supported. + // `SpaceType.SPACE` and `SpaceType.GROUP_CHAT` are supported. + // `SpaceType.GROUP_CHAT` can only be used if `importMode` is set to true. // // If you receive the error message `ALREADY_EXISTS`, // try a different `displayName`. An existing space within the Google // Workspace organization might already use this display name. // - // If you're a member of the [Developer Preview - // program](https://developers.google.com/workspace/preview), - // `SpaceType.GROUP_CHAT` can be used if `importMode` is set to true. // // The space `name` is assigned on the server so anything specified in this // field will be ignored. @@ -440,7 +475,7 @@ message GetSpaceRequest { (google.api.resource_reference) = { type: "chat.googleapis.com/Space" } ]; - // When `true`, the method runs using the user's Google Workspace + // Optional. When `true`, the method runs using the user's Google Workspace // administrator privileges. // // The calling user must be a Google Workspace administrator with the @@ -449,7 +484,7 @@ message GetSpaceRequest { // // Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0 // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). - bool use_admin_access = 2; + bool use_admin_access = 2 [(google.api.field_behavior) = OPTIONAL]; } // A request to get direct message space based on the user resource. @@ -538,9 +573,10 @@ message UpdateSpaceRequest { // - `permission_settings.manageApps` // - `permission_settings.manageWebhooks` // - `permission_settings.replyMessages` - google.protobuf.FieldMask update_mask = 2; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; - // When `true`, the method runs using the user's Google Workspace + // Optional. When `true`, the method runs using the user's Google Workspace // administrator privileges. // // The calling user must be a Google Workspace administrator with the @@ -552,7 +588,7 @@ message UpdateSpaceRequest { // // Some `FieldMask` values are not supported using admin access. For details, // see the description of `update_mask`. - bool use_admin_access = 3; + bool use_admin_access = 3 [(google.api.field_behavior) = OPTIONAL]; } // Request to search for a list of spaces based on a query. @@ -710,7 +746,7 @@ message DeleteSpaceRequest { (google.api.resource_reference) = { type: "chat.googleapis.com/Space" } ]; - // When `true`, the method runs using the user's Google Workspace + // Optional. When `true`, the method runs using the user's Google Workspace // administrator privileges. // // The calling user must be a Google Workspace administrator with the @@ -719,7 +755,7 @@ message DeleteSpaceRequest { // // Requires the `chat.admin.delete` [OAuth 2.0 // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). - bool use_admin_access = 2; + bool use_admin_access = 2 [(google.api.field_behavior) = OPTIONAL]; } // Request message for completing the import process for a space. diff --git a/packages/google-chat/protos/google/chat/v1/space_event.proto b/packages/google-chat/protos/google/chat/v1/space_event.proto index 8e450ad8c92..0d8d5bcd5bd 100644 --- a/packages/google-chat/protos/google/chat/v1/space_event.proto +++ b/packages/google-chat/protos/google/chat/v1/space_event.proto @@ -216,15 +216,15 @@ message ListSpaceEventsRequest { // return fewer than this value. // // Negative values return an `INVALID_ARGUMENT` error. - int32 page_size = 5; + int32 page_size = 5 [(google.api.field_behavior) = OPTIONAL]; - // A page token, received from a previous list space events call. Provide this - // to retrieve the subsequent page. + // Optional. A page token, received from a previous list space events call. + // Provide this to retrieve the subsequent page. // // When paginating, all other parameters provided to list space events must // match the call that provided the page token. Passing different values to // the other parameters might lead to unexpected results. - string page_token = 6; + string page_token = 6 [(google.api.field_behavior) = OPTIONAL]; // Required. A query filter. // diff --git a/packages/google-chat/protos/protos.d.ts b/packages/google-chat/protos/protos.d.ts index 465a6dd8af7..ae19cfa79e0 100644 --- a/packages/google-chat/protos/protos.d.ts +++ b/packages/google-chat/protos/protos.d.ts @@ -3062,6 +3062,9 @@ export namespace google { /** FieldOptions .google.api.fieldBehavior */ ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); } /** Represents a FieldOptions. */ @@ -24755,5 +24758,114 @@ export namespace google { GA = 4, DEPRECATED = 5 } + + /** Properties of a FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } } } diff --git a/packages/google-chat/protos/protos.js b/packages/google-chat/protos/protos.js index af236cc1541..05bb4401a6a 100644 --- a/packages/google-chat/protos/protos.js +++ b/packages/google-chat/protos/protos.js @@ -8074,6 +8074,7 @@ * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo */ /** @@ -8215,6 +8216,14 @@ */ FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + /** * Creates a new FieldOptions instance using the specified properties. * @function create @@ -8276,6 +8285,8 @@ } if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); return writer; }; @@ -8388,6 +8399,10 @@ message[".google.api.fieldBehavior"].push(reader.int32()); break; } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8535,6 +8550,11 @@ break; } } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } return null; }; @@ -8754,6 +8774,11 @@ break; } } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } return message; }; @@ -8788,6 +8813,7 @@ object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; @@ -8831,6 +8857,8 @@ } if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); return object; }; @@ -63298,6 +63326,263 @@ return values; })(); + api.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + return api; })(); diff --git a/packages/google-chat/protos/protos.json b/packages/google-chat/protos/protos.json index 7e5a6ad9d6f..c6c3583fce8 100644 --- a/packages/google-chat/protos/protos.json +++ b/packages/google-chat/protos/protos.json @@ -2628,7 +2628,10 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "contentName": { "type": "string", @@ -2646,7 +2649,10 @@ }, "attachmentDataRef": { "type": "AttachmentDataRef", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "driveDataRef": { "type": "DriveDataRef", @@ -2699,11 +2705,17 @@ "fields": { "resourceName": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "attachmentUploadToken": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -3345,7 +3357,7 @@ "type": "string", "id": 1, "options": { - "(google.api.resource_reference).type": "chat.googleapis.com/Membership" + "(google.api.field_behavior)": "IDENTIFIER" } }, "state": { @@ -3364,11 +3376,17 @@ }, "member": { "type": "User", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "groupMember": { "type": "Group", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "createTime": { "type": "google.protobuf.Timestamp", @@ -3422,7 +3440,10 @@ }, "useAdminAccess": { "type": "bool", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -3444,7 +3465,10 @@ }, "useAdminAccess": { "type": "bool", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -3495,7 +3519,10 @@ }, "useAdminAccess": { "type": "bool", - "id": 8 + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -3527,7 +3554,10 @@ }, "useAdminAccess": { "type": "bool", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -3543,7 +3573,10 @@ }, "useAdminAccess": { "type": "bool", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -3563,7 +3596,10 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } }, "sender": { "type": "User", @@ -3595,7 +3631,10 @@ }, "text": { "type": "string", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "formattedText": { "type": "string", @@ -3615,7 +3654,10 @@ "cardsV2": { "rule": "repeated", "type": "CardWithId", - "id": 22 + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "annotations": { "rule": "repeated", @@ -3631,11 +3673,17 @@ }, "space": { "type": "Space", - "id": 12 + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "fallbackText": { "type": "string", - "id": 13 + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "actionResponse": { "type": "ActionResponse", @@ -3661,7 +3709,10 @@ "attachment": { "rule": "repeated", "type": "Attachment", - "id": 18 + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "matchedUrl": { "type": "MatchedUrl", @@ -3679,7 +3730,10 @@ }, "clientAssignedMessageId": { "type": "string", - "id": 32 + "id": 32, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "emojiReactionSummaries": { "rule": "repeated", @@ -3693,7 +3747,7 @@ "type": "User", "id": 36, "options": { - "(google.api.field_behavior)": "IMMUTABLE" + "(google.api.field_behavior)": "OPTIONAL" } }, "deletionMetadata": { @@ -3721,7 +3775,10 @@ "accessoryWidgets": { "rule": "repeated", "type": "AccessoryWidget", - "id": 44 + "id": 44, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -3767,7 +3824,10 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } }, "threadKey": { "type": "string", @@ -3890,7 +3950,10 @@ }, "force": { "type": "bool", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -3905,7 +3968,10 @@ }, "updateMask": { "type": "google.protobuf.FieldMask", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "allowMissing": { "type": "bool", @@ -3985,23 +4051,38 @@ }, "pageSize": { "type": "int32", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "filter": { "type": "string", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "orderBy": { "type": "string", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "showDeleted": { "type": "bool", - "id": 6 + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -4444,7 +4525,10 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } }, "user": { "type": "User", @@ -4455,7 +4539,10 @@ }, "emoji": { "type": "Emoji", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -4471,7 +4558,10 @@ "fields": { "unicode": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "customEmoji": { "type": "CustomEmoji", @@ -4488,6 +4578,7 @@ "type": "string", "id": 1, "options": { + "(google.api.field_info).format": "UUID4", "(google.api.field_behavior)": "OUTPUT_ONLY" } } @@ -4504,12 +4595,16 @@ "fields": { "emoji": { "type": "Emoji", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "reactionCount": { "type": "int32", "id": 2, "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", "proto3_optional": true } } @@ -4616,7 +4711,10 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } }, "type": { "type": "Type", @@ -4628,7 +4726,10 @@ }, "spaceType": { "type": "SpaceType", - "id": 10 + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "singleUserBotDm": { "type": "bool", @@ -4647,13 +4748,16 @@ }, "displayName": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "externalUserAllowed": { "type": "bool", "id": 8, "options": { - "(google.api.field_behavior)": "IMMUTABLE" + "(google.api.field_behavior)": "OPTIONAL" } }, "spaceThreadingState": { @@ -4665,11 +4769,17 @@ }, "spaceDetails": { "type": "SpaceDetails", - "id": 11 + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "spaceHistoryState": { "type": "HistoryState", - "id": 13 + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "importMode": { "type": "bool", @@ -4770,11 +4880,17 @@ "fields": { "description": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "guidelines": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -4782,11 +4898,17 @@ "fields": { "joinedDirectHumanUserCount": { "type": "int32", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "joinedGroupCount": { "type": "int32", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -4872,6 +4994,7 @@ "type": "PermissionSetting", "id": 1, "options": { + "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } }, @@ -4879,6 +5002,7 @@ "type": "PermissionSetting", "id": 2, "options": { + "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } }, @@ -4886,6 +5010,7 @@ "type": "PermissionSetting", "id": 3, "options": { + "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } }, @@ -4893,6 +5018,7 @@ "type": "PermissionSetting", "id": 4, "options": { + "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } }, @@ -4900,6 +5026,7 @@ "type": "PermissionSetting", "id": 5, "options": { + "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } }, @@ -4907,6 +5034,7 @@ "type": "PermissionSetting", "id": 6, "options": { + "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } }, @@ -4922,6 +5050,7 @@ "type": "PermissionSetting", "id": 8, "options": { + "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } } @@ -4931,11 +5060,17 @@ "fields": { "managersAllowed": { "type": "bool", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "membersAllowed": { "type": "bool", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } } @@ -5009,7 +5144,10 @@ }, "useAdminAccess": { "type": "bool", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -5035,11 +5173,17 @@ }, "updateMask": { "type": "google.protobuf.FieldMask", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "useAdminAccess": { "type": "bool", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -5102,7 +5246,10 @@ }, "useAdminAccess": { "type": "bool", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -5273,11 +5420,17 @@ }, "pageSize": { "type": "int32", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", - "id": 6 + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "filter": { "type": "string", @@ -5598,9 +5751,9 @@ "api": { "options": { "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/api;api", + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "LaunchStageProto", + "java_outer_classname": "FieldInfoProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI" }, @@ -6082,6 +6235,30 @@ "GA": 4, "DEPRECATED": 5 } + }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } } } } diff --git a/packages/google-chat/samples/generated/v1/chat_service.create_membership.js b/packages/google-chat/samples/generated/v1/chat_service.create_membership.js index 3931cf503f9..a022e937b44 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.create_membership.js +++ b/packages/google-chat/samples/generated/v1/chat_service.create_membership.js @@ -40,21 +40,35 @@ function main(parent, membership) { * `user.type` fields populated. The server will assign a resource name * and overwrite anything specified. * When a Chat app creates a membership relation for a human user, it must use - * the `chat.memberships` scope, set `user.type` to `HUMAN`, and set - * `user.name` with format `users/{user}`, where `{user}` can be the email - * address for the user. For users in the same Workspace organization `{user}` - * can also be the `id` of the - * person (https://developers.google.com/people/api/rest/v1/people) from the - * People API, or the `id` for the user in the Directory API. For example, if - * the People API Person profile ID for `user@example.com` is `123456789`, you - * can add the user to the space by setting the `membership.member.name` to - * `users/user@example.com` or `users/123456789`. When a Chat app creates a - * membership relation for itself, it must use the `chat.memberships.app` - * scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + * certain authorization scopes and set specific values for certain fields: + * - When authenticating as a + * user (https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the `chat.memberships` authorization scope is required. + * - When authenticating as an + * app (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), + * the `chat.app.memberships` authorization scope is required. + * Authenticating as an app is available in Developer + * Preview (https://developers.google.com/workspace/preview). + * - Set `user.type` to `HUMAN`, and set `user.name` with format + * `users/{user}`, where `{user}` can be the email address for the user. For + * users in the same Workspace organization `{user}` can also be the `id` of + * the person (https://developers.google.com/people/api/rest/v1/people) from + * the People API, or the `id` for the user in the Directory API. For example, + * if the People API Person profile ID for `user@example.com` is `123456789`, + * you can add the user to the space by setting the `membership.member.name` + * to `users/user@example.com` or `users/123456789`. + * Inviting users external to the Workspace organization that owns the space + * requires user + * authentication (https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * When a Chat app creates a membership relation for itself, it must + * authenticate as a + * user (https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * and use the `chat.memberships.app` scope, set `user.type` to `BOT`, and set + * `user.name` to `users/app`. */ // const membership = {} /** - * When `true`, the method runs using the user's Google Workspace + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * The calling user must be a Google Workspace administrator with the * manage chat and spaces conversations diff --git a/packages/google-chat/samples/generated/v1/chat_service.create_message.js b/packages/google-chat/samples/generated/v1/chat_service.create_message.js index e5c328bc56b..1a2f3935057 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.create_message.js +++ b/packages/google-chat/samples/generated/v1/chat_service.create_message.js @@ -46,6 +46,11 @@ function main(parent, message) { /** * Optional. Specifies whether a message starts a thread or replies to one. * Only supported in named spaces. + * When responding to user + * interactions (https://developers.google.com/workspace/chat/receive-respond-interactions), + * this field is ignored. For interactions within a thread, the reply is + * created in the same thread. Otherwise, the reply is created as a new + * thread. */ // const messageReplyOption = {} /** diff --git a/packages/google-chat/samples/generated/v1/chat_service.create_space.js b/packages/google-chat/samples/generated/v1/chat_service.create_space.js index b32a3d2960d..9e39ccb9528 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.create_space.js +++ b/packages/google-chat/samples/generated/v1/chat_service.create_space.js @@ -30,13 +30,11 @@ function main(space) { */ /** * Required. The `displayName` and `spaceType` fields must be populated. Only - * `SpaceType.SPACE` is supported. + * `SpaceType.SPACE` and `SpaceType.GROUP_CHAT` are supported. + * `SpaceType.GROUP_CHAT` can only be used if `importMode` is set to true. * If you receive the error message `ALREADY_EXISTS`, * try a different `displayName`. An existing space within the Google * Workspace organization might already use this display name. - * If you're a member of the Developer Preview - * program (https://developers.google.com/workspace/preview), - * `SpaceType.GROUP_CHAT` can be used if `importMode` is set to true. * The space `name` is assigned on the server so anything specified in this * field will be ignored. */ diff --git a/packages/google-chat/samples/generated/v1/chat_service.delete_membership.js b/packages/google-chat/samples/generated/v1/chat_service.delete_membership.js index 0fe2f98d69d..73a7730ff81 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.delete_membership.js +++ b/packages/google-chat/samples/generated/v1/chat_service.delete_membership.js @@ -43,7 +43,7 @@ function main(name) { */ // const name = 'abc123' /** - * When `true`, the method runs using the user's Google Workspace + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * The calling user must be a Google Workspace administrator with the * manage chat and spaces conversations diff --git a/packages/google-chat/samples/generated/v1/chat_service.delete_message.js b/packages/google-chat/samples/generated/v1/chat_service.delete_message.js index 16f7a97b9db..9d8d6d96483 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.delete_message.js +++ b/packages/google-chat/samples/generated/v1/chat_service.delete_message.js @@ -38,8 +38,8 @@ function main(name) { */ // const name = 'abc123' /** - * When `true`, deleting a message also deletes its threaded replies. When - * `false`, if a message has threaded replies, deletion fails. + * Optional. When `true`, deleting a message also deletes its threaded + * replies. When `false`, if a message has threaded replies, deletion fails. * Only applies when authenticating as a * user (https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * Has no effect when authenticating as a Chat app diff --git a/packages/google-chat/samples/generated/v1/chat_service.delete_space.js b/packages/google-chat/samples/generated/v1/chat_service.delete_space.js index bc74b47be03..c056ba73a06 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.delete_space.js +++ b/packages/google-chat/samples/generated/v1/chat_service.delete_space.js @@ -34,7 +34,7 @@ function main(name) { */ // const name = 'abc123' /** - * When `true`, the method runs using the user's Google Workspace + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * The calling user must be a Google Workspace administrator with the * manage chat and spaces conversations diff --git a/packages/google-chat/samples/generated/v1/chat_service.get_membership.js b/packages/google-chat/samples/generated/v1/chat_service.get_membership.js index 21260f3fe4b..73f70dc7765 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.get_membership.js +++ b/packages/google-chat/samples/generated/v1/chat_service.get_membership.js @@ -34,15 +34,13 @@ function main(name) { * authentication (https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), * you can optionally use `spaces/{space}/members/app`. * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` - * When authenticated as a - * user (https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), - * you can use the user's email as an alias for `{member}`. For example, + * You can use the user's email as an alias for `{member}`. For example, * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the * email of the Google Chat user. */ // const name = 'abc123' /** - * When `true`, the method runs using the user's Google Workspace + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * The calling user must be a Google Workspace administrator with the * manage chat and spaces conversations diff --git a/packages/google-chat/samples/generated/v1/chat_service.get_space.js b/packages/google-chat/samples/generated/v1/chat_service.get_space.js index 0c5aff0f7d3..6b614451e4f 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.get_space.js +++ b/packages/google-chat/samples/generated/v1/chat_service.get_space.js @@ -34,7 +34,7 @@ function main(name) { */ // const name = 'abc123' /** - * When `true`, the method runs using the user's Google Workspace + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * The calling user must be a Google Workspace administrator with the * manage chat and spaces conversations diff --git a/packages/google-chat/samples/generated/v1/chat_service.list_memberships.js b/packages/google-chat/samples/generated/v1/chat_service.list_memberships.js index 5f15a3fc803..19b92b03839 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.list_memberships.js +++ b/packages/google-chat/samples/generated/v1/chat_service.list_memberships.js @@ -101,7 +101,7 @@ function main(parent) { */ // const showInvited = true /** - * When `true`, the method runs using the user's Google Workspace + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * The calling user must be a Google Workspace administrator with the * manage chat and spaces conversations diff --git a/packages/google-chat/samples/generated/v1/chat_service.list_messages.js b/packages/google-chat/samples/generated/v1/chat_service.list_messages.js index 9c903910a4b..a4157a8f777 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.list_messages.js +++ b/packages/google-chat/samples/generated/v1/chat_service.list_messages.js @@ -34,8 +34,8 @@ function main(parent) { */ // const parent = 'abc123' /** - * The maximum number of messages returned. The service might return fewer - * messages than this value. + * Optional. The maximum number of messages returned. The service might return + * fewer messages than this value. * If unspecified, at most 25 are returned. * The maximum value is 1000. If you use a value more than 1000, it's * automatically changed to 1000. @@ -43,16 +43,15 @@ function main(parent) { */ // const pageSize = 1234 /** - * Optional, if resuming from a previous query. - * A page token received from a previous list messages call. Provide this - * parameter to retrieve the subsequent page. + * Optional. A page token received from a previous list messages call. Provide + * this parameter to retrieve the subsequent page. * When paginating, all other parameters provided should match the call that * provided the page token. Passing different values to the other parameters * might lead to unexpected results. */ // const pageToken = 'abc123' /** - * A query filter. + * Optional. A query filter. * You can filter messages by date (`create_time`) and thread (`thread.name`). * To filter messages by the date they were created, specify the `create_time` * with a timestamp in RFC-3339 (https://www.rfc-editor.org/rfc/rfc3339) @@ -81,17 +80,17 @@ function main(parent) { */ // const filter = 'abc123' /** - * Optional, if resuming from a previous query. - * How the list of messages is ordered. Specify a value to order by an - * ordering operation. Valid ordering operation values are as follows: + * Optional. How the list of messages is ordered. Specify a value to order by + * an ordering operation. Valid ordering operation values are as follows: * - `ASC` for ascending. * - `DESC` for descending. * The default ordering is `create_time ASC`. */ // const orderBy = 'abc123' /** - * Whether to include deleted messages. Deleted messages include deleted time - * and metadata about their deletion, but message content is unavailable. + * Optional. Whether to include deleted messages. Deleted messages include + * deleted time and metadata about their deletion, but message content is + * unavailable. */ // const showDeleted = true diff --git a/packages/google-chat/samples/generated/v1/chat_service.list_space_events.js b/packages/google-chat/samples/generated/v1/chat_service.list_space_events.js index fafaf3d203b..68adca55893 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.list_space_events.js +++ b/packages/google-chat/samples/generated/v1/chat_service.list_space_events.js @@ -42,8 +42,8 @@ function main(parent, filter) { */ // const pageSize = 1234 /** - * A page token, received from a previous list space events call. Provide this - * to retrieve the subsequent page. + * Optional. A page token, received from a previous list space events call. + * Provide this to retrieve the subsequent page. * When paginating, all other parameters provided to list space events must * match the call that provided the page token. Passing different values to * the other parameters might lead to unexpected results. diff --git a/packages/google-chat/samples/generated/v1/chat_service.update_membership.js b/packages/google-chat/samples/generated/v1/chat_service.update_membership.js index 3369de25380..b0302c98988 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.update_membership.js +++ b/packages/google-chat/samples/generated/v1/chat_service.update_membership.js @@ -41,7 +41,7 @@ function main(membership, updateMask) { */ // const updateMask = {} /** - * When `true`, the method runs using the user's Google Workspace + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * The calling user must be a Google Workspace administrator with the * manage chat and spaces conversations diff --git a/packages/google-chat/samples/generated/v1/chat_service.update_message.js b/packages/google-chat/samples/generated/v1/chat_service.update_message.js index 475f3004ac8..2b8f961386a 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.update_message.js +++ b/packages/google-chat/samples/generated/v1/chat_service.update_message.js @@ -20,7 +20,7 @@ 'use strict'; -function main(message) { +function main(message, updateMask) { // [START chat_v1_generated_ChatService_UpdateMessage_async] /** * This snippet has been automatically generated and should be regarded as a code template only. @@ -64,6 +64,7 @@ function main(message) { // Construct request const request = { message, + updateMask, }; // Run request diff --git a/packages/google-chat/samples/generated/v1/chat_service.update_space.js b/packages/google-chat/samples/generated/v1/chat_service.update_space.js index 12a3db8849f..65d5038ded0 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.update_space.js +++ b/packages/google-chat/samples/generated/v1/chat_service.update_space.js @@ -20,7 +20,7 @@ 'use strict'; -function main(space) { +function main(space, updateMask) { // [START chat_v1_generated_ChatService_UpdateSpace_async] /** * This snippet has been automatically generated and should be regarded as a code template only. @@ -91,7 +91,7 @@ function main(space) { */ // const updateMask = {} /** - * When `true`, the method runs using the user's Google Workspace + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * The calling user must be a Google Workspace administrator with the * manage chat and spaces conversations @@ -113,6 +113,7 @@ function main(space) { // Construct request const request = { space, + updateMask, }; // Run request diff --git a/packages/google-chat/samples/generated/v1/snippet_metadata_google.chat.v1.json b/packages/google-chat/samples/generated/v1/snippet_metadata_google.chat.v1.json index 724392e505b..ba57b671bc7 100644 --- a/packages/google-chat/samples/generated/v1/snippet_metadata_google.chat.v1.json +++ b/packages/google-chat/samples/generated/v1/snippet_metadata_google.chat.v1.json @@ -15,14 +15,14 @@ "regionTag": "chat_v1_generated_ChatService_CreateMessage_async", "title": "ChatService createMessage Sample", "origin": "API_DEFINITION", - "description": " Creates a message in a Google Chat space. For an example, see [Send a message](https://developers.google.com/workspace/chat/create-messages). The `create()` method requires either user or app authentication. Chat attributes the message sender differently depending on the type of authentication that you use in your request. The following image shows how Chat attributes a message when you use app authentication. Chat displays the Chat app as the message sender. The content of the message can contain text (`text`), cards (`cardsV2`), and accessory widgets (`accessoryWidgets`). ![Message sent with app authentication](https://developers.google.com/workspace/chat/images/message-app-auth.svg) The following image shows how Chat attributes a message when you use user authentication. Chat displays the user as the message sender and attributes the Chat app to the message by displaying its name. The content of message can only contain text (`text`). ![Message sent with user authentication](https://developers.google.com/workspace/chat/images/message-user-auth.svg) The maximum message size, including the message contents, is 32,000 bytes.", + "description": " Creates a message in a Google Chat space. For an example, see [Send a message](https://developers.google.com/workspace/chat/create-messages). The `create()` method requires either [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) or [app authentication](https://developers.google.com/workspace/chat/authorize-import). Chat attributes the message sender differently depending on the type of authentication that you use in your request. The following image shows how Chat attributes a message when you use app authentication. Chat displays the Chat app as the message sender. The content of the message can contain text (`text`), cards (`cardsV2`), and accessory widgets (`accessoryWidgets`). ![Message sent with app authentication](https://developers.google.com/workspace/chat/images/message-app-auth.svg) The following image shows how Chat attributes a message when you use user authentication. Chat displays the user as the message sender and attributes the Chat app to the message by displaying its name. The content of message can only contain text (`text`). ![Message sent with user authentication](https://developers.google.com/workspace/chat/images/message-user-auth.svg) The maximum message size, including the message contents, is 32,000 bytes. For [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks) requests, the response doesn't contain the full message. The response only populates the `name` and `thread.name` fields in addition to the information that was in the request.", "canonical": true, "file": "chat_service.create_message.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 85, + "end": 90, "type": "FULL" } ], @@ -82,7 +82,7 @@ "segments": [ { "start": 25, - "end": 117, + "end": 116, "type": "FULL" } ], @@ -135,7 +135,7 @@ "regionTag": "chat_v1_generated_ChatService_ListMemberships_async", "title": "ChatService listMemberships Sample", "origin": "API_DEFINITION", - "description": " Lists memberships in a space. For an example, see [List users and Google Chat apps in a space](https://developers.google.com/workspace/chat/list-members). Listing memberships with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) lists memberships in spaces that the authenticated user has access to. Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "description": " Lists memberships in a space. For an example, see [List users and Google Chat apps in a space](https://developers.google.com/workspace/chat/list-members). Listing memberships with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) lists memberships in spaces that the authenticated user has access to. Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) You can authenticate and authorize this method with administrator privileges by setting the `use_admin_access` field in the request.", "canonical": true, "file": "chat_service.list_memberships.js", "language": "JAVASCRIPT", @@ -199,14 +199,14 @@ "regionTag": "chat_v1_generated_ChatService_GetMembership_async", "title": "ChatService getMembership Sample", "origin": "API_DEFINITION", - "description": " Returns details about a membership. For an example, see [Get details about a user's or Google Chat app's membership](https://developers.google.com/workspace/chat/get-members). Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "description": " Returns details about a membership. For an example, see [Get details about a user's or Google Chat app's membership](https://developers.google.com/workspace/chat/get-members). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) You can authenticate and authorize this method with administrator privileges by setting the `use_admin_access` field in the request.", "canonical": true, "file": "chat_service.get_membership.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 74, + "end": 72, "type": "FULL" } ], @@ -243,7 +243,7 @@ "regionTag": "chat_v1_generated_ChatService_GetMessage_async", "title": "ChatService getMessage Sample", "origin": "API_DEFINITION", - "description": " Returns details about a message. For an example, see [Get details about a message](https://developers.google.com/workspace/chat/get-messages). Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). Note: Might return a message from a blocked member or space.", + "description": " Returns details about a message. For an example, see [Get details about a message](https://developers.google.com/workspace/chat/get-messages). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) Note: Might return a message from a blocked member or space.", "canonical": true, "file": "chat_service.get_message.js", "language": "JAVASCRIPT", @@ -283,14 +283,14 @@ "regionTag": "chat_v1_generated_ChatService_UpdateMessage_async", "title": "ChatService updateMessage Sample", "origin": "API_DEFINITION", - "description": " Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/workspace/chat/update-messages). Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). When using app authentication, requests can only update messages created by the calling Chat app.", + "description": " Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/workspace/chat/update-messages). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) When using app authentication, requests can only update messages created by the calling Chat app.", "canonical": true, "file": "chat_service.update_message.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 74, + "end": 75, "type": "FULL" } ], @@ -331,7 +331,7 @@ "regionTag": "chat_v1_generated_ChatService_DeleteMessage_async", "title": "ChatService deleteMessage Sample", "origin": "API_DEFINITION", - "description": " Deletes a message. For an example, see [Delete a message](https://developers.google.com/workspace/chat/delete-messages). Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). When using app authentication, requests can only delete messages created by the calling Chat app.", + "description": " Deletes a message. For an example, see [Delete a message](https://developers.google.com/workspace/chat/delete-messages). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) When using app authentication, requests can only delete messages created by the calling Chat app.", "canonical": true, "file": "chat_service.delete_message.js", "language": "JAVASCRIPT", @@ -459,7 +459,7 @@ "regionTag": "chat_v1_generated_ChatService_ListSpaces_async", "title": "ChatService listSpaces Sample", "origin": "API_DEFINITION", - "description": " Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see [List spaces](https://developers.google.com/workspace/chat/list-spaces). Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent. To list all named spaces by Google Workspace organization, use the [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) method using Workspace administrator privileges instead.", + "description": " Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see [List spaces](https://developers.google.com/workspace/chat/list-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) To list all named spaces by Google Workspace organization, use the [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) method using Workspace administrator privileges instead.", "canonical": true, "file": "chat_service.list_spaces.js", "language": "JAVASCRIPT", @@ -563,7 +563,7 @@ "regionTag": "chat_v1_generated_ChatService_GetSpace_async", "title": "ChatService getSpace Sample", "origin": "API_DEFINITION", - "description": " Returns details about a space. For an example, see [Get details about a space](https://developers.google.com/workspace/chat/get-spaces). Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "description": " Returns details about a space. For an example, see [Get details about a space](https://developers.google.com/workspace/chat/get-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) You can authenticate and authorize this method with administrator privileges by setting the `use_admin_access` field in the request.", "canonical": true, "file": "chat_service.get_space.js", "language": "JAVASCRIPT", @@ -607,14 +607,14 @@ "regionTag": "chat_v1_generated_ChatService_CreateSpace_async", "title": "ChatService createSpace Sample", "origin": "API_DEFINITION", - "description": " Creates a space with no members. Can be used to create a named space. Spaces grouped by topics aren't supported. For an example, see [Create a space](https://developers.google.com/workspace/chat/create-spaces). If you receive the error message `ALREADY_EXISTS` when creating a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. If you're a member of the [Developer Preview program](https://developers.google.com/workspace/preview), you can create a group chat in import mode using `spaceType.GROUP_CHAT`. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "description": " Creates a space with no members. Can be used to create a named space, or a group chat in `Import mode`. For an example, see [Create a space](https://developers.google.com/workspace/chat/create-spaces). If you receive the error message `ALREADY_EXISTS` when creating a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) in [Developer Preview](https://developers.google.com/workspace/preview) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) When authenticating as an app, the `space.customer` field must be set in the request.", "canonical": true, "file": "chat_service.create_space.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 71, + "end": 69, "type": "FULL" } ], @@ -699,14 +699,14 @@ "regionTag": "chat_v1_generated_ChatService_UpdateSpace_async", "title": "ChatService updateSpace Sample", "origin": "API_DEFINITION", - "description": " Updates a space. For an example, see [Update a space](https://developers.google.com/workspace/chat/update-spaces). If you're updating the `displayName` field and receive the error message `ALREADY_EXISTS`, try a different display name.. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "description": " Updates a space. For an example, see [Update a space](https://developers.google.com/workspace/chat/update-spaces). If you're updating the `displayName` field and receive the error message `ALREADY_EXISTS`, try a different display name.. An existing space within the Google Workspace organization might already use this display name. Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) in [Developer Preview](https://developers.google.com/workspace/preview) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) You can authenticate and authorize this method with administrator privileges by setting the `use_admin_access` field in the request.", "canonical": true, "file": "chat_service.update_space.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 123, + "end": 124, "type": "FULL" } ], @@ -747,7 +747,7 @@ "regionTag": "chat_v1_generated_ChatService_DeleteSpace_async", "title": "ChatService deleteSpace Sample", "origin": "API_DEFINITION", - "description": " Deletes a named space. Always performs a cascading delete, which means that the space's child resources\u2014like messages posted in the space and memberships in the space\u2014are also deleted. For an example, see [Delete a space](https://developers.google.com/workspace/chat/delete-spaces). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) from a user who has permission to delete the space.", + "description": " Deletes a named space. Always performs a cascading delete, which means that the space's child resources\u2014like messages posted in the space and memberships in the space\u2014are also deleted. For an example, see [Delete a space](https://developers.google.com/workspace/chat/delete-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) in [Developer Preview](https://developers.google.com/workspace/preview) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) You can authenticate and authorize this method with administrator privileges by setting the `use_admin_access` field in the request.", "canonical": true, "file": "chat_service.delete_space.js", "language": "JAVASCRIPT", @@ -791,7 +791,7 @@ "regionTag": "chat_v1_generated_ChatService_CompleteImportSpace_async", "title": "ChatService completeImportSpace Sample", "origin": "API_DEFINITION", - "description": " Completes the [import process](https://developers.google.com/workspace/chat/import-data) for the specified space and makes it visible to users. Requires app authentication and domain-wide delegation. For more information, see [Authorize Google Chat apps to import data](https://developers.google.com/workspace/chat/authorize-import).", + "description": " Completes the [import process](https://developers.google.com/workspace/chat/import-data) for the specified space and makes it visible to users. Requires [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and domain-wide delegation. For more information, see [Authorize Google Chat apps to import data](https://developers.google.com/workspace/chat/authorize-import).", "canonical": true, "file": "chat_service.complete_import_space.js", "language": "JAVASCRIPT", @@ -831,7 +831,7 @@ "regionTag": "chat_v1_generated_ChatService_FindDirectMessage_async", "title": "ChatService findDirectMessage Sample", "origin": "API_DEFINITION", - "description": " Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), returns the direct message space between the specified user and the authenticated user. With [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), returns the direct message space between the specified user and the calling Chat app. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) or [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).", + "description": " Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), returns the direct message space between the specified user and the calling Chat app. With [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), returns the direct message space between the specified user and the authenticated user. // Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)", "canonical": true, "file": "chat_service.find_direct_message.js", "language": "JAVASCRIPT", @@ -871,14 +871,14 @@ "regionTag": "chat_v1_generated_ChatService_CreateMembership_async", "title": "ChatService createMembership Sample", "origin": "API_DEFINITION", - "description": " Creates a membership for the calling Chat app, a user, or a Google Group. Creating memberships for other Chat apps isn't supported. When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). For example usage, see: - [Invite or add a user to a space](https://developers.google.com/workspace/chat/create-members#create-user-membership). - [Invite or add a Google Group to a space](https://developers.google.com/workspace/chat/create-members#create-group-membership). - [Add the Chat app to a space](https://developers.google.com/workspace/chat/create-members#create-membership-calling-api).", + "description": " Creates a membership for the calling Chat app, a user, or a Google Group. Creating memberships for other Chat apps isn't supported. When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) in [Developer Preview](https://developers.google.com/workspace/preview) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) You can authenticate and authorize this method with administrator privileges by setting the `use_admin_access` field in the request. For example usage, see: - [Invite or add a user to a space](https://developers.google.com/workspace/chat/create-members#create-user-membership). - [Invite or add a Google Group to a space](https://developers.google.com/workspace/chat/create-members#create-group-membership). - [Add the Chat app to a space](https://developers.google.com/workspace/chat/create-members#create-membership-calling-api).", "canonical": true, "file": "chat_service.create_membership.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 88, + "end": 102, "type": "FULL" } ], @@ -919,7 +919,7 @@ "regionTag": "chat_v1_generated_ChatService_UpdateMembership_async", "title": "ChatService updateMembership Sample", "origin": "API_DEFINITION", - "description": " Updates a membership. For an example, see [Update a user's membership in a space](https://developers.google.com/workspace/chat/update-members). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "description": " Updates a membership. For an example, see [Update a user's membership in a space](https://developers.google.com/workspace/chat/update-members). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) in [Developer Preview](https://developers.google.com/workspace/preview) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) You can authenticate and authorize this method with administrator privileges by setting the `use_admin_access` field in the request.", "canonical": true, "file": "chat_service.update_membership.js", "language": "JAVASCRIPT", @@ -967,7 +967,7 @@ "regionTag": "chat_v1_generated_ChatService_DeleteMembership_async", "title": "ChatService deleteMembership Sample", "origin": "API_DEFINITION", - "description": " Deletes a membership. For an example, see [Remove a user or a Google Chat app from a space](https://developers.google.com/workspace/chat/delete-members). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "description": " Deletes a membership. For an example, see [Remove a user or a Google Chat app from a space](https://developers.google.com/workspace/chat/delete-members). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) in [Developer Preview](https://developers.google.com/workspace/preview) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) You can authenticate and authorize this method with administrator privileges by setting the `use_admin_access` field in the request.", "canonical": true, "file": "chat_service.delete_membership.js", "language": "JAVASCRIPT", diff --git a/packages/google-chat/src/v1/chat_service_client.ts b/packages/google-chat/src/v1/chat_service_client.ts index 4264653e4f6..78fbcbba8a3 100644 --- a/packages/google-chat/src/v1/chat_service_client.ts +++ b/packages/google-chat/src/v1/chat_service_client.ts @@ -486,8 +486,11 @@ export class ChatServiceClient { * Creates a message in a Google Chat space. For an example, see [Send a * message](https://developers.google.com/workspace/chat/create-messages). * - * The `create()` method requires either user or app authentication. Chat - * attributes the message sender differently depending on the type of + * The `create()` method requires either [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * or [app + * authentication](https://developers.google.com/workspace/chat/authorize-import). + * Chat attributes the message sender differently depending on the type of * authentication that you use in your request. * * The following image shows how Chat attributes a message when you use app @@ -508,6 +511,12 @@ export class ChatServiceClient { * * The maximum message size, including the message contents, is 32,000 bytes. * + * For + * [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks) + * requests, the response doesn't contain the full message. The response only + * populates the `name` and `thread.name` fields in addition to the + * information that was in the request. + * * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -531,6 +540,12 @@ export class ChatServiceClient { * @param {google.chat.v1.CreateMessageRequest.MessageReplyOption} [request.messageReplyOption] * Optional. Specifies whether a message starts a thread or replies to one. * Only supported in named spaces. + * + * When [responding to user + * interactions](https://developers.google.com/workspace/chat/receive-respond-interactions), + * this field is ignored. For interactions within a thread, the reply is + * created in the same thread. Otherwise, the reply is created as a new + * thread. * @param {string} [request.messageId] * Optional. A custom ID for a message. Lets Chat apps get, update, or delete * a message without needing to store the system-assigned ID in the message's @@ -627,13 +642,16 @@ export class ChatServiceClient { * [Get details about a user's or Google Chat app's * membership](https://developers.google.com/workspace/chat/get-members). * - * Requires - * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - * Supports - * [app + * Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + * + * - [App * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - * and [user - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * - [User + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * You can authenticate and authorize this method with administrator + * privileges by setting the `use_admin_access` field in the request. * * @param {Object} request * The request object that will be sent. @@ -646,13 +664,11 @@ export class ChatServiceClient { * * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` * - * When [authenticated as a - * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), - * you can use the user's email as an alias for `{member}`. For example, + * You can use the user's email as an alias for `{member}`. For example, * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the * email of the Google Chat user. - * @param {boolean} request.useAdminAccess - * When `true`, the method runs using the user's Google Workspace + * @param {boolean} [request.useAdminAccess] + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * * The calling user must be a Google Workspace administrator with the @@ -744,13 +760,14 @@ export class ChatServiceClient { * For an example, see [Get details about a * message](https://developers.google.com/workspace/chat/get-messages). * - * Requires - * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - * Supports - * [app + * Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + * + * - [App * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - * and [user - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * - [User + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) * * Note: Might return a message from a blocked member or space. * @@ -848,13 +865,15 @@ export class ChatServiceClient { * [Update a * message](https://developers.google.com/workspace/chat/update-messages). * - * Requires - * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - * Supports - * [app + * Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + * + * - [App * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - * and [user - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * - [User + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * * When using app authentication, requests can only update messages * created by the calling Chat app. * @@ -965,13 +984,15 @@ export class ChatServiceClient { * For an example, see [Delete a * message](https://developers.google.com/workspace/chat/delete-messages). * - * Requires - * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - * Supports - * [app + * Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + * + * - [App * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - * and [user - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * - [User + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * * When using app authentication, requests can only delete messages * created by the calling Chat app. * @@ -986,9 +1007,9 @@ export class ChatServiceClient { * `clientAssignedMessageId` field for `{message}`. For details, see [Name a * message] * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). - * @param {boolean} request.force - * When `true`, deleting a message also deletes its threaded replies. When - * `false`, if a message has threaded replies, deletion fails. + * @param {boolean} [request.force] + * Optional. When `true`, deleting a message also deletes its threaded + * replies. When `false`, if a message has threaded replies, deletion fails. * * Only applies when [authenticating as a * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). @@ -1163,6 +1184,7 @@ export class ChatServiceClient { * Uploads an attachment. For an example, see * [Upload media as a file * attachment](https://developers.google.com/workspace/chat/upload-media-attachments). + * * Requires user * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * @@ -1257,13 +1279,16 @@ export class ChatServiceClient { * [Get details about a * space](https://developers.google.com/workspace/chat/get-spaces). * - * Requires - * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - * Supports - * [app + * Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + * + * - [App * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - * and [user - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * - [User + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * You can authenticate and authorize this method with administrator + * privileges by setting the `use_admin_access` field in the request. * * @param {Object} request * The request object that will be sent. @@ -1271,8 +1296,8 @@ export class ChatServiceClient { * Required. Resource name of the space, in the form `spaces/{space}`. * * Format: `spaces/{space}` - * @param {boolean} request.useAdminAccess - * When `true`, the method runs using the user's Google Workspace + * @param {boolean} [request.useAdminAccess] + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * * The calling user must be a Google Workspace administrator with the @@ -1357,35 +1382,39 @@ export class ChatServiceClient { return this.innerApiCalls.getSpace(request, options, callback); } /** - * Creates a space with no members. Can be used to create a named space. - * Spaces grouped by topics aren't supported. For an example, see - * [Create a + * Creates a space with no members. Can be used to create a named space, or a + * group chat in `Import mode`. For an example, see [Create a * space](https://developers.google.com/workspace/chat/create-spaces). * * If you receive the error message `ALREADY_EXISTS` when creating * a space, try a different `displayName`. An existing space within * the Google Workspace organization might already use this display name. * - * If you're a member of the [Developer Preview - * program](https://developers.google.com/workspace/preview), you can create a - * group chat in import mode using `spaceType.GROUP_CHAT`. + * Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): * - * Requires [user - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * - [App + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * with [administrator approval](https://support.google.com/a?p=chat-app-auth) + * in [Developer Preview](https://developers.google.com/workspace/preview) + * + * - [User + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * + * When authenticating as an app, the `space.customer` field must be set in + * the request. * * @param {Object} request * The request object that will be sent. * @param {google.chat.v1.Space} request.space * Required. The `displayName` and `spaceType` fields must be populated. Only - * `SpaceType.SPACE` is supported. + * `SpaceType.SPACE` and `SpaceType.GROUP_CHAT` are supported. + * `SpaceType.GROUP_CHAT` can only be used if `importMode` is set to true. * * If you receive the error message `ALREADY_EXISTS`, * try a different `displayName`. An existing space within the Google * Workspace organization might already use this display name. * - * If you're a member of the [Developer Preview - * program](https://developers.google.com/workspace/preview), - * `SpaceType.GROUP_CHAT` can be used if `importMode` is set to true. * * The space `name` is assigned on the server so anything specified in this * field will be ignored. @@ -1664,8 +1693,18 @@ export class ChatServiceClient { * `ALREADY_EXISTS`, try a different display name.. An existing space within * the Google Workspace organization might already use this display name. * - * Requires [user - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + * + * - [App + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * with [administrator approval](https://support.google.com/a?p=chat-app-auth) + * in [Developer Preview](https://developers.google.com/workspace/preview) + * + * - [User + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * You can authenticate and authorize this method with administrator + * privileges by setting the `use_admin_access` field in the request. * * @param {Object} request * The request object that will be sent. @@ -1735,8 +1774,8 @@ export class ChatServiceClient { * - `permission_settings.manageApps` * - `permission_settings.manageWebhooks` * - `permission_settings.replyMessages` - * @param {boolean} request.useAdminAccess - * When `true`, the method runs using the user's Google Workspace + * @param {boolean} [request.useAdminAccess] + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * * The calling user must be a Google Workspace administrator with the @@ -1829,9 +1868,19 @@ export class ChatServiceClient { * memberships in the space—are also deleted. For an example, see * [Delete a * space](https://developers.google.com/workspace/chat/delete-spaces). - * Requires [user + * + * Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + * + * - [App + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * with [administrator approval](https://support.google.com/a?p=chat-app-auth) + * in [Developer Preview](https://developers.google.com/workspace/preview) + * + * - [User * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - * from a user who has permission to delete the space. + * You can authenticate and authorize this method with administrator + * privileges by setting the `use_admin_access` field in the request. * * @param {Object} request * The request object that will be sent. @@ -1839,8 +1888,8 @@ export class ChatServiceClient { * Required. Resource name of the space to delete. * * Format: `spaces/{space}` - * @param {boolean} request.useAdminAccess - * When `true`, the method runs using the user's Google Workspace + * @param {boolean} [request.useAdminAccess] + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * * The calling user must be a Google Workspace administrator with the @@ -1928,8 +1977,11 @@ export class ChatServiceClient { * Completes the * [import process](https://developers.google.com/workspace/chat/import-data) * for the specified space and makes it visible to users. - * Requires app authentication and domain-wide delegation. For more - * information, see [Authorize Google Chat apps to import + * + * Requires [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * and domain-wide delegation. For more information, see [Authorize Google + * Chat apps to import * data](https://developers.google.com/workspace/chat/authorize-import). * * @param {Object} request @@ -2019,20 +2071,24 @@ export class ChatServiceClient { * see * [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). * + * With [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), + * returns the direct message space between the specified user and the calling + * Chat app. + * * With [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), * returns the direct message space between the specified user and the * authenticated user. * - * With [app - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), - * returns the direct message space between the specified user and the calling - * Chat app. + * // Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): * - * Requires [user + * - [App + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * + * - [User * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - * or [app - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * @param {Object} request * The request object that will be sent. @@ -2128,8 +2184,19 @@ export class ChatServiceClient { * policy turned off, then they're invited, and must accept the space * invitation before joining. Otherwise, creating a membership adds the member * directly to the specified space. - * Requires [user - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + * + * - [App + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * with [administrator approval](https://support.google.com/a?p=chat-app-auth) + * in [Developer Preview](https://developers.google.com/workspace/preview) + * + * - [User + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * You can authenticate and authorize this method with administrator + * privileges by setting the `use_admin_access` field in the request. * * For example usage, see: * @@ -2151,23 +2218,44 @@ export class ChatServiceClient { * Format: spaces/{space} * @param {google.chat.v1.Membership} request.membership * Required. The membership relation to create. + * * The `memberType` field must contain a user with the `user.name` and * `user.type` fields populated. The server will assign a resource name * and overwrite anything specified. + * * When a Chat app creates a membership relation for a human user, it must use - * the `chat.memberships` scope, set `user.type` to `HUMAN`, and set - * `user.name` with format `users/{user}`, where `{user}` can be the email - * address for the user. For users in the same Workspace organization `{user}` - * can also be the `id` of the - * [person](https://developers.google.com/people/api/rest/v1/people) from the - * People API, or the `id` for the user in the Directory API. For example, if - * the People API Person profile ID for `user@example.com` is `123456789`, you - * can add the user to the space by setting the `membership.member.name` to - * `users/user@example.com` or `users/123456789`. When a Chat app creates a - * membership relation for itself, it must use the `chat.memberships.app` - * scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. - * @param {boolean} request.useAdminAccess - * When `true`, the method runs using the user's Google Workspace + * certain authorization scopes and set specific values for certain fields: + * + * - When [authenticating as a + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the `chat.memberships` authorization scope is required. + * + * - When [authenticating as an + * app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), + * the `chat.app.memberships` authorization scope is required. + * Authenticating as an app is available in [Developer + * Preview](https://developers.google.com/workspace/preview). + * + * - Set `user.type` to `HUMAN`, and set `user.name` with format + * `users/{user}`, where `{user}` can be the email address for the user. For + * users in the same Workspace organization `{user}` can also be the `id` of + * the [person](https://developers.google.com/people/api/rest/v1/people) from + * the People API, or the `id` for the user in the Directory API. For example, + * if the People API Person profile ID for `user@example.com` is `123456789`, + * you can add the user to the space by setting the `membership.member.name` + * to `users/user@example.com` or `users/123456789`. + * + * Inviting users external to the Workspace organization that owns the space + * requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * When a Chat app creates a membership relation for itself, it must + * [authenticate as a + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * and use the `chat.memberships.app` scope, set `user.type` to `BOT`, and set + * `user.name` to `users/app`. + * @param {boolean} [request.useAdminAccess] + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * * The calling user must be a Google Workspace administrator with the @@ -2259,8 +2347,18 @@ export class ChatServiceClient { * Updates a membership. For an example, see [Update a user's membership in * a space](https://developers.google.com/workspace/chat/update-members). * - * Requires [user - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + * + * - [App + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * with [administrator approval](https://support.google.com/a?p=chat-app-auth) + * in [Developer Preview](https://developers.google.com/workspace/preview) + * + * - [User + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * You can authenticate and authorize this method with administrator + * privileges by setting the `use_admin_access` field in the request. * * @param {Object} request * The request object that will be sent. @@ -2274,8 +2372,8 @@ export class ChatServiceClient { * Currently supported field paths: * * - `role` - * @param {boolean} request.useAdminAccess - * When `true`, the method runs using the user's Google Workspace + * @param {boolean} [request.useAdminAccess] + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * * The calling user must be a Google Workspace administrator with the @@ -2364,8 +2462,18 @@ export class ChatServiceClient { * [Remove a user or a Google Chat app from a * space](https://developers.google.com/workspace/chat/delete-members). * - * Requires [user - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + * + * - [App + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * with [administrator approval](https://support.google.com/a?p=chat-app-auth) + * in [Developer Preview](https://developers.google.com/workspace/preview) + * + * - [User + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * You can authenticate and authorize this method with administrator + * privileges by setting the `use_admin_access` field in the request. * * @param {Object} request * The request object that will be sent. @@ -2384,8 +2492,8 @@ export class ChatServiceClient { * and `spaces/{space}/members/app` format. * * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. - * @param {boolean} request.useAdminAccess - * When `true`, the method runs using the user's Google Workspace + * @param {boolean} [request.useAdminAccess] + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * * The calling user must be a Google Workspace administrator with the @@ -2476,6 +2584,7 @@ export class ChatServiceClient { * supported. For an example, see * [Add a reaction to a * message](https://developers.google.com/workspace/chat/create-reactions). + * * Requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * @@ -2567,6 +2676,7 @@ export class ChatServiceClient { * For an example, see * [Delete a * reaction](https://developers.google.com/workspace/chat/delete-reactions). + * * Requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * @@ -3080,6 +3190,7 @@ export class ChatServiceClient { * For an example, see * [List * messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list). + * * Requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * @@ -3089,9 +3200,9 @@ export class ChatServiceClient { * Required. The resource name of the space to list messages from. * * Format: `spaces/{space}` - * @param {number} request.pageSize - * The maximum number of messages returned. The service might return fewer - * messages than this value. + * @param {number} [request.pageSize] + * Optional. The maximum number of messages returned. The service might return + * fewer messages than this value. * * If unspecified, at most 25 are returned. * @@ -3099,17 +3210,15 @@ export class ChatServiceClient { * automatically changed to 1000. * * Negative values return an `INVALID_ARGUMENT` error. - * @param {string} request.pageToken - * Optional, if resuming from a previous query. - * - * A page token received from a previous list messages call. Provide this - * parameter to retrieve the subsequent page. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous list messages call. Provide + * this parameter to retrieve the subsequent page. * * When paginating, all other parameters provided should match the call that * provided the page token. Passing different values to the other parameters * might lead to unexpected results. - * @param {string} request.filter - * A query filter. + * @param {string} [request.filter] + * Optional. A query filter. * * You can filter messages by date (`create_time`) and thread (`thread.name`). * @@ -3146,20 +3255,19 @@ export class ChatServiceClient { * * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` * error. - * @param {string} request.orderBy - * Optional, if resuming from a previous query. - * - * How the list of messages is ordered. Specify a value to order by an - * ordering operation. Valid ordering operation values are as follows: + * @param {string} [request.orderBy] + * Optional. How the list of messages is ordered. Specify a value to order by + * an ordering operation. Valid ordering operation values are as follows: * * - `ASC` for ascending. * * - `DESC` for descending. * * The default ordering is `create_time ASC`. - * @param {boolean} request.showDeleted - * Whether to include deleted messages. Deleted messages include deleted time - * and metadata about their deletion, but message content is unavailable. + * @param {boolean} [request.showDeleted] + * Optional. Whether to include deleted messages. Deleted messages include + * deleted time and metadata about their deletion, but message content is + * unavailable. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3247,9 +3355,9 @@ export class ChatServiceClient { * Required. The resource name of the space to list messages from. * * Format: `spaces/{space}` - * @param {number} request.pageSize - * The maximum number of messages returned. The service might return fewer - * messages than this value. + * @param {number} [request.pageSize] + * Optional. The maximum number of messages returned. The service might return + * fewer messages than this value. * * If unspecified, at most 25 are returned. * @@ -3257,17 +3365,15 @@ export class ChatServiceClient { * automatically changed to 1000. * * Negative values return an `INVALID_ARGUMENT` error. - * @param {string} request.pageToken - * Optional, if resuming from a previous query. - * - * A page token received from a previous list messages call. Provide this - * parameter to retrieve the subsequent page. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous list messages call. Provide + * this parameter to retrieve the subsequent page. * * When paginating, all other parameters provided should match the call that * provided the page token. Passing different values to the other parameters * might lead to unexpected results. - * @param {string} request.filter - * A query filter. + * @param {string} [request.filter] + * Optional. A query filter. * * You can filter messages by date (`create_time`) and thread (`thread.name`). * @@ -3304,20 +3410,19 @@ export class ChatServiceClient { * * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` * error. - * @param {string} request.orderBy - * Optional, if resuming from a previous query. - * - * How the list of messages is ordered. Specify a value to order by an - * ordering operation. Valid ordering operation values are as follows: + * @param {string} [request.orderBy] + * Optional. How the list of messages is ordered. Specify a value to order by + * an ordering operation. Valid ordering operation values are as follows: * * - `ASC` for ascending. * * - `DESC` for descending. * * The default ordering is `create_time ASC`. - * @param {boolean} request.showDeleted - * Whether to include deleted messages. Deleted messages include deleted time - * and metadata about their deletion, but message content is unavailable. + * @param {boolean} [request.showDeleted] + * Optional. Whether to include deleted messages. Deleted messages include + * deleted time and metadata about their deletion, but message content is + * unavailable. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -3361,9 +3466,9 @@ export class ChatServiceClient { * Required. The resource name of the space to list messages from. * * Format: `spaces/{space}` - * @param {number} request.pageSize - * The maximum number of messages returned. The service might return fewer - * messages than this value. + * @param {number} [request.pageSize] + * Optional. The maximum number of messages returned. The service might return + * fewer messages than this value. * * If unspecified, at most 25 are returned. * @@ -3371,17 +3476,15 @@ export class ChatServiceClient { * automatically changed to 1000. * * Negative values return an `INVALID_ARGUMENT` error. - * @param {string} request.pageToken - * Optional, if resuming from a previous query. - * - * A page token received from a previous list messages call. Provide this - * parameter to retrieve the subsequent page. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous list messages call. Provide + * this parameter to retrieve the subsequent page. * * When paginating, all other parameters provided should match the call that * provided the page token. Passing different values to the other parameters * might lead to unexpected results. - * @param {string} request.filter - * A query filter. + * @param {string} [request.filter] + * Optional. A query filter. * * You can filter messages by date (`create_time`) and thread (`thread.name`). * @@ -3418,20 +3521,19 @@ export class ChatServiceClient { * * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` * error. - * @param {string} request.orderBy - * Optional, if resuming from a previous query. - * - * How the list of messages is ordered. Specify a value to order by an - * ordering operation. Valid ordering operation values are as follows: + * @param {string} [request.orderBy] + * Optional. How the list of messages is ordered. Specify a value to order by + * an ordering operation. Valid ordering operation values are as follows: * * - `ASC` for ascending. * * - `DESC` for descending. * * The default ordering is `create_time ASC`. - * @param {boolean} request.showDeleted - * Whether to include deleted messages. Deleted messages include deleted time - * and metadata about their deletion, but message content is unavailable. + * @param {boolean} [request.showDeleted] + * Optional. Whether to include deleted messages. Deleted messages include + * deleted time and metadata about their deletion, but message content is + * unavailable. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -3478,13 +3580,16 @@ export class ChatServiceClient { * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) * lists memberships in spaces that the authenticated user has access to. * - * Requires - * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - * Supports - * [app + * Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + * + * - [App * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - * and [user - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * - [User + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * You can authenticate and authorize this method with administrator + * privileges by setting the `use_admin_access` field in the request. * * @param {Object} request * The request object that will be sent. @@ -3565,8 +3670,8 @@ export class ChatServiceClient { * * Currently requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). - * @param {boolean} request.useAdminAccess - * When `true`, the method runs using the user's Google Workspace + * @param {boolean} [request.useAdminAccess] + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * * The calling user must be a Google Workspace administrator with the @@ -3738,8 +3843,8 @@ export class ChatServiceClient { * * Currently requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). - * @param {boolean} request.useAdminAccess - * When `true`, the method runs using the user's Google Workspace + * @param {boolean} [request.useAdminAccess] + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * * The calling user must be a Google Workspace administrator with the @@ -3867,8 +3972,8 @@ export class ChatServiceClient { * * Currently requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). - * @param {boolean} request.useAdminAccess - * When `true`, the method runs using the user's Google Workspace + * @param {boolean} [request.useAdminAccess] + * Optional. When `true`, the method runs using the user's Google Workspace * administrator privileges. * * The calling user must be a Google Workspace administrator with the @@ -3919,16 +4024,14 @@ export class ChatServiceClient { * [List * spaces](https://developers.google.com/workspace/chat/list-spaces). * - * Requires - * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). - * Supports - * [app + * Supports the following types of + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + * + * - [App * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - * and [user - * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * - * Lists spaces visible to the caller or authenticated user. Group chats - * and DMs aren't listed until the first message is sent. + * - [User + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) * * To list all named spaces by Google Workspace organization, use the * [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) @@ -4189,7 +4292,9 @@ export class ChatServiceClient { } /** * Returns a list of spaces in a Google Workspace organization based on an - * administrator's search. Requires [user + * administrator's search. + * + * Requires [user * authentication with administrator * privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges). * In the request, set `use_admin_access` to `true`. @@ -4712,6 +4817,7 @@ export class ChatServiceClient { * Lists reactions to a message. For an example, see * [List reactions for a * message](https://developers.google.com/workspace/chat/list-reactions). + * * Requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * @@ -5079,14 +5185,14 @@ export class ChatServiceClient { * where the events occurred. * * Format: `spaces/{space}`. - * @param {number} request.pageSize + * @param {number} [request.pageSize] * Optional. The maximum number of space events returned. The service might * return fewer than this value. * * Negative values return an `INVALID_ARGUMENT` error. - * @param {string} request.pageToken - * A page token, received from a previous list space events call. Provide this - * to retrieve the subsequent page. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous list space events call. + * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to list space events must * match the call that provided the page token. Passing different values to @@ -5233,14 +5339,14 @@ export class ChatServiceClient { * where the events occurred. * * Format: `spaces/{space}`. - * @param {number} request.pageSize + * @param {number} [request.pageSize] * Optional. The maximum number of space events returned. The service might * return fewer than this value. * * Negative values return an `INVALID_ARGUMENT` error. - * @param {string} request.pageToken - * A page token, received from a previous list space events call. Provide this - * to retrieve the subsequent page. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous list space events call. + * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to list space events must * match the call that provided the page token. Passing different values to @@ -5343,14 +5449,14 @@ export class ChatServiceClient { * where the events occurred. * * Format: `spaces/{space}`. - * @param {number} request.pageSize + * @param {number} [request.pageSize] * Optional. The maximum number of space events returned. The service might * return fewer than this value. * * Negative values return an `INVALID_ARGUMENT` error. - * @param {string} request.pageToken - * A page token, received from a previous list space events call. Provide this - * to retrieve the subsequent page. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous list space events call. + * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to list space events must * match the call that provided the page token. Passing different values to