blob: 7cf1d27e5f150da5ce3cfa3ebbf0cb8d0c3703d0 [file] [log] [blame]
{
"basePath": "",
"baseUrl": "https://chat.googleapis.com/",
"batchPath": "batch",
"canonicalName": "Hangouts Chat",
"description": "Enables apps to fetch information and perform actions in Google Chat. Authentication using a service account is a prerequisite for using the Google Chat REST API.",
"discoveryVersion": "v1",
"documentationLink": "https://developers.google.com/hangouts/chat",
"fullyEncodeReservedExpansion": true,
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"id": "chat:v1",
"kind": "discovery#restDescription",
"mtlsRootUrl": "https://chat.mtls.googleapis.com/",
"name": "chat",
"ownerDomain": "google.com",
"ownerName": "Google",
"parameters": {
"$.xgafv": {
"description": "V1 error format.",
"enum": [
"1",
"2"
],
"enumDescriptions": [
"v1 error format",
"v2 error format"
],
"location": "query",
"type": "string"
},
"access_token": {
"description": "OAuth access token.",
"location": "query",
"type": "string"
},
"alt": {
"default": "json",
"description": "Data format for response.",
"enum": [
"json",
"media",
"proto"
],
"enumDescriptions": [
"Responses with Content-Type of application/json",
"Media download with context-dependent Content-Type",
"Responses with Content-Type of application/x-protobuf"
],
"location": "query",
"type": "string"
},
"callback": {
"description": "JSONP",
"location": "query",
"type": "string"
},
"fields": {
"description": "Selector specifying which fields to include in a partial response.",
"location": "query",
"type": "string"
},
"key": {
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query",
"type": "string"
},
"oauth_token": {
"description": "OAuth 2.0 token for the current user.",
"location": "query",
"type": "string"
},
"prettyPrint": {
"default": "true",
"description": "Returns response with indentations and line breaks.",
"location": "query",
"type": "boolean"
},
"quotaUser": {
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"location": "query",
"type": "string"
},
"uploadType": {
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"location": "query",
"type": "string"
},
"upload_protocol": {
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"location": "query",
"type": "string"
}
},
"protocol": "rest",
"resources": {
"dms": {
"methods": {
"messages": {
"description": "Legacy path for creating message. Calling these will result in a BadRequest response.",
"flatPath": "v1/dms/{dmsId}/messages",
"httpMethod": "POST",
"id": "chat.dms.messages",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "Required. Space resource name, in the form \"spaces/*\". Example: spaces/AAAAAAAAAAA",
"location": "path",
"pattern": "^dms/[^/]+$",
"required": true,
"type": "string"
},
"requestId": {
"description": "Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.",
"location": "query",
"type": "string"
},
"threadKey": {
"description": "Optional. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.",
"location": "query",
"type": "string"
}
},
"path": "v1/{+parent}/messages",
"request": {
"$ref": "Message"
},
"response": {
"$ref": "Message"
}
},
"webhooks": {
"description": "Legacy path for creating message. Calling these will result in a BadRequest response.",
"flatPath": "v1/dms/{dmsId}/webhooks",
"httpMethod": "POST",
"id": "chat.dms.webhooks",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "Required. Space resource name, in the form \"spaces/*\". Example: spaces/AAAAAAAAAAA",
"location": "path",
"pattern": "^dms/[^/]+$",
"required": true,
"type": "string"
},
"requestId": {
"description": "Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.",
"location": "query",
"type": "string"
},
"threadKey": {
"description": "Optional. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.",
"location": "query",
"type": "string"
}
},
"path": "v1/{+parent}/webhooks",
"request": {
"$ref": "Message"
},
"response": {
"$ref": "Message"
}
}
},
"resources": {
"conversations": {
"methods": {
"messages": {
"description": "Legacy path for creating message. Calling these will result in a BadRequest response.",
"flatPath": "v1/dms/{dmsId}/conversations/{conversationsId}/messages",
"httpMethod": "POST",
"id": "chat.dms.conversations.messages",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "Required. Space resource name, in the form \"spaces/*\". Example: spaces/AAAAAAAAAAA",
"location": "path",
"pattern": "^dms/[^/]+/conversations/[^/]+$",
"required": true,
"type": "string"
},
"requestId": {
"description": "Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.",
"location": "query",
"type": "string"
},
"threadKey": {
"description": "Optional. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.",
"location": "query",
"type": "string"
}
},
"path": "v1/{+parent}/messages",
"request": {
"$ref": "Message"
},
"response": {
"$ref": "Message"
}
}
}
}
}
},
"media": {
"methods": {
"download": {
"description": "Downloads media. Download is supported on the URI `/v1/media/{+name}?alt=media`.",
"flatPath": "v1/media/{mediaId}",
"httpMethod": "GET",
"id": "chat.media.download",
"parameterOrder": [
"resourceName"
],
"parameters": {
"resourceName": {
"description": "Name of the media that is being downloaded. See ReadRequest.resource_name.",
"location": "path",
"pattern": "^.*$",
"required": true,
"type": "string"
}
},
"path": "v1/media/{+resourceName}",
"response": {
"$ref": "Media"
},
"supportsMediaDownload": true
}
}
},
"rooms": {
"methods": {
"messages": {
"description": "Legacy path for creating message. Calling these will result in a BadRequest response.",
"flatPath": "v1/rooms/{roomsId}/messages",
"httpMethod": "POST",
"id": "chat.rooms.messages",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "Required. Space resource name, in the form \"spaces/*\". Example: spaces/AAAAAAAAAAA",
"location": "path",
"pattern": "^rooms/[^/]+$",
"required": true,
"type": "string"
},
"requestId": {
"description": "Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.",
"location": "query",
"type": "string"
},
"threadKey": {
"description": "Optional. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.",
"location": "query",
"type": "string"
}
},
"path": "v1/{+parent}/messages",
"request": {
"$ref": "Message"
},
"response": {
"$ref": "Message"
}
},
"webhooks": {
"description": "Legacy path for creating message. Calling these will result in a BadRequest response.",
"flatPath": "v1/rooms/{roomsId}/webhooks",
"httpMethod": "POST",
"id": "chat.rooms.webhooks",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "Required. Space resource name, in the form \"spaces/*\". Example: spaces/AAAAAAAAAAA",
"location": "path",
"pattern": "^rooms/[^/]+$",
"required": true,
"type": "string"
},
"requestId": {
"description": "Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.",
"location": "query",
"type": "string"
},
"threadKey": {
"description": "Optional. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.",
"location": "query",
"type": "string"
}
},
"path": "v1/{+parent}/webhooks",
"request": {
"$ref": "Message"
},
"response": {
"$ref": "Message"
}
}
},
"resources": {
"conversations": {
"methods": {
"messages": {
"description": "Legacy path for creating message. Calling these will result in a BadRequest response.",
"flatPath": "v1/rooms/{roomsId}/conversations/{conversationsId}/messages",
"httpMethod": "POST",
"id": "chat.rooms.conversations.messages",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "Required. Space resource name, in the form \"spaces/*\". Example: spaces/AAAAAAAAAAA",
"location": "path",
"pattern": "^rooms/[^/]+/conversations/[^/]+$",
"required": true,
"type": "string"
},
"requestId": {
"description": "Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.",
"location": "query",
"type": "string"
},
"threadKey": {
"description": "Optional. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.",
"location": "query",
"type": "string"
}
},
"path": "v1/{+parent}/messages",
"request": {
"$ref": "Message"
},
"response": {
"$ref": "Message"
}
}
}
}
}
},
"spaces": {
"methods": {
"get": {
"description": "Returns a space. Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).",
"flatPath": "v1/spaces/{spacesId}",
"httpMethod": "GET",
"id": "chat.spaces.get",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Resource name of the space, in the form \"spaces/*\". Example: spaces/AAAAAAAAAAAA",
"location": "path",
"pattern": "^spaces/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Space"
}
},
"list": {
"description": "Lists spaces the caller is a member of. Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).",
"flatPath": "v1/spaces",
"httpMethod": "GET",
"id": "chat.spaces.list",
"parameterOrder": [],
"parameters": {
"pageSize": {
"description": "Requested page size. The value is capped at 1000. Server may return fewer results than requested. If unspecified, server will default to 100.",
"format": "int32",
"location": "query",
"type": "integer"
},
"pageToken": {
"description": "A token identifying a page of results the server should return.",
"location": "query",
"type": "string"
}
},
"path": "v1/spaces",
"response": {
"$ref": "ListSpacesResponse"
}
},
"webhooks": {
"description": "Legacy path for creating message. Calling these will result in a BadRequest response.",
"flatPath": "v1/spaces/{spacesId}/webhooks",
"httpMethod": "POST",
"id": "chat.spaces.webhooks",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "Required. Space resource name, in the form \"spaces/*\". Example: spaces/AAAAAAAAAAA",
"location": "path",
"pattern": "^spaces/[^/]+$",
"required": true,
"type": "string"
},
"requestId": {
"description": "Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.",
"location": "query",
"type": "string"
},
"threadKey": {
"description": "Optional. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.",
"location": "query",
"type": "string"
}
},
"path": "v1/{+parent}/webhooks",
"request": {
"$ref": "Message"
},
"response": {
"$ref": "Message"
}
}
},
"resources": {
"members": {
"methods": {
"get": {
"description": "Returns a membership. Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).",
"flatPath": "v1/spaces/{spacesId}/members/{membersId}",
"httpMethod": "GET",
"id": "chat.spaces.members.get",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Resource name of the membership to be retrieved, in the form \"spaces/*/members/*\". Example: spaces/AAAAAAAAAAAA/members/111111111111111111111",
"location": "path",
"pattern": "^spaces/[^/]+/members/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Membership"
}
},
"list": {
"description": "Lists human memberships in a space. Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).",
"flatPath": "v1/spaces/{spacesId}/members",
"httpMethod": "GET",
"id": "chat.spaces.members.list",
"parameterOrder": [
"parent"
],
"parameters": {
"pageSize": {
"description": "Requested page size. The value is capped at 1000. Server may return fewer results than requested. If unspecified, server will default to 100.",
"format": "int32",
"location": "query",
"type": "integer"
},
"pageToken": {
"description": "A token identifying a page of results the server should return.",
"location": "query",
"type": "string"
},
"parent": {
"description": "Required. The resource name of the space for which membership list is to be fetched, in the form \"spaces/*\". Example: spaces/AAAAAAAAAAAA",
"location": "path",
"pattern": "^spaces/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+parent}/members",
"response": {
"$ref": "ListMembershipsResponse"
}
}
}
},
"messages": {
"methods": {
"create": {
"description": "Creates a message. Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).",
"flatPath": "v1/spaces/{spacesId}/messages",
"httpMethod": "POST",
"id": "chat.spaces.messages.create",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "Required. Space resource name, in the form \"spaces/*\". Example: spaces/AAAAAAAAAAA",
"location": "path",
"pattern": "^spaces/[^/]+$",
"required": true,
"type": "string"
},
"requestId": {
"description": "Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.",
"location": "query",
"type": "string"
},
"threadKey": {
"description": "Optional. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.",
"location": "query",
"type": "string"
}
},
"path": "v1/{+parent}/messages",
"request": {
"$ref": "Message"
},
"response": {
"$ref": "Message"
}
},
"delete": {
"description": "Deletes a message. Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).",
"flatPath": "v1/spaces/{spacesId}/messages/{messagesId}",
"httpMethod": "DELETE",
"id": "chat.spaces.messages.delete",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Resource name of the message to be deleted, in the form \"spaces/*/messages/*\" Example: spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB",
"location": "path",
"pattern": "^spaces/[^/]+/messages/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Empty"
}
},
"get": {
"description": "Returns a message. Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).",
"flatPath": "v1/spaces/{spacesId}/messages/{messagesId}",
"httpMethod": "GET",
"id": "chat.spaces.messages.get",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Resource name of the message to be retrieved, in the form \"spaces/*/messages/*\". Example: spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB",
"location": "path",
"pattern": "^spaces/[^/]+/messages/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Message"
}
},
"update": {
"description": "Updates a message. Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).",
"flatPath": "v1/spaces/{spacesId}/messages/{messagesId}",
"httpMethod": "PUT",
"id": "chat.spaces.messages.update",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`",
"location": "path",
"pattern": "^spaces/[^/]+/messages/[^/]+$",
"required": true,
"type": "string"
},
"updateMask": {
"description": "Required. The field paths to be updated, comma separated if there are multiple. Currently supported field paths: * text * cards * attachment",
"format": "google-fieldmask",
"location": "query",
"type": "string"
}
},
"path": "v1/{+name}",
"request": {
"$ref": "Message"
},
"response": {
"$ref": "Message"
}
}
},
"resources": {
"attachments": {
"methods": {
"get": {
"description": "Gets the metadata of a message attachment. The attachment data is fetched using the media API. Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).",
"flatPath": "v1/spaces/{spacesId}/messages/{messagesId}/attachments/{attachmentsId}",
"httpMethod": "GET",
"id": "chat.spaces.messages.attachments.get",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Resource name of the attachment, in the form \"spaces/*/messages/*/attachments/*\".",
"location": "path",
"pattern": "^spaces/[^/]+/messages/[^/]+/attachments/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Attachment"
}
}
}
}
}
}
}
}
},
"revision": "20220422",
"rootUrl": "https://chat.googleapis.com/",
"schemas": {
"ActionParameter": {
"description": "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.",
"id": "ActionParameter",
"properties": {
"key": {
"description": "The name of the parameter for the action script.",
"type": "string"
},
"value": {
"description": "The value of the parameter.",
"type": "string"
}
},
"type": "object"
},
"ActionResponse": {
"description": "Parameters that a Chat app can use to configure how it's response is posted.",
"id": "ActionResponse",
"properties": {
"dialogAction": {
"$ref": "DialogAction",
"description": "Input only. A response to an event related to a [dialog](https://developers.google.com/chat/how-tos/dialogs). Must be accompanied by `ResponseType.Dialog`."
},
"type": {
"description": "Input only. The type of Chat app response.",
"enum": [
"TYPE_UNSPECIFIED",
"NEW_MESSAGE",
"UPDATE_MESSAGE",
"UPDATE_USER_MESSAGE_CARDS",
"REQUEST_CONFIG",
"DIALOG"
],
"enumDescriptions": [
"Default type; will be handled as NEW_MESSAGE.",
"Post as a new message in the topic.",
"Update the Chat app's message. This is only permitted on a CARD_CLICKED event where the message sender type is BOT.",
"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.",
"Privately ask the user for additional auth or config.",
"Presents a [dialog](https://developers.google.com/chat/how-tos/dialogs)."
],
"type": "string"
},
"url": {
"description": "Input only. URL for users to auth or config. (Only for REQUEST_CONFIG response types.)",
"type": "string"
}
},
"type": "object"
},
"ActionStatus": {
"description": "Represents the status for a request to either invoke or submit a [dialog](https://developers.google.com/chat/how-tos/dialogs).",
"id": "ActionStatus",
"properties": {
"statusCode": {
"description": "The status code.",
"enum": [
"OK",
"CANCELLED",
"UNKNOWN",
"INVALID_ARGUMENT",
"DEADLINE_EXCEEDED",
"NOT_FOUND",
"ALREADY_EXISTS",
"PERMISSION_DENIED",
"UNAUTHENTICATED",
"RESOURCE_EXHAUSTED",
"FAILED_PRECONDITION",
"ABORTED",
"OUT_OF_RANGE",
"UNIMPLEMENTED",
"INTERNAL",
"UNAVAILABLE",
"DATA_LOSS"
],
"enumDescriptions": [
"Not an error; returned on success HTTP Mapping: 200 OK",
"The operation was cancelled, typically by the caller. HTTP Mapping: 499 Client Closed Request",
"Unknown error. For example, this error may be returned when a `Status` value received from another address space belongs to an error space that is not known in this address space. Also errors raised by APIs that do not return enough error information may be converted to this error. HTTP Mapping: 500 Internal Server Error",
"The client specified an invalid argument. Note that this differs from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments that are problematic regardless of the state of the system (e.g., a malformed file name). HTTP Mapping: 400 Bad Request",
"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",
"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, `NOT_FOUND` may be used. If a request is denied for some users within a class of users, such as user-based access control, `PERMISSION_DENIED` must be used. HTTP Mapping: 404 Not Found",
"The entity that a client attempted to create (e.g., file or directory) already exists. HTTP Mapping: 409 Conflict",
"The caller does not have permission to execute the specified operation. `PERMISSION_DENIED` must not be used for rejections caused by exhausting some resource (use `RESOURCE_EXHAUSTED` instead for those errors). `PERMISSION_DENIED` must not be used if the caller can not be identified (use `UNAUTHENTICATED` instead for those errors). This error code does not imply the request is valid or the requested entity exists or satisfies other pre-conditions. HTTP Mapping: 403 Forbidden",
"The request does not have valid authentication credentials for the operation. HTTP Mapping: 401 Unauthorized",
"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",
"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 `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: (a) Use `UNAVAILABLE` if the client can retry just the failing call. (b) Use `ABORTED` if the client should retry at a higher level. For example, when a client-specified test-and-set fails, indicating the client should restart a read-modify-write sequence. (c) Use `FAILED_PRECONDITION` if the client should not retry until the system state has been explicitly fixed. For example, if an \"rmdir\" fails because the directory is non-empty, `FAILED_PRECONDITION` should be returned since the client should not retry unless the files are deleted from the directory. HTTP Mapping: 400 Bad Request",
"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 `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`. HTTP Mapping: 409 Conflict",
"The operation was attempted past the valid range. E.g., seeking or reading past end-of-file. Unlike `INVALID_ARGUMENT`, this error indicates a problem that may be fixed if the system state changes. For example, a 32-bit file system will generate `INVALID_ARGUMENT` if asked to read at an offset that is not in the range [0,2^32-1], but it will generate `OUT_OF_RANGE` if asked to read from an offset past the current file size. There is a fair bit of overlap between `FAILED_PRECONDITION` and `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific error) when it applies so that callers who are iterating through a space can easily look for an `OUT_OF_RANGE` error to detect when they are done. HTTP Mapping: 400 Bad Request",
"The operation is not implemented or is not supported/enabled in this service. HTTP Mapping: 501 Not Implemented",
"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",
"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 `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`. HTTP Mapping: 503 Service Unavailable",
"Unrecoverable data loss or corruption. HTTP Mapping: 500 Internal Server Error"
],
"type": "string"
},
"userFacingMessage": {
"description": "The message to send users about the status of their request. If unset, a generic message based on the `status_code` is sent.",
"type": "string"
}
},
"type": "object"
},
"Annotation": {
"description": "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\" } }] ```",
"id": "Annotation",
"properties": {
"length": {
"description": "Length of the substring in the plain-text message body this annotation corresponds to.",
"format": "int32",
"type": "integer"
},
"slashCommand": {
"$ref": "SlashCommandMetadata",
"description": "The metadata for a slash command."
},
"startIndex": {
"description": "Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.",
"format": "int32",
"type": "integer"
},
"type": {
"description": "The type of this annotation.",
"enum": [
"ANNOTATION_TYPE_UNSPECIFIED",
"USER_MENTION",
"SLASH_COMMAND"
],
"enumDescriptions": [
"Default value for the enum. DO NOT USE.",
"A user is mentioned.",
"A slash command is invoked."
],
"type": "string"
},
"userMention": {
"$ref": "UserMentionMetadata",
"description": "The metadata of user mention."
}
},
"type": "object"
},
"Attachment": {
"description": "An attachment in Google Chat.",
"id": "Attachment",
"properties": {
"attachmentDataRef": {
"$ref": "AttachmentDataRef",
"description": "A reference to the attachment data. This is used with the media API to download the attachment data."
},
"contentName": {
"description": "The original file name for the content, not the full path.",
"type": "string"
},
"contentType": {
"description": "The content type (MIME type) of the file.",
"type": "string"
},
"downloadUri": {
"description": "Output only. The download URL which should be used to allow a human user to download the attachment. Chat apps should not use this URL to download attachment content.",
"readOnly": true,
"type": "string"
},
"driveDataRef": {
"$ref": "DriveDataRef",
"description": "A reference to the drive attachment. This is used with the Drive API."
},
"name": {
"description": "Resource name of the attachment, in the form \"spaces/*/messages/*/attachments/*\".",
"type": "string"
},
"source": {
"description": "The source of the attachment.",
"enum": [
"SOURCE_UNSPECIFIED",
"DRIVE_FILE",
"UPLOADED_CONTENT"
],
"enumDescriptions": [
"",
"",
""
],
"type": "string"
},
"thumbnailUri": {
"description": "Output only. The thumbnail URL which should be used to preview the attachment to a human user. Chat apps should not use this URL to download attachment content.",
"readOnly": true,
"type": "string"
}
},
"type": "object"
},
"AttachmentDataRef": {
"description": "A reference to the data of an attachment.",
"id": "AttachmentDataRef",
"properties": {
"resourceName": {
"description": "The resource name of the attachment data. This is used with the media API to download the attachment data.",
"type": "string"
}
},
"type": "object"
},
"Button": {
"description": "A button. Can be a text button or an image button.",
"id": "Button",
"properties": {
"imageButton": {
"$ref": "ImageButton",
"description": "A button with image and onclick action."
},
"textButton": {
"$ref": "TextButton",
"description": "A button with text and onclick action."
}
},
"type": "object"
},
"Card": {
"description": "A card is a UI element that can contain UI widgets such as texts, images.",
"id": "Card",
"properties": {
"cardActions": {
"description": "The actions of this card.",
"items": {
"$ref": "CardAction"
},
"type": "array"
},
"header": {
"$ref": "CardHeader",
"description": "The header of the card. A header usually contains a title and an image."
},
"name": {
"description": "Name of the card.",
"type": "string"
},
"sections": {
"description": "Sections are separated by a line divider.",
"items": {
"$ref": "Section"
},
"type": "array"
}
},
"type": "object"
},
"CardAction": {
"description": "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.",
"id": "CardAction",
"properties": {
"actionLabel": {
"description": "The label used to be displayed in the action menu item.",
"type": "string"
},
"onClick": {
"$ref": "OnClick",
"description": "The onclick action for this action item."
}
},
"type": "object"
},
"CardHeader": {
"id": "CardHeader",
"properties": {
"imageStyle": {
"description": "The image's type (e.g. square border or circular border).",
"enum": [
"IMAGE_STYLE_UNSPECIFIED",
"IMAGE",
"AVATAR"
],
"enumDescriptions": [
"",
"Square border.",
"Circular border."
],
"type": "string"
},
"imageUrl": {
"description": "The URL of the image in the card header.",
"type": "string"
},
"subtitle": {
"description": "The subtitle of the card header.",
"type": "string"
},
"title": {
"description": "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.",
"type": "string"
}
},
"type": "object"
},
"ChatAppLogEntry": {
"description": "JSON payload of error messages. If the Cloud Logging API is enabled, these error messages are logged to [Google Cloud Logging](https://cloud.google.com/logging/docs).",
"id": "ChatAppLogEntry",
"properties": {
"deployment": {
"description": "The deployment that caused the error. For Chat bots built in Apps Script, this is the deployment ID defined by Apps Script.",
"type": "string"
},
"deploymentFunction": {
"description": "The unencrypted `callback_method` name that was running when the error was encountered.",
"type": "string"
},
"error": {
"$ref": "Status",
"description": "The error code and message."
}
},
"type": "object"
},
"Color": {
"description": "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:\u0026red green:\u0026green blue:\u0026blue alpha:\u0026alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha \u003c= 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 \u003c\u003c 16) | (green \u003c\u003c 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i \u003c missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ...",
"id": "Color",
"properties": {
"alpha": {
"description": "The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` 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).",
"format": "float",
"type": "number"
},
"blue": {
"description": "The amount of blue in the color as a value in the interval [0, 1].",
"format": "float",
"type": "number"
},
"green": {
"description": "The amount of green in the color as a value in the interval [0, 1].",
"format": "float",
"type": "number"
},
"red": {
"description": "The amount of red in the color as a value in the interval [0, 1].",
"format": "float",
"type": "number"
}
},
"type": "object"
},
"CommonEventObject": {
"description": "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](https://developers.google.com/chat/how-tos/dialogs).",
"id": "CommonEventObject",
"properties": {
"formInputs": {
"additionalProperties": {
"$ref": "Inputs"
},
"description": "A map containing the current values of the widgets in a card. The map keys are the string IDs assigned to each widget, and the values represent inputs to the widget. Depending on the input data type, a different object represents each input: For single-value widgets, `StringInput`. For multi-value widgets, an array of `StringInput` objects. For a date-time picker, a `DateTimeInput`. For a date-only picker, a `DateInput`. For a time-only picker, a `TimeInput`. Corresponds with the data entered by a user on a card in a [dialog](https://developers.google.com/chat/how-tos/dialogs).",
"type": "object"
},
"hostApp": {
"description": "The hostApp enum which indicates the app the add-on is invoked from. Always `CHAT` for Chat apps.",
"enum": [
"UNSPECIFIED_HOST_APP",
"GMAIL",
"CALENDAR",
"DRIVE",
"DEMO",
"DOCS",
"SHEETS",
"SLIDES",
"DRAWINGS",
"CHAT"
],
"enumDescriptions": [
"Google can't identify a host app.",
"The add-on launches from Gmail.",
"The add-on launches from Google Calendar.",
"The add-on launches from Google Drive.",
"Not used.",
"The add-on launches from Google Docs.",
"The add-on launches from Google Sheets.",
"The add-on launches from Google Slides.",
"The add-on launches from Google Drawings.",
"A Google Chat app. Not used for Google Workspace Add-ons."
],
"type": "string"
},
"invokedFunction": {
"description": "Name of the invoked function associated with the widget. Only set for Chat apps.",
"type": "string"
},
"parameters": {
"additionalProperties": {
"type": "string"
},
"description": "Custom [parameters](/chat/api/reference/rest/v1/cards#ActionParameter) passed to the invoked function. Both keys and values must be strings.",
"type": "object"
},
"platform": {
"description": "The platform enum which indicates the platform where the event originates (`WEB`, `IOS`, or `ANDROID`). Not supported by Chat apps.",
"enum": [
"UNKNOWN_PLATFORM",
"WEB",
"IOS",
"ANDROID"
],
"enumDescriptions": [
"",
"",
"",
""
],
"type": "string"
},
"timeZone": {
"$ref": "TimeZone",
"description": "The timezone ID and offset from Coordinated Universal Time (UTC)."
},
"userLocale": {
"description": "The full `locale.displayName` in the format of [ISO 639 language code]-[ISO 3166 country/region code] such as \"en-US\". Not supported by Chat apps.",
"type": "string"
}
},
"type": "object"
},
"DateInput": {
"description": "Date input values. Not supported by Chat apps.",
"id": "DateInput",
"properties": {
"msSinceEpoch": {
"description": "Time since epoch time, in milliseconds.",
"format": "int64",
"type": "string"
}
},
"type": "object"
},
"DateTimeInput": {
"description": "Date and time input values. Not supported by Chat apps.",
"id": "DateTimeInput",
"properties": {
"hasDate": {
"description": "Whether the `datetime` input includes a calendar date.",
"type": "boolean"
},
"hasTime": {
"description": "Whether the `datetime` input includes a timestamp.",
"type": "boolean"
},
"msSinceEpoch": {
"description": "Time since epoch time, in milliseconds.",
"format": "int64",
"type": "string"
}
},
"type": "object"
},
"DeprecatedEvent": {
"description": "Google Chat events.",
"id": "DeprecatedEvent",
"properties": {
"action": {
"$ref": "FormAction",
"description": "The form action data associated with an interactive card that was clicked. Only populated for CARD_CLICKED events. See the [Interactive Cards guide](/chat/how-tos/cards-onclick) for more information."
},
"common": {
"$ref": "CommonEventObject",
"description": "Represents information about the user's client, such as locale, host app, and platform. For Chat apps, `CommonEventObject` includes information submitted by users interacting with [dialogs](https://developers.google.com/chat/how-tos/dialogs), like data entered on a card."
},
"configCompleteRedirectUrl": {
"description": "The URL the Chat app should redirect the user to after they have completed an authorization or configuration flow outside of Google Chat. See the [Authorizing access to 3p services guide](/chat/how-tos/auth-3p) for more information.",
"type": "string"
},
"dialogEventType": {
"description": "The type of [dialog](https://developers.google.com/chat/how-tos/dialogs) event received.",
"enum": [
"TYPE_UNSPECIFIED",
"REQUEST_DIALOG",
"SUBMIT_DIALOG",
"CANCEL_DIALOG"
],
"enumDescriptions": [
"This could be used when the corresponding event is not dialog related. For example an @mention.",
"Any user action that opens a [dialog](https://developers.google.com/chat/how-tos/dialogs).",
"A card click event from a [dialog](https://developers.google.com/chat/how-tos/dialogs).",
"The [dialog](https://developers.google.com/chat/how-tos/dialogs) was cancelled."
],
"type": "string"
},
"eventTime": {
"description": "The timestamp indicating when the event occurred.",
"format": "google-datetime",
"type": "string"
},
"isDialogEvent": {
"description": "True when the event is related to [dialogs](https://developers.google.com/chat/how-tos/dialogs).",
"type": "boolean"
},
"message": {
"$ref": "Message",
"description": "The message that triggered the event, if applicable."
},
"space": {
"$ref": "Space",
"description": "The space in which the event occurred."
},
"threadKey": {
"description": "The Chat app-defined key for the thread related to the event. See the thread_key field of the `spaces.message.create` request for more information.",
"type": "string"
},
"token": {
"description": "A secret value that legacy Chat apps can use to verify if a request is from Google. Google randomly generates the token, and its value remains static. You can obtain, revoke, or regenerate the token from the [Chat API configuration page](https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat) in the Google Cloud Console. Modern Chat apps don't use this field. It is absent from API responses and the [Chat API configuration page](https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat).",
"type": "string"
},
"type": {
"description": "The type of the event.",
"enum": [
"UNSPECIFIED",
"MESSAGE",
"ADDED_TO_SPACE",
"REMOVED_FROM_SPACE",
"CARD_CLICKED"
],
"enumDescriptions": [
"Default value for the enum. DO NOT USE.",
"A message was sent in a space.",
"The Chat app was added to a space.",
"The Chat app was removed from a space.",
"The Chat app's interactive card was clicked."
],
"type": "string"
},
"user": {
"$ref": "User",
"description": "The user that triggered the event."
}
},
"type": "object"
},
"Dialog": {
"description": "Wrapper around the card body of the dialog.",
"id": "Dialog",
"properties": {
"body": {
"$ref": "GoogleAppsCardV1Card",
"description": "Input only. Body of the dialog, which is rendered in a modal. Google Chat apps do not support the following card entities: `DateTimePicker`, `OnChangeAction`."
}
},
"type": "object"
},
"DialogAction": {
"description": "Contains a [dialog](https://developers.google.com/chat/how-tos/dialogs) and request status code.",
"id": "DialogAction",
"properties": {
"actionStatus": {
"$ref": "ActionStatus",
"description": "Input only. Status for a request to either invoke or submit a [dialog](https://developers.google.com/chat/how-tos/dialogs). Displays a status and message to users, if necessary. For example, in case of an error or success."
},
"dialog": {
"$ref": "Dialog",
"description": "Input only. [Dialog](https://developers.google.com/chat/how-tos/dialogs) for the request."
}
},
"type": "object"
},
"DriveDataRef": {
"description": "A reference to the data of a drive attachment.",
"id": "DriveDataRef",
"properties": {
"driveFileId": {
"description": "The id for the drive file, for use with the Drive API.",
"type": "string"
}
},
"type": "object"
},
"Empty": {
"description": "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); }",
"id": "Empty",
"properties": {},
"type": "object"
},
"FormAction": {
"description": "A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form.",
"id": "FormAction",
"properties": {
"actionMethodName": {
"description": "The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the Chat app as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.",
"type": "string"
},
"parameters": {
"description": "List of action parameters.",
"items": {
"$ref": "ActionParameter"
},
"type": "array"
}
},
"type": "object"
},
"GoogleAppsCardV1Action": {
"description": "An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form.",
"id": "GoogleAppsCardV1Action",
"properties": {
"function": {
"description": "Apps Script function to invoke when the containing element is clicked/activated.",
"type": "string"
},
"loadIndicator": {
"description": "Specifies the loading indicator that the action displays while making the call to the action.",
"enum": [
"SPINNER",
"NONE"
],
"enumDescriptions": [
"Displays a spinner to indicate that content is loading.",
"Nothing is displayed."
],
"type": "string"
},
"parameters": {
"description": "List of action parameters.",
"items": {
"$ref": "GoogleAppsCardV1ActionParameter"
},
"type": "array"
},
"persistValues": {
"description": "Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.",
"type": "boolean"
}
},
"type": "object"
},
"GoogleAppsCardV1ActionParameter": {
"description": "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.",
"id": "GoogleAppsCardV1ActionParameter",
"properties": {
"key": {
"description": "The name of the parameter for the action script.",
"type": "string"
},
"value": {
"description": "The value of the parameter.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1BorderStyle": {
"description": "Represents the complete border style applied to widgets.",
"id": "GoogleAppsCardV1BorderStyle",
"properties": {
"cornerRadius": {
"description": "The corner radius for the border.",
"format": "int32",
"type": "integer"
},
"strokeColor": {
"$ref": "Color",
"description": "The colors to use when the type is `BORDER_TYPE_STROKE`."
},
"type": {
"description": "The border type.",
"enum": [
"BORDER_TYPE_UNSPECIFIED",
"NO_BORDER",
"STROKE"
],
"enumDescriptions": [
"No value specified.",
"No border.",
"Outline."
],
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1Button": {
"description": "A button. Can be a text button or an image button.",
"id": "GoogleAppsCardV1Button",
"properties": {
"altText": {
"description": "The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.",
"type": "string"
},
"color": {
"$ref": "Color",
"description": "If set, the button is filled with a solid background."
},
"disabled": {
"description": "If `true`, the button is displayed in a disabled state and doesn't respond to user actions.",
"type": "boolean"
},
"icon": {
"$ref": "GoogleAppsCardV1Icon",
"description": "The icon image."
},
"onClick": {
"$ref": "GoogleAppsCardV1OnClick",
"description": "The action to perform when the button is clicked."
},
"text": {
"description": "The text of the button.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1ButtonList": {
"description": "A list of buttons layed out horizontally.",
"id": "GoogleAppsCardV1ButtonList",
"properties": {
"buttons": {
"description": "An array of buttons.",
"items": {
"$ref": "GoogleAppsCardV1Button"
},
"type": "array"
}
},
"type": "object"
},
"GoogleAppsCardV1Card": {
"description": "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\": [ { \"decorated_text\": { \"icon\": { \"knownIcon\": \"EMAIL\" }, \"content\": \"sasha@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\" } ```",
"id": "GoogleAppsCardV1Card",
"properties": {
"cardActions": {
"description": "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: ``` \"card_actions\": [ { \"actionLabel\": \"Settings\", \"onClick\": { \"action\": { \"functionName\": \"goToView\", \"parameters\": [ { \"key\": \"viewType\", \"value\": \"SETTING\" } ], \"loadIndicator\": \"LoadIndicator.SPINNER\" } } }, { \"actionLabel\": \"Send Feedback\", \"onClick\": { \"openLink\": { \"url\": \"https://example.com/feedback\" } } } ] ```",
"items": {
"$ref": "GoogleAppsCardV1CardAction"
},
"type": "array"
},
"displayStyle": {
"description": "The display style for `peekCardHeader`.",
"enum": [
"DISPLAY_STYLE_UNSPECIFIED",
"PEEK",
"REPLACE"
],
"enumDescriptions": [
"Default value. Do not use.",
"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.",
"The card is shown by replacing the view of the top card in the card stack."
],
"type": "string"
},
"fixedFooter": {
"$ref": "GoogleAppsCardV1CardFixedFooter",
"description": "The fixed footer shown at the bottom of this card."
},
"header": {
"$ref": "GoogleAppsCardV1CardHeader",
"description": "The header of the card. A header usually contains a title and an image."
},
"name": {
"description": "Name of the card. Used as a card identifier in card navigation.",
"type": "string"
},
"peekCardHeader": {
"$ref": "GoogleAppsCardV1CardHeader",
"description": "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."
},
"sections": {
"description": "Sections are separated by a line divider.",
"items": {
"$ref": "GoogleAppsCardV1Section"
},
"type": "array"
}
},
"type": "object"
},
"GoogleAppsCardV1CardAction": {
"description": "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.",
"id": "GoogleAppsCardV1CardAction",
"properties": {
"actionLabel": {
"description": "The label that displays as the action menu item.",
"type": "string"
},
"onClick": {
"$ref": "GoogleAppsCardV1OnClick",
"description": "The `onClick` action for this action item."
}
},
"type": "object"
},
"GoogleAppsCardV1CardFixedFooter": {
"description": "A persistent (sticky) footer that is added to the bottom of the card.",
"id": "GoogleAppsCardV1CardFixedFooter",
"properties": {
"primaryButton": {
"$ref": "GoogleAppsCardV1Button",
"description": "The primary button of the fixed footer. The button must be a text button with text and color set."
},
"secondaryButton": {
"$ref": "GoogleAppsCardV1Button",
"description": "The secondary button of the fixed footer. The button must be a text button with text and color set. `primaryButton` must be set if `secondaryButton` is set."
}
},
"type": "object"
},
"GoogleAppsCardV1CardHeader": {
"description": "Represents a card header.",
"id": "GoogleAppsCardV1CardHeader",
"properties": {
"imageAltText": {
"description": "The alternative text of this image which is used for accessibility.",
"type": "string"
},
"imageType": {
"description": "The image's type.",
"enum": [
"SQUARE",
"CIRCLE"
],
"enumDescriptions": [
"Applies no cropping to the image.",
"Applies a circular mask to the image."
],
"type": "string"
},
"imageUrl": {
"description": "The URL of the image in the card header.",
"type": "string"
},
"subtitle": {
"description": "The subtitle of the card header.",
"type": "string"
},
"title": {
"description": "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.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1DateTimePicker": {
"description": "The widget that lets users to specify a date and time. Not supported by Google Chat apps.",
"id": "GoogleAppsCardV1DateTimePicker",
"properties": {
"label": {
"description": "The label for the field that displays to the user.",
"type": "string"
},
"name": {
"description": "The name of the text input that's used in `formInput`, and uniquely identifies this input.",
"type": "string"
},
"onChangeAction": {
"$ref": "GoogleAppsCardV1Action",
"description": "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."
},
"timezoneOffsetDate": {
"description": "The number representing the time zone offset from UTC, in minutes. If set, the `value_ms_epoch` is displayed in the specified time zone. If not set, it uses the user's time zone setting on the client side.",
"format": "int32",
"type": "integer"
},
"type": {
"description": "The type of the date/time picker.",
"enum": [
"DATE_AND_TIME",
"DATE_ONLY",
"TIME_ONLY"
],
"enumDescriptions": [
"The user can select a date and time.",
"The user can only select a date.",
"The user can only select a time."
],
"type": "string"
},
"valueMsEpoch": {
"description": "The value to display as the default value before user input or previous user input. It is represented in milliseconds (Epoch time). For `DATE_AND_TIME` type, the full epoch value is used. For `DATE_ONLY` type, only date of the epoch time is used. For `TIME_ONLY` type, only time of the epoch time is used. For example, you can set epoch time to `3 * 60 * 60 * 1000` to represent 3am.",
"format": "int64",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1DecoratedText": {
"description": "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.",
"id": "GoogleAppsCardV1DecoratedText",
"properties": {
"bottomLabel": {
"description": "The formatted text label that shows below the main text.",
"type": "string"
},
"button": {
"$ref": "GoogleAppsCardV1Button",
"description": "A button that can be clicked to trigger an action."
},
"endIcon": {
"$ref": "GoogleAppsCardV1Icon",
"description": "An icon displayed after the text."
},
"icon": {
"$ref": "GoogleAppsCardV1Icon",
"description": "Deprecated in favor of start_icon."
},
"onClick": {
"$ref": "GoogleAppsCardV1OnClick",
"description": "Only the top and bottom label and content region are clickable."
},
"startIcon": {
"$ref": "GoogleAppsCardV1Icon",
"description": "The icon displayed in front of the text."
},
"switchControl": {
"$ref": "GoogleAppsCardV1SwitchControl",
"description": "A switch widget can be clicked to change its state or trigger an action."
},
"text": {
"description": "Required. The main widget formatted text. See Text formatting for details.",
"type": "string"
},
"topLabel": {
"description": "The formatted text label that shows above the main text.",
"type": "string"
},
"wrapText": {
"description": "The wrap text setting. If `true`, the text is wrapped and displayed in multiline. Otherwise, the text is truncated.",
"type": "boolean"
}
},
"type": "object"
},
"GoogleAppsCardV1Divider": {
"description": "A divider that appears in between widgets.",
"id": "GoogleAppsCardV1Divider",
"properties": {},
"type": "object"
},
"GoogleAppsCardV1Grid": {
"description": "Represents a Grid widget that displays items in a configurable grid layout.",
"id": "GoogleAppsCardV1Grid",
"properties": {
"borderStyle": {
"$ref": "GoogleAppsCardV1BorderStyle",
"description": "The border style to apply to each grid item."
},
"columnCount": {
"description": "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).",
"format": "int32",
"type": "integer"
},
"items": {
"description": "The items to display in the grid.",
"items": {
"$ref": "GoogleAppsCardV1GridItem"
},
"type": "array"
},
"onClick": {
"$ref": "GoogleAppsCardV1OnClick",
"description": "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."
},
"title": {
"description": "The text that displays in the grid header.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1GridItem": {
"description": "Represents a single item in the grid layout.",
"id": "GoogleAppsCardV1GridItem",
"properties": {
"id": {
"description": "A user-specified identifier for this grid item. This identifier is returned in the parent Grid's onClick callback parameters.",
"type": "string"
},
"image": {
"$ref": "GoogleAppsCardV1ImageComponent",
"description": "The image that displays in the grid item."
},
"layout": {
"description": "The layout to use for the grid item.",
"enum": [
"GRID_ITEM_LAYOUT_UNSPECIFIED",
"TEXT_BELOW",
"TEXT_ABOVE"
],
"enumDescriptions": [
"No layout specified.",
"The title and subtitle are shown below the grid item's image.",
"The title and subtitle are shown above the grid item's image."
],
"type": "string"
},
"subtitle": {
"description": "The grid item's subtitle.",
"type": "string"
},
"textAlignment": {
"description": "The horizontal alignment of the grid item's text.",
"enum": [
"HORIZONTAL_ALIGNMENT_UNSPECIFIED",
"START",
"CENTER",
"END"
],
"enumDescriptions": [
"Unspecified alignment.",
"Alignment to the start position.",
"Alignment to the center position.",
"Alignment to the end position."
],
"type": "string"
},
"title": {
"description": "The grid item's title.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1Icon": {
"id": "GoogleAppsCardV1Icon",
"properties": {
"altText": {
"description": "The description of the icon, used for accessibility. The default value is provided if you don't specify one.",
"type": "string"
},
"iconUrl": {
"description": "The icon specified by a URL.",
"type": "string"
},
"imageType": {
"description": "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.",
"enum": [
"SQUARE",
"CIRCLE"
],
"enumDescriptions": [
"Applies no cropping to the image.",
"Applies a circular mask to the image."
],
"type": "string"
},
"knownIcon": {
"description": "The icon specified by the string name of a list of known icons.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1Image": {
"description": "An image that is specified by a URL and can have an `onClick` action.",
"id": "GoogleAppsCardV1Image",
"properties": {
"altText": {
"description": "The alternative text of this image, used for accessibility.",
"type": "string"
},
"imageUrl": {
"description": "An image URL.",
"type": "string"
},
"onClick": {
"$ref": "GoogleAppsCardV1OnClick",
"description": "The action triggered by an `onClick` event."
}
},
"type": "object"
},
"GoogleAppsCardV1ImageComponent": {
"description": "Represents an image.",
"id": "GoogleAppsCardV1ImageComponent",
"properties": {
"altText": {
"description": "The accessibility label for the image.",
"type": "string"
},
"borderStyle": {
"$ref": "GoogleAppsCardV1BorderStyle",
"description": "The border style to apply to the image."
},
"cropStyle": {
"$ref": "GoogleAppsCardV1ImageCropStyle",
"description": "The crop style to apply to the image."
},
"imageUri": {
"description": "The image URL.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1ImageCropStyle": {
"description": "Represents the crop style applied to an image.",
"id": "GoogleAppsCardV1ImageCropStyle",
"properties": {
"aspectRatio": {
"description": "The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`.",
"format": "double",
"type": "number"
},
"type": {
"description": "The crop type.",
"enum": [
"IMAGE_CROP_TYPE_UNSPECIFIED",
"SQUARE",
"CIRCLE",
"RECTANGLE_CUSTOM",
"RECTANGLE_4_3"
],
"enumDescriptions": [
"No value specified.",
"Applies a square crop.",
"Applies a circular crop.",
"Applies a rectangular crop with a custom aspect ratio.",
"Applies a rectangular crop with a 4:3 aspect ratio."
],
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1OnClick": {
"description": "Represents the response to an `onClick` event.",
"id": "GoogleAppsCardV1OnClick",
"properties": {
"action": {
"$ref": "GoogleAppsCardV1Action",
"description": "If specified, an action is triggered by this `onClick`."
},
"card": {
"$ref": "GoogleAppsCardV1Card",
"description": "A new card is pushed to the card stack after clicking if specified."
},
"openDynamicLinkAction": {
"$ref": "GoogleAppsCardV1Action",
"description": "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": {
"$ref": "GoogleAppsCardV1OpenLink",
"description": "If specified, this `onClick` triggers an open link action."
}
},
"type": "object"
},
"GoogleAppsCardV1OpenLink": {
"description": "Represents an `onClick` event that opens a hyperlink.",
"id": "GoogleAppsCardV1OpenLink",
"properties": {
"onClose": {
"description": "Whether the client forgets about a link after opening it, or observes it until the window closes. Not supported by Chat apps.",
"enum": [
"NOTHING",
"RELOAD"
],
"enumDescriptions": [
"Doesn’t reload the card after the child window closes.",
"Reloads the card after the child window closes. If used in conjunction with [OpenAs.OVERLAY](/workspace/add-ons/reference/rpc/google.apps.card.v1#openas), the child window acts as a modal dialog and the main card is blocked until the child window closes."
],
"type": "string"
},
"openAs": {
"description": "How to open a link. Not supported by Chat apps.",
"enum": [
"FULL_SIZE",
"OVERLAY"
],
"enumDescriptions": [
"The link opens as a full size window (if that's the frame used by the client.",
"The link opens as an overlay, such as a pop-up."
],
"type": "string"
},
"url": {
"description": "The URL to open.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1Section": {
"description": "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.",
"id": "GoogleAppsCardV1Section",
"properties": {
"collapsible": {
"description": "Indicates whether this section is collapsible. If a section is collapsible, the description must be given.",
"type": "boolean"
},
"header": {
"description": "The header of the section. Formatted text is supported.",
"type": "string"
},
"uncollapsibleWidgetsCount": {
"description": "The number of uncollapsible widgets. For example, when a section contains five widgets and the `uncollapsibleWidgetsCount` is set to `2`, the first two widgets are always shown and the last three are collapsed as default. The `uncollapsibleWidgetsCount` is taken into account only when `collapsible` is `true`.",
"format": "int32",
"type": "integer"
},
"widgets": {
"description": "A section must contain at least 1 widget.",
"items": {
"$ref": "GoogleAppsCardV1Widget"
},
"type": "array"
}
},
"type": "object"
},
"GoogleAppsCardV1SelectionInput": {
"description": "A widget that creates a UI item with options for users to select. For example, a dropdown menu.",
"id": "GoogleAppsCardV1SelectionInput",
"properties": {
"items": {
"description": "An array of the selected items.",
"items": {
"$ref": "GoogleAppsCardV1SelectionItem"
},
"type": "array"
},
"label": {
"description": "The label displayed ahead of the switch control.",
"type": "string"
},
"name": {
"description": "The name of the text input which is used in `formInput`.",
"type": "string"
},
"onChangeAction": {
"$ref": "GoogleAppsCardV1Action",
"description": "If specified, the form is submitted when the selection changes. If not specified, you must specify a separate button."
},
"type": {
"description": "The type of the selection.",
"enum": [
"CHECK_BOX",
"RADIO_BUTTON",
"SWITCH",
"DROPDOWN"
],
"enumDescriptions": [
"A checkbox.",
"A radio button.",
"A switch.",
"A dropdown menu."
],
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1SelectionItem": {
"description": "A selectable item in the switch control.",
"id": "GoogleAppsCardV1SelectionItem",
"properties": {
"selected": {
"description": "If more than one item is selected for `RADIO_BUTTON` and `DROPDOWN`, the first selected item is treated as selected and the ones after are ignored.",
"type": "boolean"
},
"text": {
"description": "The text to be displayed.",
"type": "string"
},
"value": {
"description": "The value associated with this item. The client should use this as a form input value.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1SuggestionItem": {
"description": "A suggestion item.",
"id": "GoogleAppsCardV1SuggestionItem",
"properties": {
"text": {
"description": "The suggested autocomplete result.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1Suggestions": {
"description": "A container wrapping elements necessary for showing suggestion items used in text input autocomplete.",
"id": "GoogleAppsCardV1Suggestions",
"properties": {
"items": {
"description": "A list of suggestions used for autocomplete recommendations.",
"items": {
"$ref": "GoogleAppsCardV1SuggestionItem"
},
"type": "array"
}
},
"type": "object"
},
"GoogleAppsCardV1SwitchControl": {
"description": "Either a toggle-style switch or a checkbox.",
"id": "GoogleAppsCardV1SwitchControl",
"properties": {
"controlType": {
"description": "The control type, either switch or checkbox.",
"enum": [
"SWITCH",
"CHECKBOX",
"CHECK_BOX"
],
"enumDescriptions": [
"A toggle-style switch.",
"Deprecated in favor of `CHECK_BOX`.",
"A checkbox."
],
"type": "string"
},
"name": {
"description": "The name of the switch widget that's used in `formInput`.",
"type": "string"
},
"onChangeAction": {
"$ref": "GoogleAppsCardV1Action",
"description": "The action when the switch state is changed."
},
"selected": {
"description": "If the switch is selected.",
"type": "boolean"
},
"value": {
"description": "The value is what is passed back in the callback.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1TextInput": {
"description": "A text input is a UI item where users can input text. A text input can also have an onChange action and suggestions.",
"id": "GoogleAppsCardV1TextInput",
"properties": {
"autoCompleteAction": {
"$ref": "GoogleAppsCardV1Action",
"description": "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."
},
"hintText": {
"description": "The hint text.",
"type": "string"
},
"initialSuggestions": {
"$ref": "GoogleAppsCardV1Suggestions",
"description": "The initial suggestions made before any user input."
},
"label": {
"description": "At least one of label and hintText must be specified.",
"type": "string"
},
"name": {
"description": "The name of the text input which is used in `formInput`.",
"type": "string"
},
"onChangeAction": {
"$ref": "GoogleAppsCardV1Action",
"description": "The onChange action, for example, invoke a function."
},
"type": {
"description": "The style of the text, for example, a single line or multiple lines.",
"enum": [
"SINGLE_LINE",
"MULTIPLE_LINE"
],
"enumDescriptions": [
"The text is put into a single line.",
"The text is put into multiple lines."
],
"type": "string"
},
"value": {
"description": "The default value when there is no input from the user.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1TextParagraph": {
"description": "A paragraph of text that supports formatting. See [Text formatting](workspace/add-ons/concepts/widgets#text_formatting\") for details.",
"id": "GoogleAppsCardV1TextParagraph",
"properties": {
"text": {
"description": "The text that's shown in the widget.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsCardV1Widget": {
"description": "A widget is a UI element that presents texts, images, etc.",
"id": "GoogleAppsCardV1Widget",
"properties": {
"buttonList": {
"$ref": "GoogleAppsCardV1ButtonList",
"description": "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: ``` \"buttonList\": { \"buttons\": [ \"button\": { \"text\": \"Edit\", \"Color\": { \"Red\": 255 \"Green\": 255 \"Blue\": 255 } \"disabled\": true }, \"button\": { \"icon\": { \"knownIcon\": \"INVITE\" \"altText\": \"check calendar\" }, \"onClick\": { \"openLink\": { \"url\": \"https://example.com/calendar\" } } }, ] } ```"
},
"dateTimePicker": {
"$ref": "GoogleAppsCardV1DateTimePicker",
"description": "Displays a selection/input widget for date/time. For example, the following JSON creates a date/time picker for an appointment time: ``` \"date_time_picker\": { \"name\": \"appointment_time\", \"label\": \"Book your appointment at:\", \"type\": \"DateTimePickerType.DATE_AND_TIME\", \"valueMsEpoch\": \"796435200000\" } ```"
},
"decoratedText": {
"$ref": "GoogleAppsCardV1DecoratedText",
"description": "Displays a decorated text item in this widget. For example, the following JSON creates a decorated text widget showing email address: ``` \"decoratedText\": { \"icon\": { \"knownIcon\": \"EMAIL\" }, \"topLabel\": \"Email Address\", \"content\": \"sasha@example.com\", \"bottomLabel\": \"This is a new Email address!\", \"switchWidget\": { \"name\": \"has_send_welcome_email_to_sasha\", \"selected\": false, \"controlType\": \"ControlType.CHECKBOX\" } } ```"
},
"divider": {
"$ref": "GoogleAppsCardV1Divider",
"description": "Displays a divider. For example, the following JSON creates a divider: ``` \"divider\": { } ```"
},
"grid": {
"$ref": "GoogleAppsCardV1Grid",
"description": "Displays a grid with a collection of items. 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\" } } } ```"
},
"horizontalAlignment": {
"description": "The horizontal alignment of this widget.",
"enum": [
"HORIZONTAL_ALIGNMENT_UNSPECIFIED",
"START",
"CENTER",
"END"
],
"enumDescriptions": [
"Unspecified alignment.",
"Alignment to the start position.",
"Alignment to the center position.",
"Alignment to the end position."
],
"type": "string"
},
"image": {
"$ref": "GoogleAppsCardV1Image",
"description": "Displays an image in this widget. For example, the following JSON creates an image with alternative text: ``` \"image\": { \"imageUrl\": \"https://example.com/sasha.png\" \"altText\": \"Avatar for Sasha\" } ```"
},
"selectionInput": {
"$ref": "GoogleAppsCardV1SelectionInput",
"description": "Displays a switch control in this widget. For example, the following JSON creates a dropdown selection for size: ``` \"switchControl\": { \"name\": \"size\", \"label\": \"Size\" \"type\": \"SelectionType.DROPDOWN\", \"items\": [ { \"text\": \"S\", \"value\": \"small\", \"selected\": false }, { \"text\": \"M\", \"value\": \"medium\", \"selected\": true }, { \"text\": \"L\", \"value\": \"large\", \"selected\": false }, { \"text\": \"XL\", \"value\": \"extra_large\", \"selected\": false } ] } ```"
},
"textInput": {
"$ref": "GoogleAppsCardV1TextInput",
"description": "Displays a text input in this widget. For example, the following JSON creates a text input for mail address: ``` \"textInput\": { \"name\": \"mailing_address\", \"label\": \"Mailing Address\" } ``` As another example, the following JSON creates a text input for programming language with static suggestions: ``` \"textInput\": { \"name\": \"preferred_programing_language\", \"label\": \"Preferred Language\", \"initialSuggestions\": { \"items\": [ { \"text\": \"C++\" }, { \"text\": \"Java\" }, { \"text\": \"JavaScript\" }, { \"text\": \"Python\" } ] } } ```"
},
"textParagraph": {
"$ref": "GoogleAppsCardV1TextParagraph",
"description": "Displays a text paragraph in this widget. For example, the following JSON creates a bolded text: ``` \"textParagraph\": { \"text\": \" *bold text*\" } ```"
}
},
"type": "object"
},
"Image": {
"description": "An image that is specified by a URL and can have an onclick action.",
"id": "Image",
"properties": {
"aspectRatio": {
"description": "The aspect ratio of this image (width/height). This field allows clients to reserve the right height for the image while waiting for it to load. It's not meant to override the native aspect ratio of the image. If unset, the server fills it by prefetching the image.",
"format": "double",
"type": "number"
},
"imageUrl": {
"description": "The URL of the image.",
"type": "string"
},
"onClick": {
"$ref": "OnClick",
"description": "The onclick action."
}
},
"type": "object"
},
"ImageButton": {
"description": "An image button with an onclick action.",
"id": "ImageButton",
"properties": {
"icon": {
"description": "The icon specified by an enum that indices to an icon provided by Chat API.",
"enum": [
"ICON_UNSPECIFIED",
"AIRPLANE",
"BOOKMARK",
"BUS",
"CAR",
"CLOCK",
"CONFIRMATION_NUMBER_ICON",
"DOLLAR",
"DESCRIPTION",
"EMAIL",
"EVENT_PERFORMER",
"EVENT_SEAT",
"FLIGHT_ARRIVAL",
"FLIGHT_DEPARTURE",
"HOTEL",
"HOTEL_ROOM_TYPE",
"INVITE",
"MAP_PIN",
"MEMBERSHIP",
"MULTIPLE_PEOPLE",
"OFFER",
"PERSON",
"PHONE",
"RESTAURANT_ICON",
"SHOPPING_CART",
"STAR",
"STORE",
"TICKET",
"TRAIN",
"VIDEO_CAMERA",
"VIDEO_PLAY"
],
"enumDescriptions": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
],
"type": "string"
},
"iconUrl": {
"description": "The icon specified by a URL.",
"type": "string"
},
"name": {
"description": "The name of this image_button which will be used for accessibility. Default value will be provided if developers don't specify.",
"type": "string"
},
"onClick": {
"$ref": "OnClick",
"description": "The onclick action."
}
},
"type": "object"
},
"Inputs": {
"description": "Types of data inputs for widgets. Users enter data with these inputs.",
"id": "Inputs",
"properties": {
"dateInput": {
"$ref": "DateInput",
"description": "Date input values. Not supported by Chat apps."
},
"dateTimeInput": {
"$ref": "DateTimeInput",
"description": "Date and time input values. Not supported by Chat apps."
},
"stringInputs": {
"$ref": "StringInputs",
"description": "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."
},
"timeInput": {
"$ref": "TimeInput",
"description": "Time input values. Not supported by Chat apps."
}
},
"type": "object"
},
"KeyValue": {
"description": "A UI element contains a key (label) and a value (content). And this element may also contain some actions such as onclick button.",
"id": "KeyValue",
"properties": {
"bottomLabel": {
"description": "The text of the bottom label. Formatted text supported.",
"type": "string"
},
"button": {
"$ref": "Button",
"description": "A button that can be clicked to trigger an action."
},
"content": {
"description": "The text of the content. Formatted text supported and always required.",
"type": "string"
},
"contentMultiline": {
"description": "If the content should be multiline.",
"type": "boolean"
},
"icon": {
"description": "An enum value that will be replaced by the Chat API with the corresponding icon image.",
"enum": [
"ICON_UNSPECIFIED",
"AIRPLANE",
"BOOKMARK",
"BUS",
"CAR",
"CLOCK",
"CONFIRMATION_NUMBER_ICON",
"DOLLAR",
"DESCRIPTION",
"EMAIL",
"EVENT_PERFORMER",
"EVENT_SEAT",
"FLIGHT_ARRIVAL",
"FLIGHT_DEPARTURE",
"HOTEL",
"HOTEL_ROOM_TYPE",
"INVITE",
"MAP_PIN",
"MEMBERSHIP",
"MULTIPLE_PEOPLE",
"OFFER",
"PERSON",
"PHONE",
"RESTAURANT_ICON",
"SHOPPING_CART",
"STAR",
"STORE",
"TICKET",
"TRAIN",
"VIDEO_CAMERA",
"VIDEO_PLAY"
],
"enumDescriptions": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
],
"type": "string"
},
"iconUrl": {
"description": "The icon specified by a URL.",
"type": "string"
},
"onClick": {
"$ref": "OnClick",
"description": "The onclick action. Only the top label, bottom label and content region are clickable."
},
"topLabel": {
"description": "The text of the top label. Formatted text supported.",
"type": "string"
}
},
"type": "object"
},
"ListMembershipsResponse": {
"id": "ListMembershipsResponse",
"properties": {
"memberships": {
"description": "List of memberships in the requested (or first) page.",
"items": {
"$ref": "Membership"
},
"type": "array"
},
"nextPageToken": {
"description": "Continuation token to retrieve the next page of results. It will be empty for the last page of results.",
"type": "string"
}
},
"type": "object"
},
"ListSpacesResponse": {
"id": "ListSpacesResponse",
"properties": {
"nextPageToken": {
"description": "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.",
"type": "string"
},
"spaces": {
"description": "List of spaces in the requested (or first) page.",
"items": {
"$ref": "Space"
},
"type": "array"
}
},
"type": "object"
},
"MatchedUrl": {
"description": "A matched url in a Chat message. Chat apps can unfurl matched URLs. For more information, refer to [Unfurl links](https://developers.google.com/chat/how-tos/link-unfurling).",
"id": "MatchedUrl",
"properties": {
"url": {
"description": "Output only. The url that was matched.",
"readOnly": true,
"type": "string"
}
},
"type": "object"
},
"Media": {
"description": "Media resource.",
"id": "Media",
"properties": {
"resourceName": {
"description": "Name of the media resource.",
"type": "string"
}
},
"type": "object"
},
"Membership": {
"description": "Represents a membership relation in Google Chat.",
"id": "Membership",
"properties": {
"createTime": {
"description": "Output only. The creation time of the membership a.k.a. the time at which the member joined the space, if applicable.",
"format": "google-datetime",
"readOnly": true,
"type": "string"
},
"member": {
"$ref": "User",
"description": "A Google Chat user or app. Format: `users/{person}` or `users/app` When `users/{person}`, represents a [person](https://developers.google.com/people/api/rest/v1/people) in the People API or a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. Format: `users/{user}` When `users/app`, represents a Chat app creating membership for itself. Creating membership is available as a [developer preview](https://developers.google.com/workspace/preview)."
},
"name": {
"type": "string"
},
"state": {
"description": "Output only. State of the membership.",
"enum": [
"MEMBERSHIP_STATE_UNSPECIFIED",
"JOINED",
"INVITED",
"NOT_A_MEMBER"
],
"enumDescriptions": [
"Default, do not use.",
"The user has joined the space.",
"The user has been invited, is able to join the space, but currently has not joined.",
"The user is not a member of the space, has not been invited and is not able to join the space."
],
"readOnly": true,
"type": "string"
}
},
"type": "object"
},
"Message": {
"description": "A message in Google Chat.",
"id": "Message",
"properties": {
"actionResponse": {
"$ref": "ActionResponse",
"description": "Input only. Parameters that a Chat app can use to configure how its response is posted."
},
"annotations": {
"description": "Output only. Annotations associated with the text in this message.",
"items": {
"$ref": "Annotation"
},
"readOnly": true,
"type": "array"
},
"argumentText": {
"description": "Plain-text body of the message with all Chat app mentions stripped out.",
"type": "string"
},
"attachment": {
"description": "User uploaded attachment.",
"items": {
"$ref": "Attachment"
},
"type": "array"
},
"cards": {
"description": "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.",
"items": {
"$ref": "Card"
},
"type": "array"
},
"createTime": {
"description": "Output only. The time at which the message was created in Google Chat server.",
"format": "google-datetime",
"readOnly": true,
"type": "string"
},
"fallbackText": {
"description": "A plain-text description of the message's cards, used when the actual cards cannot be displayed (e.g. mobile notifications).",
"type": "string"
},
"lastUpdateTime": {
"description": "Output only. The time at which the message was last updated in Google Chat server. If the message was never updated, this field will be same as create_time.",
"format": "google-datetime",
"readOnly": true,
"type": "string"
},
"matchedUrl": {
"$ref": "MatchedUrl",
"description": "Output only. A URL in `spaces.messages.text` that matches a link unfurling pattern. For more information, refer to [Unfurl links](https://developers.google.com/chat/how-tos/link-unfurling).",
"readOnly": true
},
"name": {
"description": "Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`",
"type": "string"
},
"sender": {
"$ref": "User",
"description": "Output only. The user who created the message.",
"readOnly": true
},
"slashCommand": {
"$ref": "SlashCommand",
"description": "Output only. Slash command information, if applicable.",
"readOnly": true
},
"space": {
"$ref": "Space",
"description": "The space the message belongs to."
},
"text": {
"description": "Plain-text body of the message. The first link to an image, video, web page, or other preview-able item generates a preview chip.",
"type": "string"
},
"thread": {
"$ref": "Thread",
"description": "The thread the message belongs to."
}
},
"type": "object"
},
"OnClick": {
"description": "An onclick action (e.g. open a link).",
"id": "OnClick",
"properties": {
"action": {
"$ref": "FormAction",
"description": "A form action will be triggered by this onclick if specified."
},
"openLink": {
"$ref": "OpenLink",
"description": "This onclick triggers an open link action if specified."
}
},
"type": "object"
},
"OpenLink": {
"description": "A link that opens a new window.",
"id": "OpenLink",
"properties": {
"url": {
"description": "The URL to open.",
"type": "string"
}
},
"type": "object"
},
"Section": {
"description": "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).",
"id": "Section",
"properties": {
"header": {
"description": "The header of the section, text formatted supported.",
"type": "string"
},
"widgets": {
"description": "A section must contain at least 1 widget.",
"items": {
"$ref": "WidgetMarkup"
},
"type": "array"
}
},
"type": "object"
},
"SlashCommand": {
"description": "A [slash command](https://developers.google.com/chat/how-tos/slash-commands) in Google Chat.",
"id": "SlashCommand",
"properties": {
"commandId": {
"description": "The id of the slash command invoked.",
"format": "int64",
"type": "string"
}
},
"type": "object"
},
"SlashCommandMetadata": {
"description": "Annotation metadata for slash commands (/).",
"id": "SlashCommandMetadata",
"properties": {
"bot": {
"$ref": "User",
"description": "The Chat app whose command was invoked."
},
"commandId": {
"description": "The command id of the invoked slash command.",
"format": "int64",
"type": "string"
},
"commandName": {
"description": "The name of the invoked slash command.",
"type": "string"
},
"triggersDialog": {
"description": "Indicating whether the slash command is for a dialog.",
"type": "boolean"
},
"type": {
"description": "The type of slash command.",
"enum": [
"TYPE_UNSPECIFIED",
"ADD",
"INVOKE"
],
"enumDescriptions": [
"Default value for the enum. DO NOT USE.",
"Add Chat app to space.",
"Invoke slash command in space."
],
"type": "string"
}
},
"type": "object"
},
"Space": {
"description": "A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.",
"id": "Space",
"properties": {
"displayName": {
"description": "The space's display name. For direct messages between humans, this field might be empty.",
"type": "string"
},
"name": {
"description": "Resource name of the space, in the form \"spaces/*\". Example: spaces/AAAAAAAAAAAA",
"type": "string"
},
"singleUserBotDm": {
"description": "Output only. Whether the space is a DM between a Chat app and a single human.",
"readOnly": true,
"type": "boolean"
},
"threaded": {
"description": "Output only. Output only. Whether the messages are threaded in this space.",
"readOnly": true,
"type": "boolean"
},
"type": {
"description": "Output only. Deprecated: Use `single_user_bot_dm` instead. Output only. The type of a space.",
"enum": [
"TYPE_UNSPECIFIED",
"ROOM",
"DM"
],
"enumDescriptions": [
"",
"Conversations between two or more humans.",
"1:1 Direct Message between a human and a Chat app, where all messages are flat. Note that this does not include direct messages between two humans."
],
"readOnly": true,
"type": "string"
}
},
"type": "object"
},
"Status": {
"description": "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](https://github.com/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](https://cloud.google.com/apis/design/errors).",
"id": "Status",
"properties": {
"code": {
"description": "The status code, which should be an enum value of google.rpc.Code.",
"format": "int32",
"type": "integer"
},
"details": {
"description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
"items": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL.",
"type": "any"
},
"type": "object"
},
"type": "array"
},
"message": {
"description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
"type": "string"
}
},
"type": "object"
},
"StringInputs": {
"description": "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.",
"id": "StringInputs",
"properties": {
"value": {
"description": "An array of strings entered by the user.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"TextButton": {
"description": "A button with text and onclick action.",
"id": "TextButton",
"properties": {
"onClick": {
"$ref": "OnClick",
"description": "The onclick action of the button."
},
"text": {
"description": "The text of the button.",
"type": "string"
}
},
"type": "object"
},
"TextParagraph": {
"description": "A paragraph of text. Formatted text supported.",
"id": "TextParagraph",
"properties": {
"text": {
"type": "string"
}
},
"type": "object"
},
"Thread": {
"description": "A thread in Google Chat.",
"id": "Thread",
"properties": {
"name": {
"description": "Resource name, in the form \"spaces/*/threads/*\". Example: spaces/AAAAAAAAAAA/threads/TTTTTTTTTTT",
"type": "string"
}
},
"type": "object"
},
"TimeInput": {
"description": "Time input values. Not supported by Chat apps.",
"id": "TimeInput",
"properties": {
"hours": {
"description": "The hour on a 24-hour clock.",
"format": "int32",
"type": "integer"
},
"minutes": {
"description": "The number of minutes past the hour. Valid values are 0 to 59.",
"format": "int32",
"type": "integer"
}
},
"type": "object"
},
"TimeZone": {
"description": "The timezone ID and offset from Coordinated Universal Time (UTC). Not supported by Chat apps.",
"id": "TimeZone",
"properties": {
"id": {
"description": "The [IANA TZ](https://www.iana.org/time-zones) time zone database code, such as \"America/Toronto\".",
"type": "string"
},
"offset": {
"description": "The user timezone offset, in milliseconds, from Coordinated Universal Time (UTC).",
"format": "int32",
"type": "integer"
}
},
"type": "object"
},
"User": {
"description": "A user in Google Chat.",
"id": "User",
"properties": {
"displayName": {
"description": "Output only. The user's display name.",
"readOnly": true,
"type": "string"
},
"domainId": {
"description": "Unique identifier of the user's Google Workspace domain.",
"type": "string"
},
"isAnonymous": {
"description": "Output only. When `true`, the user is deleted or their profile is not visible.",
"readOnly": true,
"type": "boolean"
},
"name": {
"description": "Resource name for a Google Chat user. Represents a [person](https://developers.google.com/people/api/rest/v1/people#Person) in the People API or a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. Formatted as: `users/{user}`",
"type": "string"
},
"type": {
"description": "User type.",
"enum": [
"TYPE_UNSPECIFIED",
"HUMAN",
"BOT"
],
"enumDescriptions": [
"Default value for the enum. DO NOT USE.",
"Human user.",
"Chat app user."
],
"type": "string"
}
},
"type": "object"
},
"UserMentionMetadata": {
"description": "Annotation metadata for user mentions (@).",
"id": "UserMentionMetadata",
"properties": {
"type": {
"description": "The type of user mention.",
"enum": [
"TYPE_UNSPECIFIED",
"ADD",
"MENTION"
],
"enumDescriptions": [
"Default value for the enum. DO NOT USE.",
"Add user to space.",
"Mention user in space."
],
"type": "string"
},
"user": {
"$ref": "User",
"description": "The user mentioned."
}
},
"type": "object"
},
"WidgetMarkup": {
"description": "A widget is a UI element that presents texts, images, etc.",
"id": "WidgetMarkup",
"properties": {
"buttons": {
"description": "A list of buttons. Buttons is also oneof data and only one of these fields should be set.",
"items": {
"$ref": "Button"
},
"type": "array"
},
"image": {
"$ref": "Image",
"description": "Display an image in this widget."
},
"keyValue": {
"$ref": "KeyValue",
"description": "Display a key value item in this widget."
},
"textParagraph": {
"$ref": "TextParagraph",
"description": "Display a text paragraph in this widget."
}
},
"type": "object"
}
},
"servicePath": "",
"title": "Google Chat API",
"version": "v1",
"version_module": true
}