Skip to content

Commit

Permalink
feat(chat)!: update the API
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This release has breaking changes.
#### chat:v1
The following keys were deleted:
- schemas.Membership.properties.name.description

The following keys were added:
- schemas.Annotation.properties.slashCommand.$ref
- schemas.Annotation.properties.slashCommand.description
- schemas.Message.properties.slashCommand.$ref
- schemas.Message.properties.slashCommand.description
- schemas.SlashCommand.description
- schemas.SlashCommand.id
- schemas.SlashCommand.properties.commandId.description
- schemas.SlashCommand.properties.commandId.format
- schemas.SlashCommand.properties.commandId.type
- schemas.SlashCommand.type
- schemas.SlashCommandMetadata.description
- schemas.SlashCommandMetadata.id
- schemas.SlashCommandMetadata.properties.bot.$ref
- schemas.SlashCommandMetadata.properties.bot.description
- schemas.SlashCommandMetadata.properties.commandId.description
- schemas.SlashCommandMetadata.properties.commandId.format
- schemas.SlashCommandMetadata.properties.commandId.type
- schemas.SlashCommandMetadata.properties.commandName.description
- schemas.SlashCommandMetadata.properties.commandName.type
- schemas.SlashCommandMetadata.properties.triggersDialog.description
- schemas.SlashCommandMetadata.properties.triggersDialog.type
- schemas.SlashCommandMetadata.properties.type.description
- schemas.SlashCommandMetadata.properties.type.enum
- schemas.SlashCommandMetadata.properties.type.enumDescriptions
- schemas.SlashCommandMetadata.properties.type.type
- schemas.SlashCommandMetadata.type

The following keys were changed:
- schemas.Annotation.properties.type.enum
- schemas.Annotation.properties.type.enumDescriptions
- schemas.DeprecatedEvent.description
- schemas.DeprecatedEvent.properties.configCompleteRedirectUrl.description
- schemas.DeprecatedEvent.properties.token.description
- schemas.Membership.properties.member.description
- schemas.OnClick.properties.action.description
  • Loading branch information
JustinBeckwith committed Oct 5, 2020
1 parent c0648dd commit d3c5e3c
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 17 deletions.
77 changes: 68 additions & 9 deletions discovery/chat-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@
}
}
},
"revision": "20200801",
"revision": "20200927",
"rootUrl": "https://chat.googleapis.com/",
"schemas": {
"ActionParameter": {
Expand Down Expand Up @@ -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",
Expand All @@ -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"
},
Expand Down Expand Up @@ -602,15 +608,15 @@
"type": "object"
},
"DeprecatedEvent": {
"description": "Hangouts Chat events.",
"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](/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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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."
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
60 changes: 52 additions & 8 deletions src/apis/chat/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -288,15 +292,15 @@ export namespace chat_v1 {
title?: string | null;
}
/**
* Hangouts Chat events.
* Google Chat events.
*/
export interface Schema$DeprecatedEvent {
/**
* 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.
*/
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;
/**
Expand All @@ -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;
/**
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
*/
Expand All @@ -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;
/**
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -1475,6 +1514,7 @@ export namespace chat_v1 {
* // "name": "my_name",
* // "previewText": "my_previewText",
* // "sender": {},
* // "slashCommand": {},
* // "space": {},
* // "text": "my_text",
* // "thread": {}
Expand All @@ -1495,6 +1535,7 @@ export namespace chat_v1 {
* // "name": "my_name",
* // "previewText": "my_previewText",
* // "sender": {},
* // "slashCommand": {},
* // "space": {},
* // "text": "my_text",
* // "thread": {}
Expand Down Expand Up @@ -1766,6 +1807,7 @@ export namespace chat_v1 {
* // "name": "my_name",
* // "previewText": "my_previewText",
* // "sender": {},
* // "slashCommand": {},
* // "space": {},
* // "text": "my_text",
* // "thread": {}
Expand Down Expand Up @@ -1908,6 +1950,7 @@ export namespace chat_v1 {
* // "name": "my_name",
* // "previewText": "my_previewText",
* // "sender": {},
* // "slashCommand": {},
* // "space": {},
* // "text": "my_text",
* // "thread": {}
Expand All @@ -1928,6 +1971,7 @@ export namespace chat_v1 {
* // "name": "my_name",
* // "previewText": "my_previewText",
* // "sender": {},
* // "slashCommand": {},
* // "space": {},
* // "text": "my_text",
* // "thread": {}
Expand Down

0 comments on commit d3c5e3c

Please sign in to comment.