API Reference google_api_chat v0.30.0

Modules

API client metadata for GoogleApi.Chat.V1.

API calls for all endpoints tagged Dms.

API calls for all endpoints tagged Media.

API calls for all endpoints tagged Rooms.

API calls for all endpoints tagged Spaces.

Handle Tesla connections for GoogleApi.Chat.V1.

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.

Parameters that a bot can use to configure how it's response is posted.

ActionStatus represents status of a request from the bot developer's side. In specific, for each request a bot gets, the bot developer will set both fields below in relation to what the response status and message related to status should be.

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" } }]

An attachment in Google Chat.

A reference to the data of an attachment.

A button. Can be a text button or an image button.

A card is a UI element that can contain UI widgets such as texts, images.

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.

Attributes

  • imageStyle (type: String.t, default: nil) - The image's type (e.g. square border or circular border).
  • imageUrl (type: String.t, default: nil) - The URL of the image in the card header.
  • subtitle (type: String.t, default: nil) - The subtitle of the card header.
  • title (type: String.t, default: nil) - The title must be specified. The header has a fixed height: if both a title and subtitle is specified, each will take up 1 line. If only the title is specified, it will take up both lines.

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(''); }; // ...

Input Parameter for Date Picker widget.

Input Parameter for Date and Time Picker widget.

Wrapper around the card body of the dialog.

Contains dialog if present as well as the ActionStatus for the request sent from user.

A reference to the data of a drive attachment.

JSON payload of error messages. If the Cloud Logging API is enabled, these error messages are logged to Google Cloud Logging.

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); } The JSON representation for Empty is empty JSON object {}.

A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form.

An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form.

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.

Represents the complete border style applied to widgets.

A button. Can be a text button or an image button.

A list of buttons layed out horizontally.

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": "Heba Salam", "subtitle": "Software Engineer", "imageStyle": "ImageStyle.AVATAR", "imageUrl": "https://example.com/heba_salam.png", "imageAltText": "Avatar for Heba Salam" }, "sections" : [ { "header": "Contact Info", "widgets": [ { "decorated_text": { "icon": { "knownIcon": "EMAIL" }, "content": "heba.salam@example.com" } }, { "decoratedText": { "icon": { "knownIcon": "PERSON" }, "content": "Online" } }, { "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" }

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.

A persistent (sticky) footer that is added to the bottom of the card.

Attributes

  • imageAltText (type: String.t, default: nil) - The alternative text of this image which is used for accessibility.
  • imageType (type: String.t, default: nil) - The image's type.
  • imageUrl (type: String.t, default: nil) - The URL of the image in the card header.
  • subtitle (type: String.t, default: nil) - The subtitle of the card header.
  • title (type: String.t, default: nil) - The title of the card header. The title must be specified. 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.

The widget that lets users to specify a date and time.

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.

A divider that appears in between widgets.

Represents a Grid widget that displays items in a configurable grid layout.

Represents a single item in the grid layout.

Attributes

  • altText (type: String.t, default: nil) - The description of the icon, used for accessibility. The default value is provided if you don't specify one.
  • iconUrl (type: String.t, default: nil) - The icon specified by a URL.
  • imageType (type: String.t, default: nil) - The crop style applied to the image. In some cases, applying a CIRCLE crop causes the image to be drawn larger than a standard icon.
  • knownIcon (type: String.t, default: nil) - The icon specified by the string name of a list of known icons

An image that is specified by a URL and can have an onClick action.

Attributes

  • altText (type: String.t, default: nil) - The accessibility label for the image.
  • borderStyle (type: GoogleApi.Chat.V1.Model.GoogleAppsCardV1BorderStyle.t, default: nil) - The border style to apply to the image.
  • cropStyle (type: GoogleApi.Chat.V1.Model.GoogleAppsCardV1ImageCropStyle.t, default: nil) - The crop style to apply to the image.
  • imageUri (type: String.t, default: nil) - The image URL.

Represents the crop style applied to an image.

Attributes

  • action (type: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t, default: nil) - If specified, an action is triggered by this onClick.
  • card (type: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Card.t, default: nil) - A new card is pushed to the card stack after clicking if specified.
  • openDynamicLinkAction (type: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t, default: nil) - An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
  • openLink (type: GoogleApi.Chat.V1.Model.GoogleAppsCardV1OpenLink.t, default: nil) - If specified, this onClick triggers an open link action.

Attributes

  • onClose (type: String.t, default: nil) -
  • openAs (type: String.t, default: nil) -
  • url (type: String.t, default: nil) - The URL to open.

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.

A widget that creates a UI item (for example, a drop-down list) with options for users to select.

The item in the switch control. A radio button, at most one of the items is selected.

A suggestion item. Only supports text for now.

A container wrapping elements necessary for showing suggestion items used in text input autocomplete.

Attributes

  • controlType (type: String.t, default: nil) - The control type, either switch or checkbox.
  • name (type: String.t, default: nil) - The name of the switch widget that's used in formInput.
  • onChangeAction (type: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t, default: nil) - The action when the switch state is changed.
  • selected (type: boolean(), default: nil) - If the switch is selected.
  • value (type: String.t, default: nil) - The value is what is passed back in the callback.

A text input is a UI item where users can input text. A text input can also have an onChange action and suggestions.

A paragraph of text that supports formatting. See Text formatting for details.

A widget is a UI element that presents texts, images, etc.

An image that is specified by a URL and can have an onclick action.

An image button with an onclick action.

The inputs with widgets.

A UI element contains a key (label) and a value (content). And this element may also contain some actions such as onclick button.

Attributes

  • memberships (type: list(GoogleApi.Chat.V1.Model.Membership.t), default: nil) - List of memberships in the requested (or first) page.
  • nextPageToken (type: String.t, default: nil) - Continuation token to retrieve the next page of results. It will be empty for the last page of results.

Attributes

  • nextPageToken (type: String.t, default: nil) - Continuation token to retrieve the next page of results. It will be empty for the last page of results. Tokens expire in an hour. An error is thrown if an expired token is passed.
  • spaces (type: list(GoogleApi.Chat.V1.Model.Space.t), default: nil) - List of spaces in the requested (or first) page.

Represents a membership relation in Google Chat.

A message in Google Chat.

An onclick action (e.g. open a link).

A link that opens a new window.

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).

A Slash Command in Chat.

Annotation metadata for slash commands (/).

A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat bot.

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.

Input parameter for regular widgets. For single-valued widgets, it will be a single value list; for multi-valued widgets, such as checkbox, all the values are presented.

A button with text and onclick action.

A paragraph of text. Formatted text supported.

A thread in Google Chat.

Input Parameter for Time Picker widget.

The timezone id and offset. The id is the tz database time zones such as "America/Toronto". The user timezone offset, in milliseconds, from Coordinated Universal Time (UTC).

A user in Google Chat.

Annotation metadata for user mentions (@).

A widget is a UI element that presents texts, images, etc.