Namespace Google.Apis.HangoutsChat.v1.Data
Classes
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.
ActionResponse
Parameters that a Chat app can use to configure how it's response is posted.
ActionStatus
Represents the status for a request to either invoke or submit a dialog.
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" } }]
Attachment
An attachment in Google Chat.
AttachmentDataRef
Button
A button. Can be a text button or an image button.
Card
A card is a UI element that can contain UI widgets such as texts, images.
CardAction
A card action is the action associated with the card. For an invoice card, a typical action would be: delete invoice, email invoice or open the invoice in browser. Not supported by Google Chat apps.
CardHeader
CardWithId
Widgets for Chat apps to specify.
ChatAppLogEntry
JSON payload of error messages. If the Cloud Logging API is enabled, these error messages are logged to Google Cloud Logging.
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(''); }; // ...
CommonEventObject
Represents information about the user's client, such as locale, host app, and platform. For Chat apps,
CommonEventObject
includes data submitted by users interacting with cards, like data entered in
dialogs.
DateInput
Date input values. Not supported by Chat apps.
DateTimeInput
Date and time input values. Not supported by Chat apps.
DeprecatedEvent
Google Chat events.
Dialog
Wrapper around the card body of the dialog.
DialogAction
Contains a dialog and request status code.
DriveDataRef
A reference to the data of a drive attachment.
Empty
A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
FormAction
A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form.
GoogleAppsCardV1Action
An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form.
GoogleAppsCardV1ActionParameter
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. To learn more, see CommonEventObject.
GoogleAppsCardV1BorderStyle
Represents the complete border style applied to items in a widget.
GoogleAppsCardV1Button
A text, icon, or text + icon button that users can click. To make an image a clickable button, specify an Image
(not an ImageComponent) and set an onClick
action. Currently supported in Chat apps (including dialogs and card messages) and Google Workspace Add-ons.
GoogleAppsCardV1ButtonList
A list of buttons layed out horizontally.
GoogleAppsCardV1Card
Cards support a defined layout, interactive UI elements like buttons, and rich media like images. Use cards to
present detailed information, gather information from users, and guide users to take a next step. In Google
Chat, cards appear in several places: - As stand-alone messages. - Accompanying a text message, just beneath the
text message. - As a dialog. The following example JSON
creates a "contact card" that features: - A header with the contact's name, job title, avatar picture. - A
section with the contact information, including formatted text. - Buttons that users can click to share the
contact or see more or less info.
{ "cardsV2": [ { "cardId":
"unique-card-id", "card": { "header": { "title": "Sasha", "subtitle": "Software Engineer", "imageUrl":
"https://developers.google.com/chat/images/quickstart-app-avatar.png", "imageType": "CIRCLE", "imageAltText":
"Avatar for Sasha", }, "sections": [ { "header": "Contact Info", "collapsible": true,
"uncollapsibleWidgetsCount": 1, "widgets": [ { "decoratedText": { "startIcon": { "knownIcon": "EMAIL", },
"text": "sasha@example.com", } }, { "decoratedText": { "startIcon": { "knownIcon": "PERSON", }, "text":
"Online", }, }, { "decoratedText": { "startIcon": { "knownIcon": "PHONE", }, "text": "+1 (555) 555-1234", } }, {
"buttonList": { "buttons": [ { "text": "Share", "onClick": { "openLink": { "url": "https://example.com/share", }
} }, { "text": "Edit", "onClick": { "action": { "function": "goToView", "parameters": [ { "key": "viewType",
"value": "EDIT", } ], } } }, ], } }, ], }, ], }, } ], }
GoogleAppsCardV1CardAction
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. Not supported by Chat apps.
GoogleAppsCardV1CardFixedFooter
A persistent (sticky) footer that that appears at the bottom of the card. Setting fixedFooter
without
specifying a primaryButton
or a secondaryButton
causes an error. Chat apps support fixedFooter
in
dialogs, but not in card
messages.
GoogleAppsCardV1CardHeader
Represents a card header.
GoogleAppsCardV1DateTimePicker
Lets users specify a date, a time, or both a date and a time. Accepts text input from users, but features an interactive date and time selector that helps users enter correctly-formatted dates and times. If users enter a date or time incorrectly, the widget shows an error that prompts users to enter the correct format. Not supported by Chat apps. Support by Chat apps coming soon.
GoogleAppsCardV1DecoratedText
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.
GoogleAppsCardV1Divider
Displays a divider between widgets, a horizontal line. For example, the following JSON creates a divider: "divider": { }
GoogleAppsCardV1Grid
Displays a grid with a collection of items. A grid supports any number of columns and items. The number of rows
is determined by items divided by columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items
and 2 columns has 6 rows. Currently supported in dialogs.
Support for card messages is coming soon.
For example, the following JSON creates a 2 column grid with a single item: "grid": { "title": "A fine
collection of items", "numColumns": 2, "borderStyle": { "type": "STROKE", "cornerRadius": 4.0 }, "items": [
"image": { "imageUri": "https://www.example.com/image.png", "cropStyle": { "type": "SQUARE" }, "borderStyle": {
"type": "STROKE" } }, "title": "An item", "textAlignment": "CENTER" ], "onClick": { "openLink": {
"url":"https://www.example.com" } } }
GoogleAppsCardV1GridItem
Represents a single item in the grid layout.
GoogleAppsCardV1Icon
An icon displayed in a widget on a card. Supports standard and custom icons.
GoogleAppsCardV1Image
An image that is specified by a URL and can have an onClick
action.
GoogleAppsCardV1ImageComponent
Represents an image.
GoogleAppsCardV1ImageCropStyle
Represents the crop style applied to an image. For example, here's how to apply a 16 by 9 aspect ratio: cropStyle { "type": "RECTANGLE_CUSTOM", "aspectRatio": 16/9 }
GoogleAppsCardV1OnClick
Represents how to respond when users click an interactive element on a card, such as a button.
GoogleAppsCardV1OpenLink
Represents an onClick
event that opens a hyperlink.
GoogleAppsCardV1Section
A section contains a collection of widgets that are rendered vertically in the order that they are specified.
GoogleAppsCardV1SelectionInput
A widget that creates a UI item with options for users to select. For example, a dropdown menu or check list. Chat apps receive and can process the value of entered text during form input events. For details about working with form inputs, see Receive form data. When you need to collect data from users that matches options you set, use a selection input. To collect abstract data from users, use the text input widget instead. Only supported in dialogs. Support for card messages coming soon.
GoogleAppsCardV1SelectionItem
A selectable item in a selection input, such as a check box or a switch.
GoogleAppsCardV1SuggestionItem
One suggested value that users can enter in a text input field.
GoogleAppsCardV1Suggestions
Suggested values that users can enter. These values appear when users click inside the text input field. As
users type, the suggested values dynamically filter to match what the users have typed. For example, a text
input field for programming language might suggest Java, JavaScript, Python, and C++. When users start typing
"Jav", the list of suggestions filters to show just Java and JavaScript. Suggested values help guide users to
enter values that your app can make sense of. When referring to JavaScript, some users might enter "javascript"
and others "java script". Suggesting "JavaScript" can standardize how users interact with your app. When
specified, TextInput.type
is always SINGLE_LINE
, even if it is set to MULTIPLE_LINE
.
GoogleAppsCardV1SwitchControl
Either a toggle-style switch or a checkbox inside a decoratedText
widget. Only supported on the
decoratedText
widget. Currently supported in dialogs.
Support for card messages is coming soon.
GoogleAppsCardV1TextInput
A field in which users can enter text. Supports suggestions and on-change actions. Chat apps receive and can process the value of entered text during form input events. For details about working with form inputs, see Receive form data. When you need to collect abstract data from users, use a text input. To collect defined data from users, use the selection input widget instead. Only supported in dialogs. Support for card messages coming soon.
GoogleAppsCardV1TextParagraph
A paragraph of text that supports formatting. See Text formatting for details.
GoogleAppsCardV1Widget
Each card is made up of widgets. A widget is a composite object that can represent one of text, images, buttons, and other object types.
Image
An image that is specified by a URL and can have an onclick action.
ImageButton
An image button with an onclick action.
Inputs
Types of data inputs for widgets. Users enter data with these inputs.
KeyValue
A UI element contains a key (label) and a value (content). And this element may also contain some actions such as onclick button.
ListMembershipsResponse
ListSpacesResponse
MatchedUrl
A matched url in a Chat message. Chat apps can preview matched URLs. For more information, refer to Preview links.
Media
Media resource.
Membership
Represents a membership relation in Google Chat, such as whether a user or Chat app is invited to, part of, or absent from a space.
Message
A message in Google Chat.
OnClick
An onclick action (e.g. open a link).
OpenLink
A link that opens a new window.
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 (e.g. float).
SlashCommand
A slash command in Google Chat.
SlashCommandMetadata
Annotation metadata for slash commands (/).
Space
A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.
SpaceDetails
Details about the space including description and rules.
Status
The Status
type defines a logical error model that is suitable for different programming environments,
including REST APIs and RPC APIs. It is used by gRPC. Each Status
message contains
three pieces of data: error code, error message, and error details. You can find out more about this error model
and how to work with it in the API Design Guide.
StringInputs
Input parameter for regular widgets. For single-valued widgets, it is a single value list. For multi-valued widgets, such as checkbox, all the values are presented.
TextButton
A button with text and onclick action.
TextParagraph
A paragraph of text. Formatted text supported.
Thread
A thread in Google Chat.
TimeInput
Time input values. Not supported by Chat apps.
TimeZone
The timezone ID and offset from Coordinated Universal Time (UTC). Not supported by Chat apps.
User
A user in Google Chat.
UserMentionMetadata
Annotation metadata for user mentions (@).
WidgetMarkup
A widget is a UI element that presents texts, images, etc.