Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [chat] Add missing field annotations in space.proto, message.proto, reaction.proto, space_event.proto, membership.proto, attachment.proto #5870

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions packages/google-chat/protos/google/chat/v1/attachment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
240 changes: 166 additions & 74 deletions packages/google-chat/protos/google/chat/v1/chat_service.proto

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
84 changes: 52 additions & 32 deletions packages/google-chat/protos/google/chat/v1/membership.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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
Expand Down Expand Up @@ -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 `[email protected]` is `123456789`, you
// can add the user to the space by setting the `membership.member.name` to
// `users/[email protected]` 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 `[email protected]` is `123456789`,
// you can add the user to the space by setting the `membership.member.name`
// to `users/[email protected]` 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
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -326,17 +348,15 @@ 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/[email protected]` where `[email protected]` is the
// email of the Google Chat user.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(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
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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];
}
Loading
Loading