Skip to content

Commit d5a4a46

Browse files
feat: [chat] Add doc for permission settings & announcement space support (#5731)
* feat: Add doc for permission settings & announcement space support feat: Add doc for import mode external users support docs: Messages API dev docs improvement docs: Memberships API dev docs improvement docs: Discoverable space docs improvement PiperOrigin-RevId: 681521060 Source-Link: googleapis/googleapis@c472cf7 Source-Link: googleapis/googleapis-gen@a905bb2 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNoYXQvLk93bEJvdC55YW1sIiwiaCI6ImE5MDViYjIyYzk2OGViZGRlZDEzNmIyODJlZjA3Mzk5MmZjMTQwYzUifQ== * 🦉 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 <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 43049d0 commit d5a4a46

12 files changed

Lines changed: 1701 additions & 239 deletions

File tree

packages/google-chat/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
4444
1. [Select or create a Cloud Platform project][projects].
4545
1. [Enable billing for your project][billing].
4646
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
4848
API from your local workstation.
4949

5050
### Installing the client library
@@ -224,4 +224,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE)
224224
[projects]: https://console.cloud.google.com/project
225225
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
226226
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=chat.googleapis.com
227-
[auth]: https://cloud.google.com/docs/authentication/getting-started
227+
[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local

packages/google-chat/protos/google/chat/v1/chat_service.proto

Lines changed: 51 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,30 @@ service ChatService {
6666
"https://www.googleapis.com/auth/chat.users.readstate,"
6767
"https://www.googleapis.com/auth/chat.users.readstate.readonly";
6868

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
7170
// message](https://developers.google.com/workspace/chat/create-messages).
7271
//
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.
7675
//
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.
8193
rpc CreateMessage(CreateMessageRequest) returns (Message) {
8294
option (google.api.http) = {
8395
post: "/v1/{parent=spaces/*}/messages"
@@ -87,8 +99,12 @@ service ChatService {
8799
}
88100

89101
// 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).
92108
// Requires [user
93109
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
94110
rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse) {
@@ -299,14 +315,19 @@ service ChatService {
299315
option (google.api.method_signature) = "name";
300316
}
301317

302-
// Creates a named space. Spaces grouped by topics aren't supported. For an
303-
// 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
304321
// space](https://developers.google.com/workspace/chat/create-spaces).
305322
//
306323
// If you receive the error message `ALREADY_EXISTS` when creating
307324
// a space, try a different `displayName`. An existing space within
308325
// the Google Workspace organization might already use this display name.
309326
//
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+
//
310331
// Requires [user
311332
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
312333
rpc CreateSpace(CreateSpaceRequest) returns (Space) {
@@ -448,40 +469,25 @@ service ChatService {
448469
};
449470
}
450471

451-
// Creates a human membership or app membership for the calling app. Creating
452-
// memberships for other apps isn't supported. For an example, see
453-
// [Invite or add a user or a Google Chat app to a
454-
// 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.
455474
// When creating a membership, if the specified member has their auto-accept
456475
// policy turned off, then they're invited, and must accept the space
457476
// invitation before joining. Otherwise, creating a membership adds the member
458-
// directly to the specified space. Requires [user
477+
// directly to the specified space.
478+
// Requires [user
459479
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
460480
//
461-
// To specify the member to add, set the `membership.member.name` for the
462-
// human or app member, or set the `membership.group_member.name` for the
463-
// group member.
464-
//
465-
// - To add the calling app to a space or a direct message between two human
466-
// users, use `users/app`. Unable to add other
467-
// apps to the space.
468-
//
469-
// - To add a human user, use `users/{user}`, where `{user}` can be the email
470-
// address for the user. For users in the same Workspace organization `{user}`
471-
// can also be the `id` for the person from the People API, or the `id` for
472-
// the user in the Directory API. For example, if the People API Person
473-
// profile ID for `[email protected]` is `123456789`, you can add the user to
474-
// the space by setting the `membership.member.name` to
475-
// `users/[email protected]` or `users/123456789`.
476-
//
477-
// - To add or invite a Google group in a named space, use
478-
// `groups/{group}`, where `{group}` is the `id` for the group from the Cloud
479-
// Identity Groups API. For example, you can use [Cloud Identity Groups lookup
480-
// API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup)
481-
// to retrieve the ID `123456789` for group email `[email protected]`, then
482-
// you can add or invite the group to a named space by setting the
483-
// `membership.group_member.name` to `groups/123456789`. Group email is not
484-
// 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).
485491
rpc CreateMembership(CreateMembershipRequest) returns (Membership) {
486492
option (google.api.http) = {
487493
post: "/v1/{parent=spaces/*}/members"
@@ -605,6 +611,9 @@ service ChatService {
605611
// updated, the server returns the updated `Message` resource in the event
606612
// payload.
607613
//
614+
// Note: The `permissionSettings` field is not returned in the Space
615+
// object of the Space event data for this request.
616+
//
608617
// Requires [user
609618
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
610619
// To get an event, the authenticated user must be a member of the space.

packages/google-chat/protos/google/chat/v1/message.proto

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ message Message {
102102
// user](https://developers.google.com/workspace/chat/format-messages#messages-@mention),
103103
// or everyone in the space.
104104
//
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).
107107
string text = 4;
108108

109109
// Output only. Contains the message `text` with markups added to communicate
@@ -146,8 +146,8 @@ message Message {
146146
// user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
147147
// the messages can't contain cards.
148148
//
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).
151151
//
152152
// [Card builder](https://addons.gsuite.google.com/uikit/builder)
153153
repeated CardWithId cards_v2 = 22;
@@ -214,16 +214,17 @@ message Message {
214214

215215
// Immutable. Input for creating a message, otherwise output only. The user
216216
// 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:
219221
//
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)
224225
//
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).
227228
User private_message_viewer = 36 [(google.api.field_behavior) = IMMUTABLE];
228229

229230
// Output only. Information about a deleted message. A message is deleted when
@@ -292,7 +293,7 @@ message Thread {
292293
pattern: "spaces/{space}/threads/{thread}"
293294
};
294295

295-
// Output only. Resource name of the thread.
296+
// Resource name of the thread.
296297
//
297298
// Example: `spaces/{space}/threads/{thread}`
298299
string name = 1;

0 commit comments

Comments
 (0)