diff --git a/discovery/chat-v1.json b/discovery/chat-v1.json index 5d2d45bc709..78781e2df53 100644 --- a/discovery/chat-v1.json +++ b/discovery/chat-v1.json @@ -372,7 +372,7 @@ } } }, - "revision": "20200801", + "revision": "20200927", "rootUrl": "https://chat.googleapis.com/", "schemas": { "ActionParameter": { @@ -426,6 +426,10 @@ "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", @@ -435,11 +439,13 @@ "description": "The type of this annotation.", "enum": [ "ANNOTATION_TYPE_UNSPECIFIED", - "USER_MENTION" + "USER_MENTION", + "SLASH_COMMAND" ], "enumDescriptions": [ "Default value for the enum. DO NOT USE.", - "A user is mentioned." + "A user is mentioned.", + "A slash command is invoked." ], "type": "string" }, @@ -602,7 +608,7 @@ "type": "object" }, "DeprecatedEvent": { - "description": "Hangouts Chat events.", + "description": "Google Chat events.", "id": "DeprecatedEvent", "properties": { "action": { @@ -610,7 +616,7 @@ "description": "The form action data associated with an interactive card that was clicked. Only populated for CARD_CLICKED events. See the [Interactive Cards guide](/hangouts/chat/how-tos/cards-onclick) for more information." }, "configCompleteRedirectUrl": { - "description": "The URL the bot should redirect the user to after they have completed an authorization or configuration flow outside of Hangouts Chat. See the [Authorizing access to 3p services guide](/hangouts/chat/how-tos/auth-3p) for more information.", + "description": "The URL the bot 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](/hangouts/chat/how-tos/auth-3p) for more information.", "type": "string" }, "eventTime": { @@ -631,7 +637,7 @@ "type": "string" }, "token": { - "description": "A secret value that bots can use to verify if a request is from Google. The token is randomly generated by Google, remains static, and can be obtained from the Hangouts Chat API configuration page in the Cloud Console. Developers can revoke/regenerate it if needed from the same page.", + "description": "A secret value that bots can use to verify if a request is from Google. The token is randomly generated by Google, remains static, and can be obtained from the Google Chat API configuration page in the Cloud Console. Developers can revoke/regenerate it if needed from the same page.", "type": "string" }, "type": { @@ -964,10 +970,9 @@ }, "member": { "$ref": "User", - "description": "Member details." + "description": "A User in Hangout Chat" }, "name": { - "description": "Resource name of the membership, in the form \"spaces/*/members/*\". Example: spaces/AAAAMpdlehY/members/105115627578887013105", "type": "string" }, "state": { @@ -1043,6 +1048,10 @@ "$ref": "User", "description": "The user who created the message." }, + "slashCommand": { + "$ref": "SlashCommand", + "description": "Slash command information, if applicable." + }, "space": { "$ref": "Space", "description": "The space the message belongs to." @@ -1064,7 +1073,7 @@ "properties": { "action": { "$ref": "FormAction", - "description": "A form action will be trigger by this onclick if specified." + "description": "A form action will be triggered by this onclick if specified." }, "openLink": { "$ref": "OpenLink", @@ -1102,6 +1111,56 @@ }, "type": "object" }, + "SlashCommand": { + "description": "A Slash Command in Hangouts 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 bot 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 bot to space.", + "Invoke slash command in space." + ], + "type": "string" + } + }, + "type": "object" + }, "Space": { "description": "A room or DM in Hangouts Chat.", "id": "Space", diff --git a/src/apis/chat/v1.ts b/src/apis/chat/v1.ts index 40e46c6284f..20653a47b90 100644 --- a/src/apis/chat/v1.ts +++ b/src/apis/chat/v1.ts @@ -163,6 +163,10 @@ export namespace chat_v1 { * Length of the substring in the plain-text message body this annotation corresponds to. */ length?: number | null; + /** + * The metadata for a slash command. + */ + slashCommand?: Schema$SlashCommandMetadata; /** * Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to. */ @@ -288,7 +292,7 @@ export namespace chat_v1 { title?: string | null; } /** - * Hangouts Chat events. + * Google Chat events. */ export interface Schema$DeprecatedEvent { /** @@ -296,7 +300,7 @@ export namespace chat_v1 { */ action?: Schema$FormAction; /** - * The URL the bot should redirect the user to after they have completed an authorization or configuration flow outside of Hangouts Chat. See the [Authorizing access to 3p services guide](/hangouts/chat/how-tos/auth-3p) for more information. + * The URL the bot 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](/hangouts/chat/how-tos/auth-3p) for more information. */ configCompleteRedirectUrl?: string | null; /** @@ -316,7 +320,7 @@ export namespace chat_v1 { */ threadKey?: string | null; /** - * A secret value that bots can use to verify if a request is from Google. The token is randomly generated by Google, remains static, and can be obtained from the Hangouts Chat API configuration page in the Cloud Console. Developers can revoke/regenerate it if needed from the same page. + * A secret value that bots can use to verify if a request is from Google. The token is randomly generated by Google, remains static, and can be obtained from the Google Chat API configuration page in the Cloud Console. Developers can revoke/regenerate it if needed from the same page. */ token?: string | null; /** @@ -467,12 +471,9 @@ export namespace chat_v1 { */ createTime?: string | null; /** - * Member details. + * A User in Hangout Chat */ member?: Schema$User; - /** - * Resource name of the membership, in the form "spaces/x/members/*". Example: spaces/AAAAMpdlehY/members/105115627578887013105 - */ name?: string | null; /** * State of the membership. @@ -523,6 +524,10 @@ export namespace chat_v1 { * The user who created the message. */ sender?: Schema$User; + /** + * Slash command information, if applicable. + */ + slashCommand?: Schema$SlashCommand; /** * The space the message belongs to. */ @@ -541,7 +546,7 @@ export namespace chat_v1 { */ export interface Schema$OnClick { /** - * A form action will be trigger by this onclick if specified. + * A form action will be triggered by this onclick if specified. */ action?: Schema$FormAction; /** @@ -571,6 +576,40 @@ export namespace chat_v1 { */ widgets?: Schema$WidgetMarkup[]; } + /** + * A Slash Command in Hangouts Chat. + */ + export interface Schema$SlashCommand { + /** + * The id of the slash command invoked. + */ + commandId?: string | null; + } + /** + * Annotation metadata for slash commands (/). + */ + export interface Schema$SlashCommandMetadata { + /** + * The bot whose command was invoked. + */ + bot?: Schema$User; + /** + * The command id of the invoked slash command. + */ + commandId?: string | null; + /** + * The name of the invoked slash command. + */ + commandName?: string | null; + /** + * Indicating whether the slash command is for a dialog. + */ + triggersDialog?: boolean | null; + /** + * The type of slash command. + */ + type?: string | null; + } /** * A room or DM in Hangouts Chat. */ @@ -1475,6 +1514,7 @@ export namespace chat_v1 { * // "name": "my_name", * // "previewText": "my_previewText", * // "sender": {}, + * // "slashCommand": {}, * // "space": {}, * // "text": "my_text", * // "thread": {} @@ -1495,6 +1535,7 @@ export namespace chat_v1 { * // "name": "my_name", * // "previewText": "my_previewText", * // "sender": {}, + * // "slashCommand": {}, * // "space": {}, * // "text": "my_text", * // "thread": {} @@ -1766,6 +1807,7 @@ export namespace chat_v1 { * // "name": "my_name", * // "previewText": "my_previewText", * // "sender": {}, + * // "slashCommand": {}, * // "space": {}, * // "text": "my_text", * // "thread": {} @@ -1908,6 +1950,7 @@ export namespace chat_v1 { * // "name": "my_name", * // "previewText": "my_previewText", * // "sender": {}, + * // "slashCommand": {}, * // "space": {}, * // "text": "my_text", * // "thread": {} @@ -1928,6 +1971,7 @@ export namespace chat_v1 { * // "name": "my_name", * // "previewText": "my_previewText", * // "sender": {}, + * // "slashCommand": {}, * // "space": {}, * // "text": "my_text", * // "thread": {}