Skip to content

Commit

Permalink
docs:Chat API documentation update
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 625051297
  • Loading branch information
Google APIs authored and Copybara-Service committed Apr 15, 2024
1 parent d0205ed commit 81c27a6
Show file tree
Hide file tree
Showing 13 changed files with 225 additions and 234 deletions.
2 changes: 1 addition & 1 deletion google/chat/v1/action_status.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ option php_namespace = "Google\\Apps\\Chat\\V1";
option ruby_package = "Google::Apps::Chat::V1";

// Represents the status for a request to either invoke or submit a
// [dialog](https://developers.google.com/chat/how-tos/dialogs).
// [dialog](https://developers.google.com/workspace/chat/dialogs).
message ActionStatus {
// The status code.
google.rpc.Code status_code = 1;
Expand Down
4 changes: 2 additions & 2 deletions google/chat/v1/annotation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ option ruby_package = "Google::Apps::Chat::V1";
// Output only. Annotations associated with the plain-text body of the message.
// To add basic formatting to a text message, see
// [Format text
// messages](https://developers.google.com/chat/format-messages).
// messages](https://developers.google.com/workspace/chat/format-messages).
//
// Example plain-text message body:
// ```
Expand Down Expand Up @@ -155,7 +155,7 @@ message RichLinkMetadata {
// Data for Google Drive links.
message DriveLinkData {
// A
// [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
// [DriveDataRef](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
// which references a Google Drive file.
DriveDataRef drive_data_ref = 1;

Expand Down
9 changes: 9 additions & 0 deletions google/chat/v1/attachment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ message Attachment {
pattern: "spaces/{space}/messages/{message}/attachments/{attachment}"
};

// The source of the attachment.
enum Source {
// Reserved.
SOURCE_UNSPECIFIED = 0;

// The file is a Google Drive file.
DRIVE_FILE = 1;

// The file is uploaded to Chat.
UPLOADED_CONTENT = 2;
}

Expand All @@ -52,6 +56,7 @@ message Attachment {
// Output only. The content type (MIME type) of the file.
string content_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

// 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.
Expand Down Expand Up @@ -82,6 +87,7 @@ message DriveDataRef {
string drive_file_id = 2;
}

// 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.
Expand All @@ -93,6 +99,7 @@ message AttachmentDataRef {
string attachment_upload_token = 2;
}

// Request to get an attachment.
message GetAttachmentRequest {
// Required. Resource name of the attachment, in the form
// `spaces/*/messages/*/attachments/*`.
Expand All @@ -102,6 +109,7 @@ message GetAttachmentRequest {
];
}

// Request to upload an attachment.
message UploadAttachmentRequest {
// Required. Resource name of the Chat space in which the attachment is
// uploaded. Format "spaces/{space}".
Expand All @@ -116,6 +124,7 @@ message UploadAttachmentRequest {
string filename = 4 [(google.api.field_behavior) = REQUIRED];
}

// Response of uploading an attachment.
message UploadAttachmentResponse {
// Reference to the uploaded attachment.
AttachmentDataRef attachment_data_ref = 1;
Expand Down
162 changes: 82 additions & 80 deletions google/chat/v1/chat_service.proto

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion google/chat/v1/contextual_addon.proto
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ message ContextualAddOnMarkup {
// supported. For more information
// about formatting text, see
// [Formatting text in Google Chat
// apps](https://developers.google.com/chat/format-messages#card-formatting)
// apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
// and
// [Formatting
// text in Google Workspace
Expand Down
26 changes: 16 additions & 10 deletions google/chat/v1/membership.proto
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ message Membership {
oneof memberType {
// The Google Chat user or app the membership corresponds to.
// If your Chat app [authenticates as a
// user](https://developers.google.com/chat/api/guides/auth/users), the
// output populates the
// [user](https://developers.google.com/chat/api/reference/rest/v1/User)
// 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;

Expand All @@ -127,6 +127,7 @@ message Membership {
];
}

// Request message for creating a membership.
message CreateMembershipRequest {
// Required. The resource name of the space for which to create the
// membership.
Expand Down Expand Up @@ -158,6 +159,7 @@ message CreateMembershipRequest {
Membership membership = 2 [(google.api.field_behavior) = REQUIRED];
}

// Request message for listing memberships.
message ListMembershipsRequest {
// Required. The resource name of the space for which to fetch a membership
// list.
Expand All @@ -175,8 +177,8 @@ message ListMembershipsRequest {
//
// If unspecified, at most 100 memberships are returned.
//
// The maximum value is 1,000. If you use a value more than 1,000, it's
// automatically changed to 1,000.
// The maximum value is 1000. If you use a value more than 1000, it's
// automatically changed to 1000.
//
// Negative values return an `INVALID_ARGUMENT` error.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
Expand All @@ -192,9 +194,9 @@ message ListMembershipsRequest {
// Optional. A query filter.
//
// You can filter memberships by a member's role
// ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole))
// ([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole))
// and type
// ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)).
// ([`member.type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type)).
//
// To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`.
//
Expand All @@ -217,6 +219,7 @@ message ListMembershipsRequest {
// role = "ROLE_MANAGER" AND role = "ROLE_MEMBER"
// ```
//
//
// Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
// error.
string filter = 5 [(google.api.field_behavior) = OPTIONAL];
Expand All @@ -237,10 +240,11 @@ message ListMembershipsRequest {
// that don't match the filter criteria aren't returned.
//
// Currently requires [user
// authentication](https://developers.google.com/chat/api/guides/auth/users).
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
bool show_invited = 7 [(google.api.field_behavior) = OPTIONAL];
}

// Response to list memberships of the space.
message ListMembershipsResponse {
// Unordered list. List of memberships in the requested (or first) page.
repeated Membership memberships = 1
Expand All @@ -251,6 +255,7 @@ message ListMembershipsResponse {
string next_page_token = 2;
}

// Request to get a membership of a space.
message GetMembershipRequest {
// Required. Resource name of the membership to retrieve.
//
Expand All @@ -260,8 +265,8 @@ message GetMembershipRequest {
// Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`
//
// When [authenticated as a
// user](https://developers.google.com/chat/api/guides/auth/users), you can
// use the user's email as an alias for `{member}`. For example,
// 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,
// `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the
// email of the Google Chat user.
string name = 1 [
Expand All @@ -270,6 +275,7 @@ message GetMembershipRequest {
];
}

// Request to delete a membership in a space.
message DeleteMembershipRequest {
// Required. Resource name of the membership to delete. Chat apps can delete
// human users' or their own memberships. Chat apps can't delete other apps'
Expand Down
Loading

0 comments on commit 81c27a6

Please sign in to comment.