@@ -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