@google-apps/chat 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.10.0](https://github.com/googleapis/google-cloud-node/compare/chat-v0.9.0...chat-v0.10.0) (2024-10-10)
4
+
5
+
6
+ ### Features
7
+
8
+ * [chat] Add doc for permission settings & announcement space support ([#5731](https://github.com/googleapis/google-cloud-node/issues/5731)) ([d5a4a46](https://github.com/googleapis/google-cloud-node/commit/d5a4a469cfc03b75356e33e9659aa720ff6ee71d))
9
+
10
+ ## [0.9.0](https://github.com/googleapis/google-cloud-node/compare/chat-v0.8.0...chat-v0.9.0) (2024-09-13)
11
+
12
+
13
+ ### Features
14
+
15
+ * [chat] If you're a domain administrator or a delegated administrator, you can now include the `useAdminAccess` parameter when you call the Chat API with your administrator privileges with the following methods to manage Chat spaces and membership... ([#5675](https://github.com/googleapis/google-cloud-node/issues/5675)) ([4f0945e](https://github.com/googleapis/google-cloud-node/commit/4f0945ef49b10c71039eafc00ac7e93dd6a3ddee))
16
+
3
17
  ## [0.8.0](https://github.com/googleapis/google-cloud-node/compare/chat-v0.7.0...chat-v0.8.0) (2024-09-10)
4
18
 
5
19
 
package/README.md CHANGED
@@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
44
44
  1. [Select or create a Cloud Platform project][projects].
45
45
  1. [Enable billing for your project][billing].
46
46
  1. [Enable the Google Chat API API][enable_api].
47
- 1. [Set up authentication with a service account][auth] so you can access the
47
+ 1. [Set up authentication][auth] so you can access the
48
48
  API from your local workstation.
49
49
 
50
50
  ### Installing the client library
@@ -148,6 +148,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
148
148
  | Chat_service.list_reactions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_reactions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.list_reactions.js,packages/google-chat/samples/README.md) |
149
149
  | Chat_service.list_space_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_space_events.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.list_space_events.js,packages/google-chat/samples/README.md) |
150
150
  | Chat_service.list_spaces | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_spaces.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.list_spaces.js,packages/google-chat/samples/README.md) |
151
+ | Chat_service.search_spaces | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.search_spaces.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.search_spaces.js,packages/google-chat/samples/README.md) |
151
152
  | Chat_service.set_up_space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.set_up_space.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.set_up_space.js,packages/google-chat/samples/README.md) |
152
153
  | Chat_service.update_membership | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_membership.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_membership.js,packages/google-chat/samples/README.md) |
153
154
  | Chat_service.update_message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_message.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_message.js,packages/google-chat/samples/README.md) |
@@ -223,4 +224,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE)
223
224
  [projects]: https://console.cloud.google.com/project
224
225
  [billing]: https://support.google.com/cloud/answer/6293499#enable-billing
225
226
  [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=chat.googleapis.com
226
- [auth]: https://cloud.google.com/docs/authentication/getting-started
227
+ [auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local
@@ -66,18 +66,30 @@ service ChatService {
66
66
  "https://www.googleapis.com/auth/chat.users.readstate,"
67
67
  "https://www.googleapis.com/auth/chat.users.readstate.readonly";
68
68
 
69
- // Creates a message in a Google Chat space. The maximum message size,
70
- // including text and cards, is 32,000 bytes. For an example, see [Send a
69
+ // Creates a message in a Google Chat space. For an example, see [Send a
71
70
  // message](https://developers.google.com/workspace/chat/create-messages).
72
71
  //
73
- // Calling this method requires
74
- // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize)
75
- // and supports the following authentication types:
72
+ // The `create()` method requires either user or app authentication. Chat
73
+ // attributes the message sender differently depending on the type of
74
+ // authentication that you use in your request.
76
75
  //
77
- // - For text messages, user authentication or app authentication are
78
- // supported.
79
- // - For card messages, only app authentication is supported. (Only Chat apps
80
- // can create card messages.)
76
+ // The following image shows how Chat attributes a message when you use app
77
+ // authentication. Chat displays the Chat app as the message
78
+ // sender. The content of the message can contain text (`text`), cards
79
+ // (`cardsV2`), and accessory widgets (`accessoryWidgets`).
80
+ //
81
+ // ![Message sent with app
82
+ // authentication](https://developers.google.com/workspace/chat/images/message-app-auth.svg)
83
+ //
84
+ // The following image shows how Chat attributes a message when you use user
85
+ // authentication. Chat displays the user as the message sender and attributes
86
+ // the Chat app to the message by displaying its name. The content of message
87
+ // can only contain text (`text`).
88
+ //
89
+ // ![Message sent with user
90
+ // authentication](https://developers.google.com/workspace/chat/images/message-user-auth.svg)
91
+ //
92
+ // The maximum message size, including the message contents, is 32,000 bytes.
81
93
  rpc CreateMessage(CreateMessageRequest) returns (Message) {
82
94
  option (google.api.http) = {
83
95
  post: "/v1/{parent=spaces/*}/messages"
@@ -87,8 +99,12 @@ service ChatService {
87
99
  }
88
100
 
89
101
  // Lists messages in a space that the caller is a member of, including
90
- // messages from blocked members and spaces. For an example, see
91
- // [List messages](/chat/api/guides/v1/messages/list).
102
+ // messages from blocked members and spaces. If you list messages from a
103
+ // space with no messages, the response is an empty object. When using a
104
+ // REST/HTTP interface, the response contains an empty JSON object, `{}`.
105
+ // For an example, see
106
+ // [List
107
+ // messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list).
92
108
  // Requires [user
93
109
  // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
94
110
  rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse) {
@@ -269,6 +285,18 @@ service ChatService {
269
285
  option (google.api.method_signature) = "";
270
286
  }
271
287
 
288
+ // Returns a list of spaces in a Google Workspace organization based on an
289
+ // administrator's search. Requires [user
290
+ // authentication with administrator
291
+ // privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges).
292
+ // In the request, set `use_admin_access` to `true`.
293
+ rpc SearchSpaces(SearchSpacesRequest) returns (SearchSpacesResponse) {
294
+ option (google.api.http) = {
295
+ get: "/v1/spaces:search"
296
+ };
297
+ option (google.api.method_signature) = "";
298
+ }
299
+
272
300
  // Returns details about a space. For an example, see
273
301
  // [Get details about a
274
302
  // space](https://developers.google.com/workspace/chat/get-spaces).
@@ -287,14 +315,19 @@ service ChatService {
287
315
  option (google.api.method_signature) = "name";
288
316
  }
289
317
 
290
- // Creates a named space. Spaces grouped by topics aren't supported. For an
291
- // example, see [Create a
318
+ // Creates a space with no members. Can be used to create a named space.
319
+ // Spaces grouped by topics aren't supported. For an example, see
320
+ // [Create a
292
321
  // space](https://developers.google.com/workspace/chat/create-spaces).
293
322
  //
294
323
  // If you receive the error message `ALREADY_EXISTS` when creating
295
324
  // a space, try a different `displayName`. An existing space within
296
325
  // the Google Workspace organization might already use this display name.
297
326
  //
327
+ // If you're a member of the [Developer Preview
328
+ // program](https://developers.google.com/workspace/preview), you can create a
329
+ // group chat in import mode using `spaceType.GROUP_CHAT`.
330
+ //
298
331
  // Requires [user
299
332
  // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
300
333
  rpc CreateSpace(CreateSpaceRequest) returns (Space) {
@@ -436,40 +469,25 @@ service ChatService {
436
469
  };
437
470
  }
438
471
 
439
- // Creates a human membership or app membership for the calling app. Creating
440
- // memberships for other apps isn't supported. For an example, see
441
- // [Invite or add a user or a Google Chat app to a
442
- // space](https://developers.google.com/workspace/chat/create-members).
472
+ // Creates a membership for the calling Chat app, a user, or a Google Group.
473
+ // Creating memberships for other Chat apps isn't supported.
443
474
  // When creating a membership, if the specified member has their auto-accept
444
475
  // policy turned off, then they're invited, and must accept the space
445
476
  // invitation before joining. Otherwise, creating a membership adds the member
446
- // directly to the specified space. Requires [user
477
+ // directly to the specified space.
478
+ // Requires [user
447
479
  // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
448
480
  //
449
- // To specify the member to add, set the `membership.member.name` for the
450
- // human or app member, or set the `membership.group_member.name` for the
451
- // group member.
452
- //
453
- // - To add the calling app to a space or a direct message between two human
454
- // users, use `users/app`. Unable to add other
455
- // apps to the space.
456
- //
457
- // - To add a human user, use `users/{user}`, where `{user}` can be the email
458
- // address for the user. For users in the same Workspace organization `{user}`
459
- // can also be the `id` for the person from the People API, or the `id` for
460
- // the user in the Directory API. For example, if the People API Person
461
- // profile ID for `user@example.com` is `123456789`, you can add the user to
462
- // the space by setting the `membership.member.name` to
463
- // `users/user@example.com` or `users/123456789`.
464
- //
465
- // - To add or invite a Google group in a named space, use
466
- // `groups/{group}`, where `{group}` is the `id` for the group from the Cloud
467
- // Identity Groups API. For example, you can use [Cloud Identity Groups lookup
468
- // API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup)
469
- // to retrieve the ID `123456789` for group email `group@example.com`, then
470
- // you can add or invite the group to a named space by setting the
471
- // `membership.group_member.name` to `groups/123456789`. Group email is not
472
- // supported, and Google groups can only be added as members in named spaces.
481
+ // For example usage, see:
482
+ //
483
+ // - [Invite or add a user to a
484
+ // space](https://developers.google.com/workspace/chat/create-members#create-user-membership).
485
+ //
486
+ // - [Invite or add a Google Group to a
487
+ // space](https://developers.google.com/workspace/chat/create-members#create-group-membership).
488
+ //
489
+ // - [Add the Chat app to a
490
+ // space](https://developers.google.com/workspace/chat/create-members#create-membership-calling-api).
473
491
  rpc CreateMembership(CreateMembershipRequest) returns (Membership) {
474
492
  option (google.api.http) = {
475
493
  post: "/v1/{parent=spaces/*}/members"
@@ -593,6 +611,9 @@ service ChatService {
593
611
  // updated, the server returns the updated `Message` resource in the event
594
612
  // payload.
595
613
  //
614
+ // Note: The `permissionSettings` field is not returned in the Space
615
+ // object of the Space event data for this request.
616
+ //
596
617
  // Requires [user
597
618
  // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
598
619
  // To get an event, the authenticated user must be a member of the space.
@@ -156,6 +156,21 @@ message CreateMembershipRequest {
156
156
  // membership relation for itself, it must use the `chat.memberships.app`
157
157
  // scope, set `user.type` to `BOT`, and set `user.name` to `users/app`.
158
158
  Membership membership = 2 [(google.api.field_behavior) = REQUIRED];
159
+
160
+ // When `true`, the method runs using the user's Google Workspace
161
+ // administrator privileges.
162
+ //
163
+ // The calling user must be a Google Workspace administrator with the
164
+ // [manage chat and spaces conversations
165
+ // privilege](https://support.google.com/a/answer/13369245).
166
+ //
167
+ // Requires the `chat.admin.memberships` [OAuth 2.0
168
+ // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
169
+ //
170
+ // Creating app memberships or creating memberships for users outside the
171
+ // administrator's Google Workspace organization isn't supported using admin
172
+ // access.
173
+ bool use_admin_access = 5;
159
174
  }
160
175
 
161
176
  // Request message for updating a membership.
@@ -172,6 +187,17 @@ message UpdateMembershipRequest {
172
187
  // - `role`
173
188
  google.protobuf.FieldMask update_mask = 2
174
189
  [(google.api.field_behavior) = REQUIRED];
190
+
191
+ // When `true`, the method runs using the user's Google Workspace
192
+ // administrator privileges.
193
+ //
194
+ // The calling user must be a Google Workspace administrator with the
195
+ // [manage chat and spaces conversations
196
+ // privilege](https://support.google.com/a/answer/13369245).
197
+ //
198
+ // Requires the `chat.admin.memberships` [OAuth 2.0
199
+ // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
200
+ bool use_admin_access = 3;
175
201
  }
176
202
 
177
203
  // Request message for listing memberships.
@@ -215,8 +241,8 @@ message ListMembershipsRequest {
215
241
  //
216
242
  // To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`.
217
243
  //
218
- // To filter by type, set `member.type` to `HUMAN` or `BOT`. Developer
219
- // Preview: You can also filter for `member.type` using the `!=` operator.
244
+ // To filter by type, set `member.type` to `HUMAN` or `BOT`. You can also
245
+ // filter for `member.type` using the `!=` operator.
220
246
  //
221
247
  // To filter by both role and type, use the `AND` operator. To filter by
222
248
  // either role or type, use the `OR` operator.
@@ -263,6 +289,20 @@ message ListMembershipsRequest {
263
289
  // Currently requires [user
264
290
  // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
265
291
  bool show_invited = 7 [(google.api.field_behavior) = OPTIONAL];
292
+
293
+ // When `true`, the method runs using the user's Google Workspace
294
+ // administrator privileges.
295
+ //
296
+ // The calling user must be a Google Workspace administrator with the
297
+ // [manage chat and spaces conversations
298
+ // privilege](https://support.google.com/a/answer/13369245).
299
+ //
300
+ // Requires either the `chat.admin.memberships.readonly` or
301
+ // `chat.admin.memberships` [OAuth 2.0
302
+ // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
303
+ //
304
+ // Listing app memberships in a space isn't supported when using admin access.
305
+ bool use_admin_access = 8;
266
306
  }
267
307
 
268
308
  // Response to list memberships of the space.
@@ -295,6 +335,20 @@ message GetMembershipRequest {
295
335
  (google.api.field_behavior) = REQUIRED,
296
336
  (google.api.resource_reference) = { type: "chat.googleapis.com/Membership" }
297
337
  ];
338
+
339
+ // When `true`, the method runs using the user's Google Workspace
340
+ // administrator privileges.
341
+ //
342
+ // The calling user must be a Google Workspace administrator with the
343
+ // [manage chat and spaces conversations
344
+ // privilege](https://support.google.com/a/answer/13369245).
345
+ //
346
+ // Requires the `chat.admin.memberships` or `chat.admin.memberships.readonly`
347
+ // [OAuth 2.0
348
+ // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
349
+ //
350
+ // Getting app memberships in a space isn't supported when using admin access.
351
+ bool use_admin_access = 3;
298
352
  }
299
353
 
300
354
  // Request to delete a membership in a space.
@@ -317,4 +371,17 @@ message DeleteMembershipRequest {
317
371
  (google.api.field_behavior) = REQUIRED,
318
372
  (google.api.resource_reference) = { type: "chat.googleapis.com/Membership" }
319
373
  ];
374
+
375
+ // When `true`, the method runs using the user's Google Workspace
376
+ // administrator privileges.
377
+ //
378
+ // The calling user must be a Google Workspace administrator with the
379
+ // [manage chat and spaces conversations
380
+ // privilege](https://support.google.com/a/answer/13369245).
381
+ //
382
+ // Requires the `chat.admin.memberships` [OAuth 2.0
383
+ // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
384
+ //
385
+ // Deleting app memberships in a space isn't supported using admin access.
386
+ bool use_admin_access = 2;
320
387
  }
@@ -102,8 +102,8 @@ message Message {
102
102
  // user](https://developers.google.com/workspace/chat/format-messages#messages-@mention),
103
103
  // or everyone in the space.
104
104
  //
105
- // To learn about creating text messages, see [Send a text
106
- // message](https://developers.google.com/workspace/chat/create-messages#create-text-messages).
105
+ // To learn about creating text messages, see [Send a
106
+ // message](https://developers.google.com/workspace/chat/create-messages).
107
107
  string text = 4;
108
108
 
109
109
  // Output only. Contains the message `text` with markups added to communicate
@@ -146,8 +146,8 @@ message Message {
146
146
  // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
147
147
  // the messages can't contain cards.
148
148
  //
149
- // To learn about cards and how to create them, see [Send card
150
- // messages](https://developers.google.com/workspace/chat/create-messages#create).
149
+ // To learn how to create a message that contains cards, see [Send a
150
+ // message](https://developers.google.com/workspace/chat/create-messages).
151
151
  //
152
152
  // [Card builder](https://addons.gsuite.google.com/uikit/builder)
153
153
  repeated CardWithId cards_v2 = 22;
@@ -214,16 +214,17 @@ message Message {
214
214
 
215
215
  // Immutable. Input for creating a message, otherwise output only. The user
216
216
  // that can view the message. When set, the message is private and only
217
- // visible to the specified user and the Chat app. Link previews and
218
- // attachments aren't supported for private messages.
217
+ // visible to the specified user and the Chat app. To include this field in
218
+ // your request, you must call the Chat API using [app
219
+ // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
220
+ // and omit the following:
219
221
  //
220
- // Only Chat apps can send private messages. If your Chat app [authenticates
221
- // as a
222
- // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
223
- // to send a message, the message can't be private and must omit this field.
222
+ // * [Attachments](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments)
223
+ // * [Accessory
224
+ // widgets](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#Message.AccessoryWidget)
224
225
  //
225
- // For details, see [Send private messages to Google Chat
226
- // users](https://developers.google.com/workspace/chat/private-messages).
226
+ // For details, see [Send a message
227
+ // privately](https://developers.google.com/workspace/chat/create-messages#private).
227
228
  User private_message_viewer = 36 [(google.api.field_behavior) = IMMUTABLE];
228
229
 
229
230
  // Output only. Information about a deleted message. A message is deleted when
@@ -292,7 +293,7 @@ message Thread {
292
293
  pattern: "spaces/{space}/threads/{thread}"
293
294
  };
294
295
 
295
- // Output only. Resource name of the thread.
296
+ // Resource name of the thread.
296
297
  //
297
298
  // Example: `spaces/{space}/threads/{thread}`
298
299
  string name = 1;