Skip to content

Commit 0730fb1

Browse files
feat: [chat] Add missing field annotations in space.proto, message.proto, reaction.proto, space_event.proto, membership.proto, attachment.proto (#5870)
* 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: googleapis/googleapis@27c0c3c Source-Link: googleapis/googleapis-gen@6c7adc4 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 <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent fdd7c3f commit 0730fb1

27 files changed

+1401
-541
lines changed

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ message Attachment {
4747
UPLOADED_CONTENT = 2;
4848
}
4949

50-
// Resource name of the attachment, in the form
50+
// Optional. Resource name of the attachment, in the form
5151
// `spaces/{space}/messages/{message}/attachments/{attachment}`.
52-
string name = 1;
52+
string name = 1 [(google.api.field_behavior) = OPTIONAL];
5353

5454
// Output only. The original file name for the content, not the full path.
5555
string content_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -59,9 +59,11 @@ message Attachment {
5959

6060
// The data reference to the attachment.
6161
oneof data_ref {
62-
// A reference to the attachment data. This field is used with the media API
63-
// to download the attachment data.
64-
AttachmentDataRef attachment_data_ref = 4;
62+
// Optional. A reference to the attachment data. This field is used to
63+
// create or update messages with attachments, or with the media API to
64+
// download the attachment data.
65+
AttachmentDataRef attachment_data_ref = 4
66+
[(google.api.field_behavior) = OPTIONAL];
6567

6668
// Output only. A reference to the Google Drive attachment. This field is
6769
// used with the Google Drive API.
@@ -90,14 +92,14 @@ message DriveDataRef {
9092

9193
// A reference to the attachment data.
9294
message AttachmentDataRef {
93-
// The resource name of the attachment data. This field is used with the media
94-
// API to download the attachment data.
95-
string resource_name = 1;
96-
97-
// Opaque token containing a reference to an uploaded attachment. Treated by
98-
// clients as an opaque string and used to create or update Chat messages with
99-
// attachments.
100-
string attachment_upload_token = 2;
95+
// Optional. The resource name of the attachment data. This field is used with
96+
// the media API to download the attachment data.
97+
string resource_name = 1 [(google.api.field_behavior) = OPTIONAL];
98+
99+
// Optional. Opaque token containing a reference to an uploaded attachment.
100+
// Treated by clients as an opaque string and used to create or update Chat
101+
// messages with attachments.
102+
string attachment_upload_token = 2 [(google.api.field_behavior) = OPTIONAL];
101103
}
102104

103105
// Request to get an attachment.

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

Lines changed: 166 additions & 74 deletions
Large diffs are not rendered by default.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ option ruby_package = "Google::Apps::Chat::V1";
2828
// Information about a deleted message. A message is deleted when `delete_time`
2929
// is set.
3030
message DeletionMetadata {
31-
// Who deleted the message and how it was deleted.
31+
// Who deleted the message and how it was deleted. More values may be added in
32+
// the future.
3233
enum DeletionType {
3334
// This value is unused.
3435
DELETION_TYPE_UNSPECIFIED = 0;

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

Lines changed: 52 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,10 @@ message Membership {
7878
ROLE_MANAGER = 2;
7979
}
8080

81-
// Resource name of the membership, assigned by the server.
81+
// Identifier. Resource name of the membership, assigned by the server.
8282
//
8383
// Format: `spaces/{space}/members/{member}`
84-
string name = 1 [
85-
(google.api.resource_reference) = { type: "chat.googleapis.com/Membership" }
86-
];
84+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
8785

8886
// Output only. State of the membership.
8987
MembershipState state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -97,16 +95,19 @@ message Membership {
9795
// Member associated with this membership. Other member types might be
9896
// supported in the future.
9997
oneof memberType {
100-
// The Google Chat user or app the membership corresponds to.
98+
// Optional. The Google Chat user or app the membership corresponds to.
10199
// If your Chat app [authenticates as a
102100
// user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
103101
// the output populates the
104102
// [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User)
105103
// `name` and `type`.
106-
User member = 3;
104+
User member = 3 [(google.api.field_behavior) = OPTIONAL];
107105

108-
// The Google Group the membership corresponds to.
109-
Group group_member = 5;
106+
// Optional. The Google Group the membership corresponds to.
107+
//
108+
// Reading or mutating memberships for Google Groups requires [user
109+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
110+
Group group_member = 5 [(google.api.field_behavior) = OPTIONAL];
110111
}
111112

112113
// Optional. Immutable. The creation time of the membership, such as when a
@@ -140,24 +141,45 @@ message CreateMembershipRequest {
140141
];
141142

142143
// Required. The membership relation to create.
144+
//
143145
// The `memberType` field must contain a user with the `user.name` and
144146
// `user.type` fields populated. The server will assign a resource name
145147
// and overwrite anything specified.
148+
//
146149
// When a Chat app creates a membership relation for a human user, it must use
147-
// the `chat.memberships` scope, set `user.type` to `HUMAN`, and set
148-
// `user.name` with format `users/{user}`, where `{user}` can be the email
149-
// address for the user. For users in the same Workspace organization `{user}`
150-
// can also be the `id` of the
151-
// [person](https://developers.google.com/people/api/rest/v1/people) from the
152-
// People API, or the `id` for the user in the Directory API. For example, if
153-
// the People API Person profile ID for `user@example.com` is `123456789`, you
154-
// can add the user to the space by setting the `membership.member.name` to
155-
// `users/user@example.com` or `users/123456789`. When a Chat app creates a
156-
// membership relation for itself, it must use the `chat.memberships.app`
157-
// scope, set `user.type` to `BOT`, and set `user.name` to `users/app`.
150+
// certain authorization scopes and set specific values for certain fields:
151+
//
152+
// - When [authenticating as a
153+
// user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
154+
// the `chat.memberships` authorization scope is required.
155+
//
156+
// - When [authenticating as an
157+
// app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app),
158+
// the `chat.app.memberships` authorization scope is required.
159+
// Authenticating as an app is available in [Developer
160+
// Preview](https://developers.google.com/workspace/preview).
161+
//
162+
// - Set `user.type` to `HUMAN`, and set `user.name` with format
163+
// `users/{user}`, where `{user}` can be the email address for the user. For
164+
// users in the same Workspace organization `{user}` can also be the `id` of
165+
// the [person](https://developers.google.com/people/api/rest/v1/people) from
166+
// the People API, or the `id` for the user in the Directory API. For example,
167+
// if the People API Person profile ID for `user@example.com` is `123456789`,
168+
// you can add the user to the space by setting the `membership.member.name`
169+
// to `users/user@example.com` or `users/123456789`.
170+
//
171+
// Inviting users external to the Workspace organization that owns the space
172+
// requires [user
173+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
174+
//
175+
// When a Chat app creates a membership relation for itself, it must
176+
// [authenticate as a
177+
// user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
178+
// and use the `chat.memberships.app` scope, set `user.type` to `BOT`, and set
179+
// `user.name` to `users/app`.
158180
Membership membership = 2 [(google.api.field_behavior) = REQUIRED];
159181

160-
// When `true`, the method runs using the user's Google Workspace
182+
// Optional. When `true`, the method runs using the user's Google Workspace
161183
// administrator privileges.
162184
//
163185
// The calling user must be a Google Workspace administrator with the
@@ -170,7 +192,7 @@ message CreateMembershipRequest {
170192
// Creating app memberships or creating memberships for users outside the
171193
// administrator's Google Workspace organization isn't supported using admin
172194
// access.
173-
bool use_admin_access = 5;
195+
bool use_admin_access = 5 [(google.api.field_behavior) = OPTIONAL];
174196
}
175197

176198
// Request message for updating a membership.
@@ -188,7 +210,7 @@ message UpdateMembershipRequest {
188210
google.protobuf.FieldMask update_mask = 2
189211
[(google.api.field_behavior) = REQUIRED];
190212

191-
// When `true`, the method runs using the user's Google Workspace
213+
// Optional. When `true`, the method runs using the user's Google Workspace
192214
// administrator privileges.
193215
//
194216
// The calling user must be a Google Workspace administrator with the
@@ -197,7 +219,7 @@ message UpdateMembershipRequest {
197219
//
198220
// Requires the `chat.admin.memberships` [OAuth 2.0
199221
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
200-
bool use_admin_access = 3;
222+
bool use_admin_access = 3 [(google.api.field_behavior) = OPTIONAL];
201223
}
202224

203225
// Request message for listing memberships.
@@ -290,7 +312,7 @@ message ListMembershipsRequest {
290312
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
291313
bool show_invited = 7 [(google.api.field_behavior) = OPTIONAL];
292314

293-
// When `true`, the method runs using the user's Google Workspace
315+
// Optional. When `true`, the method runs using the user's Google Workspace
294316
// administrator privileges.
295317
//
296318
// The calling user must be a Google Workspace administrator with the
@@ -302,7 +324,7 @@ message ListMembershipsRequest {
302324
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
303325
//
304326
// Listing app memberships in a space isn't supported when using admin access.
305-
bool use_admin_access = 8;
327+
bool use_admin_access = 8 [(google.api.field_behavior) = OPTIONAL];
306328
}
307329

308330
// Response to list memberships of the space.
@@ -326,17 +348,15 @@ message GetMembershipRequest {
326348
//
327349
// Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`
328350
//
329-
// When [authenticated as a
330-
// user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
331-
// you can use the user's email as an alias for `{member}`. For example,
351+
// You can use the user's email as an alias for `{member}`. For example,
332352
// `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the
333353
// email of the Google Chat user.
334354
string name = 1 [
335355
(google.api.field_behavior) = REQUIRED,
336356
(google.api.resource_reference) = { type: "chat.googleapis.com/Membership" }
337357
];
338358

339-
// When `true`, the method runs using the user's Google Workspace
359+
// Optional. When `true`, the method runs using the user's Google Workspace
340360
// administrator privileges.
341361
//
342362
// The calling user must be a Google Workspace administrator with the
@@ -348,7 +368,7 @@ message GetMembershipRequest {
348368
// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
349369
//
350370
// Getting app memberships in a space isn't supported when using admin access.
351-
bool use_admin_access = 3;
371+
bool use_admin_access = 3 [(google.api.field_behavior) = OPTIONAL];
352372
}
353373

354374
// Request to delete a membership in a space.
@@ -372,7 +392,7 @@ message DeleteMembershipRequest {
372392
(google.api.resource_reference) = { type: "chat.googleapis.com/Membership" }
373393
];
374394

375-
// When `true`, the method runs using the user's Google Workspace
395+
// Optional. When `true`, the method runs using the user's Google Workspace
376396
// administrator privileges.
377397
//
378398
// The calling user must be a Google Workspace administrator with the
@@ -383,5 +403,5 @@ message DeleteMembershipRequest {
383403
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
384404
//
385405
// Deleting app memberships in a space isn't supported using admin access.
386-
bool use_admin_access = 2;
406+
bool use_admin_access = 2 [(google.api.field_behavior) = OPTIONAL];
387407
}

0 commit comments

Comments
 (0)