- Resource: Message
- Card
- CardHeader
- ImageStyle
- Section
- WidgetMarkup
- TextParagraph
- Image
- OnClick
- FormAction
- ActionParameter
- OpenLink
- KeyValue
- Icon
- Button
- TextButton
- ImageButton
- CardAction
- Annotation
- AnnotationType
- UserMentionMetadata
- Type
- SlashCommandMetadata
- Type
- Thread
- ActionResponse
- ResponseType
- DialogAction
- Dialog
- Card
- CardHeader
- ImageType
- Section
- Widget
- TextParagraph
- Image
- OnClick
- Action
- ActionParameter
- LoadIndicator
- OpenLink
- OpenAs
- OnClose
- DecoratedText
- Icon
- Button
- Color
- SwitchControl
- ControlType
- ButtonList
- TextInput
- Type
- Suggestions
- SuggestionItem
- SelectionInput
- SelectionType
- SelectionItem
- DateTimePicker
- DateTimePickerType
- Divider
- Grid
- GridItem
- ImageComponent
- ImageCropStyle
- ImageCropType
- BorderStyle
- BorderType
- HorizontalAlignment
- GridItemLayout
- CardAction
- CardFixedFooter
- DisplayStyle
- ActionStatus
- Code
- SlashCommand
- MatchedUrl
- Methods
Resource: Message
A message in Google Chat.
JSON representation |
---|
{ "name": string, "sender": { object ( |
Fields | |
---|---|
name |
Resource name in the form Example: |
sender |
Output only. The user who created the message. |
createTime |
Output only. The time at which the message was created in Google Chat server. |
lastUpdateTime |
Output only. The time at which the message was last updated. If the message was never updated, this field matches |
text |
Plain-text body of the message. The first link to an image, video, web page, or other preview-able item generates a preview chip. |
cards[] |
Rich, formatted and interactive cards that can be used to display UI elements such as: formatted texts, buttons, clickable images. Cards are normally displayed below the plain-text body of the message. |
previewText |
Deprecated: To generate a preview chip for a link to an image, video, web page, or other preview-able item, include the link in the message's |
annotations[] |
Output only. Annotations associated with the text in this message. |
thread |
The thread the message belongs to. |
space |
The space the message belongs to. |
fallbackText |
A plain-text description of the message's cards, used when the actual cards cannot be displayed (e.g. mobile notifications). |
actionResponse |
Input only. Parameters that a Chat app can use to configure how its response is posted. |
argumentText |
Plain-text body of the message with all Chat app mentions stripped out. |
slashCommand |
Output only. Slash command information, if applicable. |
attachment[] |
User uploaded attachment. |
matchedUrl |
Output only. A URL in |
Annotation
Annotations associated with the plain-text body of the message.
Example plain-text message body:
Hello @FooBot how are you!"
The corresponding annotations metadata:
"annotations":[{
"type":"USER_MENTION",
"startIndex":6,
"length":7,
"userMention": {
"user": {
"name":"users/107946847022116401880",
"displayName":"FooBot",
"avatarUrl":"https://goo.gl/aeDtrS",
"type":"BOT"
},
"type":"MENTION"
}
}]
JSON representation |
---|
{ "type": enum ( |
Fields | |
---|---|
type |
The type of this annotation. |
startIndex |
Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to. |
length |
Length of the substring in the plain-text message body this annotation corresponds to. |
Union field metadata . Additional metadata about the annotation. metadata can be only one of the following: |
|
userMention |
The metadata of user mention. |
slashCommand |
The metadata for a slash command. |
AnnotationType
Type of the annotation.
Enums | |
---|---|
ANNOTATION_TYPE_UNSPECIFIED |
Default value for the enum. DO NOT USE. |
USER_MENTION |
A user is mentioned. |
SLASH_COMMAND |
A slash command is invoked. |
UserMentionMetadata
Annotation metadata for user mentions (@).
JSON representation |
---|
{ "user": { object ( |
Fields | |
---|---|
user |
The user mentioned. |
type |
The type of user mention. |
Type
Enums | |
---|---|
TYPE_UNSPECIFIED |
Default value for the enum. DO NOT USE. |
ADD |
Add user to space. |
MENTION |
Mention user in space. |
SlashCommandMetadata
Annotation metadata for slash commands (/).
JSON representation |
---|
{ "bot": { object ( |
Fields | |
---|---|
bot |
The Chat app whose command was invoked. |
type |
The type of slash command. |
commandName |
The name of the invoked slash command. |
commandId |
The command id of the invoked slash command. |
triggersDialog |
Indicating whether the slash command is for a dialog. |
Type
Enums | |
---|---|
TYPE_UNSPECIFIED |
Default value for the enum. DO NOT USE. |
ADD |
Add Chat app to space. |
INVOKE |
Invoke slash command in space. |
Thread
A thread in Google Chat.
JSON representation |
---|
{ "name": string } |
Fields | |
---|---|
name |
Resource name, in the form "spaces/*/threads/*". Example: spaces/AAAAAAAAAAA/threads/TTTTTTTTTTT |
ActionResponse
Parameters that a Chat app can use to configure how it's response is posted.
JSON representation |
---|
{ "type": enum ( |
Fields | |
---|---|
type |
Input only. The type of Chat app response. |
url |
Input only. URL for users to auth or config. (Only for REQUEST_CONFIG response types.) |
dialogAction |
Input only. A response to an event related to a dialog. Must be accompanied by |
ResponseType
The type of Chat app response.
Enums | |
---|---|
TYPE_UNSPECIFIED |
Default type; will be handled as NEW_MESSAGE. |
NEW_MESSAGE |
Post as a new message in the topic. |
UPDATE_MESSAGE |
Update the Chat app's message. This is only permitted on a CARD_CLICKED event where the message sender type is BOT. |
UPDATE_USER_MESSAGE_CARDS |
Update the cards on a user's message. This is only permitted as a response to a MESSAGE event with a matched url, or a CARD_CLICKED event where the message sender type is HUMAN. Text will be ignored. |
REQUEST_CONFIG |
Privately ask the user for additional auth or config. |
DIALOG |
Presents a dialog. |
DialogAction
Contains a dialog and request status code.
JSON representation |
---|
{ "actionStatus": { object ( |
Fields | |
---|---|
actionStatus |
Input only. Status for a request to either invoke or submit a dialog. Displays a status and message to users, if necessary. For example, in case of an error or success. |
dialog |
Input only. Dialog for the request. |
Dialog
Wrapper around the card body of the dialog.
JSON representation |
---|
{
"body": {
object ( |
Fields | |
---|---|
body |
Input only. Body of the dialog, which is rendered in a modal. Google Chat apps do not support the following card entities: |
Card
A card is a UI element that can contain UI widgets such as text and images. For more information, see Cards . For example, the following JSON creates a card that has a header with the name, position, icons, and link for a contact, followed by a section with contact information like email and phone number.
{
"header": {
"title": "Sasha",
"subtitle": "Software Engineer",
"imageStyle": "ImageStyle.AVATAR",
"imageUrl": "https://example.com/sasha.png",
"imageAltText": "Avatar for Sasha"
},
"sections" : [
{
"header": "Contact Info",
"widgets": [
{
"decoratedText": {
"icon": {
"knownIcon": "EMAIL"
},
"content": "sasha@example.com"
}
},
{
"decoratedText": {
"icon": {
"knownIcon": "PERSON"
},
"content": "<font color=\"#80e27e\">Online</font>"
}
},
{
"decoratedText": {
"icon": {
"knownIcon": "PHONE"
},
"content": "+1 (555) 555-1234"
}
},
{
"buttons": [
{
"textButton": {
"text": "Share",
},
"onClick": {
"openLink": {
"url": "https://example.com/share"
}
}
},
{
"textButton": {
"text": "Edit",
},
"onClick": {
"action": {
"function": "goToView",
"parameters": [
{
"key": "viewType",
"value": "EDIT"
}
],
"loadIndicator": "LoadIndicator.SPINNER"
}
}
}
]
}
],
"collapsible": true,
"uncollapsibleWidgetsCount": 3
}
],
"cardActions": [
{
"actionLabel": "Send Feedback",
"onClick": {
"openLink": {
"url": "https://example.com/feedback"
}
}
}
],
"name": "contact-card-K3wB6arF2H9L"
}
JSON representation |
---|
{ "header": { object ( |
Fields | |
---|---|
header |
The header of the card. A header usually contains a title and an image. |
sections[] |
Sections are separated by a line divider. |
cardActions[] |
The card's actions. Actions are added to the card's generated toolbar menu. For example, the following JSON constructs a card action menu with Settings and Send Feedback options:
|
name |
Name of the card. Used as a card identifier in card navigation. |
fixedFooter |
The fixed footer shown at the bottom of this card. |
displayStyle |
The display style for |
peekCardHeader |
When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards. |
CardHeader
Represents a card header.
JSON representation |
---|
{
"title": string,
"subtitle": string,
"imageType": enum ( |
Fields | |
---|---|
title |
Required. The title of the card header. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines. |
subtitle |
The subtitle of the card header. |
imageType |
The image's type. |
imageUrl |
The URL of the image in the card header. |
imageAltText |
The alternative text of this image which is used for accessibility. |
ImageType
The image type determines the cropping of the image that it is applied to. SQUARE
means that no cropping is applied, CIRCLE
applies a circular mask to the image.
Enums | |
---|---|
SQUARE |
Applies no cropping to the image. |
CIRCLE |
Applies a circular mask to the image. |
Section
A section contains a collection of widgets that are rendered vertically in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there is currently no need for layout properties, for example, float.
JSON representation |
---|
{
"header": string,
"widgets": [
{
object ( |
Fields | |
---|---|
header |
The header of the section. Formatted text is supported. |
widgets[] |
A section must contain at least 1 widget. |
collapsible |
Indicates whether this section is collapsible. If a section is collapsible, the description must be given. |
uncollapsibleWidgetsCount |
The number of uncollapsible widgets. For example, when a section contains five widgets and the |
Widget
A widget is a UI element that presents texts, images, etc.
JSON representation |
---|
{ "horizontalAlignment": enum ( |
Fields | |
---|---|
horizontalAlignment |
The horizontal alignment of this widget. |
Union field data . A widget can only have one of the following items. You can use multiple widget fields to display more items. data can be only one of the following: |
|
textParagraph |
Displays a text paragraph in this widget. For example, the following JSON creates a bolded text:
|
image |
Displays an image in this widget. For example, the following JSON creates an image with alternative text:
|
decoratedText |
Displays a decorated text item in this widget. For example, the following JSON creates a decorated text widget showing email address:
|
buttonList |
A list of buttons. For example, the following JSON creates two buttons. The first is a filled text button and the second is an image button that opens a link:
|
textInput |
Displays a text input in this widget. For example, the following JSON creates a text input for mail address:
As another example, the following JSON creates a text input for programming language with static suggestions:
|
selectionInput |
Displays a switch control in this widget. For example, the following JSON creates a dropdown selection for size:
|
dateTimePicker |
Displays a selection/input widget for date/time. For example, the following JSON creates a date/time picker for an appointment time:
|
divider |
Displays a divider. For example, the following JSON creates a divider:
|
grid |
Displays a grid with a collection of items. For example, the following JSON creates a 2 column grid with a single item:
|
TextParagraph
A paragraph of text that supports formatting. See Text formatting for details.
JSON representation |
---|
{ "text": string } |
Fields | |
---|---|
text |
The text that's shown in the widget. |
Image
An image that is specified by a URL and can have an onClick
action.
JSON representation |
---|
{
"imageUrl": string,
"onClick": {
object ( |
Fields | |
---|---|
imageUrl |
An image URL. |
onClick |
The action triggered by an |
altText |
The alternative text of this image, used for accessibility. |
OnClick
Represents the response to an onClick
event.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field
|
|
action |
If specified, an action is triggered by this |
openLink |
If specified, this |
openDynamicLinkAction |
An add-on triggers this action when the action needs to open a link. This differs from the |
card |
A new card is pushed to the card stack after clicking if specified. |
Action
An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form.
JSON representation |
---|
{ "function": string, "parameters": [ { object ( |
Fields | |
---|---|
function |
Apps Script function to invoke when the containing element is clicked/activated. |
parameters[] |
List of action parameters. |
loadIndicator |
Specifies the loading indicator that the action displays while making the call to the action. |
persistValues |
Indicates whether form values persist after the action. The default value is If If |
ActionParameter
List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
JSON representation |
---|
{ "key": string, "value": string } |
Fields | |
---|---|
key |
The name of the parameter for the action script. |
value |
The value of the parameter. |
LoadIndicator
Specifies the loading indicator that the action displays while making the call to the action.
Enums | |
---|---|
SPINNER |
Displays a spinner to indicate that content is loading. |
NONE |
Nothing is displayed. |
OpenLink
Represents an onClick
event that opens a hyperlink.
JSON representation |
---|
{ "url": string, "openAs": enum ( |
Fields | |
---|---|
url |
The URL to open. |
openAs |
How to open a link. Not supported by Chat apps. |
onClose |
Whether the client forgets about a link after opening it, or observes it until the window closes. Not supported by Chat apps. |
OpenAs
When an OnClick opens a link, then the client can either open it as a full size window (if that is the frame used by the client), or an overlay (such as a pop-up). The implementation depends on the client platform capabilities, and the value selected might be ignored if the client doesn't support it. FULL_SIZE
is supported by all clients. Not supported by Chat apps.
Enums | |
---|---|
FULL_SIZE |
The link opens as a full size window (if that's the frame used by the client. |
OVERLAY |
The link opens as an overlay, such as a pop-up. |
OnClose
When an OnClick opens a link, then the client either forgets about it or observes until the window closes. The implementation depends on the client platform capabilities.
OnClose might cause OpenAs to be ignored; if the client platform can't support both selected values together, OnClose takes precedence. Not supported by Chat apps.
Enums | |
---|---|
NOTHING |
Doesn’t reload the card after the child window closes. |
RELOAD |
Reloads the card after the child window closes. If used in conjunction with OpenAs.OVERLAY, the child window acts as a modal dialog and the main card is blocked until the child window closes. |
DecoratedText
A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget or a button after the text.
JSON representation |
---|
{ "icon": { object ( |
Fields | |
---|---|
icon |
Deprecated in favor of startIcon. |
startIcon |
The icon displayed in front of the text. |
topLabel |
The formatted text label that shows above the main text. |
text |
Required. The main widget formatted text. See Text formatting for details. |
wrapText |
The wrap text setting. If |
bottomLabel |
The formatted text label that shows below the main text. |
onClick |
Only the top and bottom label and content region are clickable. |
Union field control . A control widget or image that appears after the text. You can set a button, switch control, or image, but not more than one. control can be only one of the following: |
|
button |
A button that can be clicked to trigger an action. |
switchControl |
A switch widget can be clicked to change its state or trigger an action. |
endIcon |
An icon displayed after the text. |
Icon
JSON representation |
---|
{ "altText": string, "imageType": enum ( |
Fields | |
---|---|
altText |
The description of the icon, used for accessibility. The default value is provided if you don't specify one. |
imageType |
The crop style applied to the image. In some cases, applying a |
Union field icons . The icon, can be specified by KnownIcon string or a URL. icons can be only one of the following: |
|
knownIcon |
The icon specified by the string name of a list of known icons. |
iconUrl |
The icon specified by a URL. |
Button
A button. Can be a text button or an image button.
JSON representation |
---|
{ "text": string, "icon": { object ( |
Fields | |
---|---|
text |
The text of the button. |
icon |
The icon image. |
color |
If set, the button is filled with a solid background. |
onClick |
The action to perform when the button is clicked. |
disabled |
If |
altText |
The alternative text used for accessibility. Has no effect when an icon is set; use |
Color
Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of java.awt.Color
in Java; it can also be trivially provided to UIColor's +colorWithRed:green:blue:alpha
method in iOS; and, with just a little work, it can be easily formatted into a CSS rgba()
string in JavaScript.
This reference page doesn't carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space.
When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5.
Example (Java):
import com.google.type.Color;
// ...
public static java.awt.Color fromProto(Color protocolor) {
float alpha = protocolor.hasAlpha()
? protocolor.getAlpha().getValue()
: 1.0;
return new java.awt.Color(
protocolor.getRed(),
protocolor.getGreen(),
protocolor.getBlue(),
alpha);
}
public static Color toProto(java.awt.Color color) {
float red = (float) color.getRed();
float green = (float) color.getGreen();
float blue = (float) color.getBlue();
float denominator = 255.0;
Color.Builder resultBuilder =
Color
.newBuilder()
.setRed(red / denominator)
.setGreen(green / denominator)
.setBlue(blue / denominator);
int alpha = color.getAlpha();
if (alpha != 255) {
result.setAlpha(
FloatValue
.newBuilder()
.setValue(((float) alpha) / denominator)
.build());
}
return resultBuilder.build();
}
// ...
Example (iOS / Obj-C):
// ...
static UIColor* fromProto(Color* protocolor) {
float red = [protocolor red];
float green = [protocolor green];
float blue = [protocolor blue];
FloatValue* alpha_wrapper = [protocolor alpha];
float alpha = 1.0;
if (alpha_wrapper != nil) {
alpha = [alpha_wrapper value];
}
return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
}
static Color* toProto(UIColor* color) {
CGFloat red, green, blue, alpha;
if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
return nil;
}
Color* result = [[Color alloc] init];
[result setRed:red];
[result setGreen:green];
[result setBlue:blue];
if (alpha <= 0.9999) {
[result setAlpha:floatWrapperWithValue(alpha)];
}
[result autorelease];
return result;
}
// ...
Example (JavaScript):
// ...
var protoToCssColor = function(rgb_color) {
var redFrac = rgb_color.red || 0.0;
var greenFrac = rgb_color.green || 0.0;
var blueFrac = rgb_color.blue || 0.0;
var red = Math.floor(redFrac * 255);
var green = Math.floor(greenFrac * 255);
var blue = Math.floor(blueFrac * 255);
if (!('alpha' in rgb_color)) {
return rgbToCssColor(red, green, blue);
}
var alphaFrac = rgb_color.alpha.value || 0.0;
var rgbParams = [red, green, blue].join(',');
return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
};
var rgbToCssColor = function(red, green, blue) {
var rgbNumber = new Number((red << 16) | (green << 8) | blue);
var hexString = rgbNumber.toString(16);
var missingZeros = 6 - hexString.length;
var resultBuilder = ['#'];
for (var i = 0; i < missingZeros; i++) {
resultBuilder.push('0');
}
resultBuilder.push(hexString);
return resultBuilder.join('');
};
// ...
JSON representation |
---|
{ "red": number, "green": number, "blue": number, "alpha": number } |
Fields | |
---|---|
red |
The amount of red in the color as a value in the interval [0, 1]. |
green |
The amount of green in the color as a value in the interval [0, 1]. |
blue |
The amount of blue in the color as a value in the interval [0, 1]. |
alpha |
The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation:
This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0). |
SwitchControl
Either a toggle-style switch or a checkbox.
JSON representation |
---|
{ "name": string, "value": string, "selected": boolean, "onChangeAction": { object ( |
Fields | |
---|---|
name |
The name of the switch widget that's used in |
value |
The value is what is passed back in the callback. |
selected |
If the switch is selected. |
onChangeAction |
The action when the switch state is changed. |
controlType |
The control type, either switch or checkbox. |
ControlType
The switch type shown in client.
Enums | |
---|---|
SWITCH |
A toggle-style switch. |
CHECKBOX |
Deprecated in favor of CHECK_BOX . |
CHECK_BOX |
A checkbox. |
ButtonList
A list of buttons layed out horizontally.
JSON representation |
---|
{
"buttons": [
{
object ( |
Fields | |
---|---|
buttons[] |
An array of buttons. |
TextInput
A text input is a UI item where users can input text. A text input can also have an onChange action and suggestions.
JSON representation |
---|
{ "name": string, "label": string, "hintText": string, "value": string, "type": enum ( |
Fields | |
---|---|
name |
The name of the text input which is used in |
label |
At least one of label and hintText must be specified. |
hintText |
The hint text. |
value |
The default value when there is no input from the user. |
type |
The style of the text, for example, a single line or multiple lines. |
onChangeAction |
The onChange action, for example, invoke a function. |
initialSuggestions |
The initial suggestions made before any user input. |
autoCompleteAction |
The refresh function that returns suggestions based on the user's input text. If the callback is not specified, autocomplete is done in client side based on the initial suggestion items. |
Type
The style of the text, for example, a single line or multiple lines.
Enums | |
---|---|
SINGLE_LINE |
The text is put into a single line. |
MULTIPLE_LINE |
The text is put into multiple lines. |
Suggestions
A container wrapping elements necessary for showing suggestion items used in text input autocomplete.
JSON representation |
---|
{
"items": [
{
object ( |
Fields | |
---|---|
items[] |
A list of suggestions used for autocomplete recommendations. |
SuggestionItem
A suggestion item.
JSON representation |
---|
{ "text": string } |
Fields | |
---|---|
text |
The suggested autocomplete result. |
SelectionInput
A widget that creates a UI item with options for users to select. For example, a dropdown menu.
JSON representation |
---|
{ "name": string, "label": string, "type": enum ( |
Fields | |
---|---|
name |
The name of the text input which is used in |
label |
The label displayed ahead of the switch control. |
type |
The type of the selection. |
items[] |
An array of the selected items. |
onChangeAction |
If specified, the form is submitted when the selection changes. If not specified, you must specify a separate button. |
SelectionType
The type of the selection.
Enums | |
---|---|
CHECK_BOX |
A checkbox. |
RADIO_BUTTON |
A radio button. |
SWITCH |
A switch. |
DROPDOWN |
A dropdown menu. |
SelectionItem
A selectable item in the switch control.
JSON representation |
---|
{ "text": string, "value": string, "selected": boolean } |
Fields | |
---|---|
text |
The text to be displayed. |
value |
The value associated with this item. The client should use this as a form input value. |
selected |
If more than one item is selected for |
DateTimePicker
The widget that lets users to specify a date and time. Not supported by Google Chat apps.
JSON representation |
---|
{ "name": string, "label": string, "type": enum ( |
Fields | |
---|---|
name |
The name of the text input that's used in |
label |
The label for the field that displays to the user. |
type |
The type of the date/time picker. |
valueMsEpoch |
The value to display as the default value before user input or previous user input. It is represented in milliseconds (Epoch time). For |
timezoneOffsetDate |
The number representing the time zone offset from UTC, in minutes. If set, the |
onChangeAction |
Triggered when the user clicks Save or Clear from the date/time picker dialog. This is only triggered if the value changed as a result of the Save/Clear operation. |
DateTimePickerType
The type of the date/time picker.
Enums | |
---|---|
DATE_AND_TIME |
The user can select a date and time. |
DATE_ONLY |
The user can only select a date. |
TIME_ONLY |
The user can only select a time. |
Divider
A divider that appears in between widgets.
Grid
Represents a Grid widget that displays items in a configurable grid layout.
JSON representation |
---|
{ "title": string, "items": [ { object ( |
Fields | |
---|---|
title |
The text that displays in the grid header. |
items[] |
The items to display in the grid. |
borderStyle |
The border style to apply to each grid item. |
columnCount |
The number of columns to display in the grid. A default value is used if this field isn't specified, and that default value is different depending on where the grid is shown (dialog versus companion). |
onClick |
This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters. |
GridItem
Represents a single item in the grid layout.
JSON representation |
---|
{ "id": string, "image": { object ( |
Fields | |
---|---|
id |
A user-specified identifier for this grid item. This identifier is returned in the parent Grid's onClick callback parameters. |
image |
The image that displays in the grid item. |
title |
The grid item's title. |
subtitle |
The grid item's subtitle. |
textAlignment |
The horizontal alignment of the grid item's text. |
layout |
The layout to use for the grid item. |
ImageComponent
Represents an image.
JSON representation |
---|
{ "imageUri": string, "altText": string, "cropStyle": { object ( |
Fields | |
---|---|
imageUri |
The image URL. |
altText |
The accessibility label for the image. |
cropStyle |
The crop style to apply to the image. |
borderStyle |
The border style to apply to the image. |
ImageCropStyle
Represents the crop style applied to an image.
JSON representation |
---|
{
"type": enum ( |
Fields | |
---|---|
type |
The crop type. |
aspectRatio |
The aspect ratio to use if the crop type is |
ImageCropType
Represents the crop style applied to an image.
Enums | |
---|---|
IMAGE_CROP_TYPE_UNSPECIFIED |
No value specified. |
SQUARE |
Applies a square crop. |
CIRCLE |
Applies a circular crop. |
RECTANGLE_CUSTOM |
Applies a rectangular crop with a custom aspect ratio. |
RECTANGLE_4_3 |
Applies a rectangular crop with a 4:3 aspect ratio. |
BorderStyle
Represents the complete border style applied to widgets.
JSON representation |
---|
{ "type": enum ( |
Fields | |
---|---|
type |
The border type. |
strokeColor |
The colors to use when the type is |
cornerRadius |
The corner radius for the border. |
BorderType
Represents the border types applied to widgets.
Enums | |
---|---|
BORDER_TYPE_UNSPECIFIED |
No value specified. |
NO_BORDER |
No border. |
STROKE |
Outline. |
HorizontalAlignment
The horizontal alignment determines the placement of the widget. By default, a widget is shown using alignment corresponding to the START
value, where START
corresponds to the left in left-to-right layouts, and the right in right-to-left layouts. The END
value corresponds to the right in left-to-right layouts, and the left in right-to-left layouts.
Enums | |
---|---|
HORIZONTAL_ALIGNMENT_UNSPECIFIED |
Unspecified alignment. |
START |
Alignment to the start position. |
CENTER |
Alignment to the center position. |
END |
Alignment to the end position. |
GridItemLayout
Represents the various layout options available for a grid item.
Enums | |
---|---|
GRID_ITEM_LAYOUT_UNSPECIFIED |
No layout specified. |
TEXT_BELOW |
The title and subtitle are shown below the grid item's image. |
TEXT_ABOVE |
The title and subtitle are shown above the grid item's image. |
CardAction
A card action is the action associated with the card. For example, an invoice card might include actions such as delete invoice, email invoice, or open the invoice in a browser.
JSON representation |
---|
{
"actionLabel": string,
"onClick": {
object ( |
Fields | |
---|---|
actionLabel |
The label that displays as the action menu item. |
onClick |
The |
DisplayStyle
Determines how a card is displayed.The default DisplayStyle
is REPLACE
.
Enums | |
---|---|
DISPLAY_STYLE_UNSPECIFIED |
Default value. Do not use. |
PEEK |
The header of the card appears at the bottom of the sidebar, partially covering the current top card of the stack. Clicking the header pops the card into the card stack. If the card has no header, a generated header is used instead. |
REPLACE |
The card is shown by replacing the view of the top card in the card stack. |
ActionStatus
Represents the status for a request to either invoke or submit a dialog.
JSON representation |
---|
{
"statusCode": enum ( |
Fields | |
---|---|
statusCode |
The status code. |
userFacingMessage |
The message to send users about the status of their request. If unset, a generic message based on the |
Code
The canonical error codes for gRPC APIs.
Sometimes multiple error codes may apply. Services should return the most specific error code that applies. For example, prefer OUT_OF_RANGE
over FAILED_PRECONDITION
if both codes apply. Similarly prefer NOT_FOUND
or ALREADY_EXISTS
over FAILED_PRECONDITION
.
Enums | |
---|---|
OK |
Not an error; returned on success HTTP Mapping: 200 OK |
CANCELLED |
The operation was cancelled, typically by the caller. HTTP Mapping: 499 Client Closed Request |
UNKNOWN |
Unknown error. For example, this error may be returned when a HTTP Mapping: 500 Internal Server Error |
INVALID_ARGUMENT |
The client specified an invalid argument. Note that this differs from HTTP Mapping: 400 Bad Request |
DEADLINE_EXCEEDED |
The deadline expired before the operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. HTTP Mapping: 504 Gateway Timeout |
NOT_FOUND |
Some requested entity (e.g., file or directory) was not found. Note to server developers: if a request is denied for an entire class of users, such as gradual feature rollout or undocumented allowlist, HTTP Mapping: 404 Not Found |
ALREADY_EXISTS |
The entity that a client attempted to create (e.g., file or directory) already exists. HTTP Mapping: 409 Conflict |
PERMISSION_DENIED |
The caller does not have permission to execute the specified operation. HTTP Mapping: 403 Forbidden |
UNAUTHENTICATED |
The request does not have valid authentication credentials for the operation. HTTP Mapping: 401 Unauthorized |
RESOURCE_EXHAUSTED |
Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. HTTP Mapping: 429 Too Many Requests |
FAILED_PRECONDITION |
The operation was rejected because the system is not in a state required for the operation's execution. For example, the directory to be deleted is non-empty, an rmdir operation is applied to a non-directory, etc. Service implementors can use the following guidelines to decide between HTTP Mapping: 400 Bad Request |
ABORTED |
The operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort. See the guidelines above for deciding between HTTP Mapping: 409 Conflict |
OUT_OF_RANGE |
The operation was attempted past the valid range. E.g., seeking or reading past end-of-file. Unlike There is a fair bit of overlap between HTTP Mapping: 400 Bad Request |
UNIMPLEMENTED |
The operation is not implemented or is not supported/enabled in this service. HTTP Mapping: 501 Not Implemented |
INTERNAL |
Internal errors. This means that some invariants expected by the underlying system have been broken. This error code is reserved for serious errors. HTTP Mapping: 500 Internal Server Error |
UNAVAILABLE |
The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent operations. See the guidelines above for deciding between HTTP Mapping: 503 Service Unavailable |
DATA_LOSS |
Unrecoverable data loss or corruption. HTTP Mapping: 500 Internal Server Error |
SlashCommand
A slash command in Google Chat.
JSON representation |
---|
{ "commandId": string } |
Fields | |
---|---|
commandId |
The id of the slash command invoked. |
MatchedUrl
A matched url in a Chat message. Chat apps can preview matched URLs. For more information, refer to Preview links.
JSON representation |
---|
{ "url": string } |
Fields | |
---|---|
url |
Output only. The url that was matched. |
Methods |
|
---|---|
|
Creates a message. |
|
Deletes a message. |
|
Returns a message. |
|
Updates a message. |