Skip to content

Commit

Permalink
feat: Launch AccessoryAction for GA
Browse files Browse the repository at this point in the history
docs: updated comments

PiperOrigin-RevId: 619423474
  • Loading branch information
Google APIs authored and Copybara-Service committed Mar 27, 2024
1 parent 5b25280 commit e7b48a7
Showing 1 changed file with 74 additions and 1 deletion.
75 changes: 74 additions & 1 deletion google/chat/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,71 @@ message Message {
// Output only. GIF images that are attached to the message.
repeated AttachedGif attached_gifs = 42
[(google.api.field_behavior) = OUTPUT_ONLY];

// One or more interactive widgets that appear at the bottom of a message.
// You can add accessory widgets to messages that contain text, cards, or both
// text and cards. Not supported for messages that contain dialogs.
//
// Creating a message with accessory widgets requires [app
// authentication]
// (https://developers.google.com/chat/api/guides/auth/service-accounts).
//
// The following example shows a Chat app that uses accessory widgets (thumbs
// up and thumbs down buttons) in a text message:
//
// ![Example accessory widgets
// message](https://developers.google.com/chat/images/message-accessory-widgets-reference.png)
//
// The JSON for this example message is the following:
//
// ```
// {
// "text": "Rate your experience with this Chat app.",
// "accessoryWidgets": [
// {
// "buttonList": {
// "buttons": [
// {
// "icon": {
// "material_icon": {
// "name": "thumb_up"
// }
// },
// "color": {
// "red": 0,
// "blue": 255,
// "green": 0
// },
// "onClick": {
// "action": {
// "function": "doUpvote",
// }
// }
// },
// {
// "icon": {
// "material_icon": {
// "name": "thumb_down"
// }
// },
// "color": {
// "red": 0,
// "blue": 255,
// "green": 0
// },
// "onClick": {
// "action": {
// "function": "doDownvote",
// }
// }
// }
// ]
// }
// }
// ]
// }
// ```
repeated AccessoryWidget accessory_widgets = 44;
}

// A GIF image that's specified by a URL.
Expand Down Expand Up @@ -360,6 +425,14 @@ message ActionResponse {
UpdatedWidget updated_widget = 4 [(google.api.field_behavior) = INPUT_ONLY];
}

// A borderless widget attached to the bottom of an app's message.
message AccessoryWidget {
oneof action {
// A list of buttons that are displayed under the message.
google.apps.card.v1.ButtonList button_list = 1;
}
}

message GetMessageRequest {
// Required. Resource name of the message.
//
Expand Down Expand Up @@ -418,7 +491,7 @@ message UpdateMessageRequest {
// - `cards_v2` (Requires [app
// authentication](/chat/api/guides/auth/service-accounts).)
//
// - Developer Preview: `accessory_widgets` (Requires [app
// - `accessory_widgets` (Requires [app
// authentication](/chat/api/guides/auth/service-accounts).)
google.protobuf.FieldMask update_mask = 2;

Expand Down

0 comments on commit e7b48a7

Please sign in to comment.