From acdb624fadc89f6543ec7c7436cbc1388a44acf4 Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 22 Nov 2024 19:18:07 +0000 Subject: [PATCH] feat(client-chatbot): Adds support for programmatic management of custom actions and aliases which can be associated with channel configurations. --- clients/client-chatbot/README.md | 78 +- clients/client-chatbot/package.json | 4 +- clients/client-chatbot/src/Chatbot.ts | 182 +++ clients/client-chatbot/src/ChatbotClient.ts | 30 + .../AssociateToConfigurationCommand.ts | 100 ++ .../src/commands/CreateCustomActionCommand.ts | 134 ++ .../src/commands/DeleteCustomActionCommand.ts | 102 ++ .../DisassociateFromConfigurationCommand.ts | 105 ++ .../src/commands/GetCustomActionCommand.ts | 127 ++ .../src/commands/ListAssociationsCommand.ts | 99 ++ .../src/commands/ListCustomActionsCommand.ts | 105 ++ .../src/commands/UpdateCustomActionCommand.ts | 124 ++ clients/client-chatbot/src/commands/index.ts | 8 + clients/client-chatbot/src/models/models_0.ts | 528 ++++++- .../pagination/ListAssociationsPaginator.ts | 24 + .../pagination/ListCustomActionsPaginator.ts | 24 + .../client-chatbot/src/pagination/index.ts | 2 + .../src/protocols/Aws_restJson1.ts | 433 +++++- codegen/sdk-codegen/aws-models/chatbot.json | 1302 ++++++++++++++++- 19 files changed, 3402 insertions(+), 109 deletions(-) create mode 100644 clients/client-chatbot/src/commands/AssociateToConfigurationCommand.ts create mode 100644 clients/client-chatbot/src/commands/CreateCustomActionCommand.ts create mode 100644 clients/client-chatbot/src/commands/DeleteCustomActionCommand.ts create mode 100644 clients/client-chatbot/src/commands/DisassociateFromConfigurationCommand.ts create mode 100644 clients/client-chatbot/src/commands/GetCustomActionCommand.ts create mode 100644 clients/client-chatbot/src/commands/ListAssociationsCommand.ts create mode 100644 clients/client-chatbot/src/commands/ListCustomActionsCommand.ts create mode 100644 clients/client-chatbot/src/commands/UpdateCustomActionCommand.ts create mode 100644 clients/client-chatbot/src/pagination/ListAssociationsPaginator.ts create mode 100644 clients/client-chatbot/src/pagination/ListCustomActionsPaginator.ts diff --git a/clients/client-chatbot/README.md b/clients/client-chatbot/README.md index 07fd924c0a728..61698a88917d0 100644 --- a/clients/client-chatbot/README.md +++ b/clients/client-chatbot/README.md @@ -46,16 +46,16 @@ using your favorite package manager: The AWS SDK is modulized by clients and commands. To send a request, you only need to import the `ChatbotClient` and -the commands you need, for example `ListTagsForResourceCommand`: +the commands you need, for example `ListCustomActionsCommand`: ```js // ES5 example -const { ChatbotClient, ListTagsForResourceCommand } = require("@aws-sdk/client-chatbot"); +const { ChatbotClient, ListCustomActionsCommand } = require("@aws-sdk/client-chatbot"); ``` ```ts // ES6+ example -import { ChatbotClient, ListTagsForResourceCommand } from "@aws-sdk/client-chatbot"; +import { ChatbotClient, ListCustomActionsCommand } from "@aws-sdk/client-chatbot"; ``` ### Usage @@ -74,7 +74,7 @@ const client = new ChatbotClient({ region: "REGION" }); const params = { /** input parameters */ }; -const command = new ListTagsForResourceCommand(params); +const command = new ListCustomActionsCommand(params); ``` #### Async/await @@ -153,7 +153,7 @@ const client = new AWS.Chatbot({ region: "REGION" }); // async/await. try { - const data = await client.listTagsForResource(params); + const data = await client.listCustomActions(params); // process data. } catch (error) { // error handling. @@ -161,7 +161,7 @@ try { // Promises. client - .listTagsForResource(params) + .listCustomActions(params) .then((data) => { // process data. }) @@ -170,7 +170,7 @@ client }); // callbacks. -client.listTagsForResource(params, (err, data) => { +client.listCustomActions(params, (err, data) => { // process err and data. }); ``` @@ -226,6 +226,14 @@ see LICENSE for more information. ## Client Commands (Operations List) +
+ +AssociateToConfiguration + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/AssociateToConfigurationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/AssociateToConfigurationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/AssociateToConfigurationCommandOutput/) + +
CreateChimeWebhookConfiguration @@ -233,6 +241,14 @@ CreateChimeWebhookConfiguration [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/CreateChimeWebhookConfigurationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/CreateChimeWebhookConfigurationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/CreateChimeWebhookConfigurationCommandOutput/) +
+
+ +CreateCustomAction + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/CreateCustomActionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/CreateCustomActionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/CreateCustomActionCommandOutput/) +
@@ -257,6 +273,14 @@ DeleteChimeWebhookConfiguration [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/DeleteChimeWebhookConfigurationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/DeleteChimeWebhookConfigurationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/DeleteChimeWebhookConfigurationCommandOutput/) +
+
+ +DeleteCustomAction + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/DeleteCustomActionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/DeleteCustomActionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/DeleteCustomActionCommandOutput/) +
@@ -337,6 +361,14 @@ DescribeSlackWorkspaces [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/DescribeSlackWorkspacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/DescribeSlackWorkspacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/DescribeSlackWorkspacesCommandOutput/) +
+
+ +DisassociateFromConfiguration + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/DisassociateFromConfigurationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/DisassociateFromConfigurationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/DisassociateFromConfigurationCommandOutput/) +
@@ -345,6 +377,14 @@ GetAccountPreferences [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/GetAccountPreferencesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/GetAccountPreferencesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/GetAccountPreferencesCommandOutput/) +
+
+ +GetCustomAction + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/GetCustomActionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/GetCustomActionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/GetCustomActionCommandOutput/) +
@@ -353,6 +393,22 @@ GetMicrosoftTeamsChannelConfiguration [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/GetMicrosoftTeamsChannelConfigurationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/GetMicrosoftTeamsChannelConfigurationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/GetMicrosoftTeamsChannelConfigurationCommandOutput/) +
+
+ +ListAssociations + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/ListAssociationsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/ListAssociationsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/ListAssociationsCommandOutput/) + +
+
+ +ListCustomActions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/ListCustomActionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/ListCustomActionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/ListCustomActionsCommandOutput/) +
@@ -417,6 +473,14 @@ UpdateChimeWebhookConfiguration [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/UpdateChimeWebhookConfigurationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/UpdateChimeWebhookConfigurationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/UpdateChimeWebhookConfigurationCommandOutput/) +
+
+ +UpdateCustomAction + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/chatbot/command/UpdateCustomActionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/UpdateCustomActionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-chatbot/Interface/UpdateCustomActionCommandOutput/) +
diff --git a/clients/client-chatbot/package.json b/clients/client-chatbot/package.json index b6e7285236c7c..7ed599be39231 100644 --- a/clients/client-chatbot/package.json +++ b/clients/client-chatbot/package.json @@ -58,7 +58,9 @@ "@smithy/util-middleware": "^3.0.10", "@smithy/util-retry": "^3.0.10", "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" }, "devDependencies": { "@tsconfig/node16": "16.1.3", diff --git a/clients/client-chatbot/src/Chatbot.ts b/clients/client-chatbot/src/Chatbot.ts index 22f99f4360d66..7ed3af48d4a33 100644 --- a/clients/client-chatbot/src/Chatbot.ts +++ b/clients/client-chatbot/src/Chatbot.ts @@ -3,11 +3,21 @@ import { createAggregatedClient } from "@smithy/smithy-client"; import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; import { ChatbotClient, ChatbotClientConfig } from "./ChatbotClient"; +import { + AssociateToConfigurationCommand, + AssociateToConfigurationCommandInput, + AssociateToConfigurationCommandOutput, +} from "./commands/AssociateToConfigurationCommand"; import { CreateChimeWebhookConfigurationCommand, CreateChimeWebhookConfigurationCommandInput, CreateChimeWebhookConfigurationCommandOutput, } from "./commands/CreateChimeWebhookConfigurationCommand"; +import { + CreateCustomActionCommand, + CreateCustomActionCommandInput, + CreateCustomActionCommandOutput, +} from "./commands/CreateCustomActionCommand"; import { CreateMicrosoftTeamsChannelConfigurationCommand, CreateMicrosoftTeamsChannelConfigurationCommandInput, @@ -23,6 +33,11 @@ import { DeleteChimeWebhookConfigurationCommandInput, DeleteChimeWebhookConfigurationCommandOutput, } from "./commands/DeleteChimeWebhookConfigurationCommand"; +import { + DeleteCustomActionCommand, + DeleteCustomActionCommandInput, + DeleteCustomActionCommandOutput, +} from "./commands/DeleteCustomActionCommand"; import { DeleteMicrosoftTeamsChannelConfigurationCommand, DeleteMicrosoftTeamsChannelConfigurationCommandInput, @@ -73,16 +88,36 @@ import { DescribeSlackWorkspacesCommandInput, DescribeSlackWorkspacesCommandOutput, } from "./commands/DescribeSlackWorkspacesCommand"; +import { + DisassociateFromConfigurationCommand, + DisassociateFromConfigurationCommandInput, + DisassociateFromConfigurationCommandOutput, +} from "./commands/DisassociateFromConfigurationCommand"; import { GetAccountPreferencesCommand, GetAccountPreferencesCommandInput, GetAccountPreferencesCommandOutput, } from "./commands/GetAccountPreferencesCommand"; +import { + GetCustomActionCommand, + GetCustomActionCommandInput, + GetCustomActionCommandOutput, +} from "./commands/GetCustomActionCommand"; import { GetMicrosoftTeamsChannelConfigurationCommand, GetMicrosoftTeamsChannelConfigurationCommandInput, GetMicrosoftTeamsChannelConfigurationCommandOutput, } from "./commands/GetMicrosoftTeamsChannelConfigurationCommand"; +import { + ListAssociationsCommand, + ListAssociationsCommandInput, + ListAssociationsCommandOutput, +} from "./commands/ListAssociationsCommand"; +import { + ListCustomActionsCommand, + ListCustomActionsCommandInput, + ListCustomActionsCommandOutput, +} from "./commands/ListCustomActionsCommand"; import { ListMicrosoftTeamsChannelConfigurationsCommand, ListMicrosoftTeamsChannelConfigurationsCommandInput, @@ -119,6 +154,11 @@ import { UpdateChimeWebhookConfigurationCommandInput, UpdateChimeWebhookConfigurationCommandOutput, } from "./commands/UpdateChimeWebhookConfigurationCommand"; +import { + UpdateCustomActionCommand, + UpdateCustomActionCommandInput, + UpdateCustomActionCommandOutput, +} from "./commands/UpdateCustomActionCommand"; import { UpdateMicrosoftTeamsChannelConfigurationCommand, UpdateMicrosoftTeamsChannelConfigurationCommandInput, @@ -131,10 +171,13 @@ import { } from "./commands/UpdateSlackChannelConfigurationCommand"; const commands = { + AssociateToConfigurationCommand, CreateChimeWebhookConfigurationCommand, + CreateCustomActionCommand, CreateMicrosoftTeamsChannelConfigurationCommand, CreateSlackChannelConfigurationCommand, DeleteChimeWebhookConfigurationCommand, + DeleteCustomActionCommand, DeleteMicrosoftTeamsChannelConfigurationCommand, DeleteMicrosoftTeamsConfiguredTeamCommand, DeleteMicrosoftTeamsUserIdentityCommand, @@ -145,8 +188,12 @@ const commands = { DescribeSlackChannelConfigurationsCommand, DescribeSlackUserIdentitiesCommand, DescribeSlackWorkspacesCommand, + DisassociateFromConfigurationCommand, GetAccountPreferencesCommand, + GetCustomActionCommand, GetMicrosoftTeamsChannelConfigurationCommand, + ListAssociationsCommand, + ListCustomActionsCommand, ListMicrosoftTeamsChannelConfigurationsCommand, ListMicrosoftTeamsConfiguredTeamsCommand, ListMicrosoftTeamsUserIdentitiesCommand, @@ -155,11 +202,29 @@ const commands = { UntagResourceCommand, UpdateAccountPreferencesCommand, UpdateChimeWebhookConfigurationCommand, + UpdateCustomActionCommand, UpdateMicrosoftTeamsChannelConfigurationCommand, UpdateSlackChannelConfigurationCommand, }; export interface Chatbot { + /** + * @see {@link AssociateToConfigurationCommand} + */ + associateToConfiguration( + args: AssociateToConfigurationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + associateToConfiguration( + args: AssociateToConfigurationCommandInput, + cb: (err: any, data?: AssociateToConfigurationCommandOutput) => void + ): void; + associateToConfiguration( + args: AssociateToConfigurationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: AssociateToConfigurationCommandOutput) => void + ): void; + /** * @see {@link CreateChimeWebhookConfigurationCommand} */ @@ -177,6 +242,23 @@ export interface Chatbot { cb: (err: any, data?: CreateChimeWebhookConfigurationCommandOutput) => void ): void; + /** + * @see {@link CreateCustomActionCommand} + */ + createCustomAction( + args: CreateCustomActionCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createCustomAction( + args: CreateCustomActionCommandInput, + cb: (err: any, data?: CreateCustomActionCommandOutput) => void + ): void; + createCustomAction( + args: CreateCustomActionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateCustomActionCommandOutput) => void + ): void; + /** * @see {@link CreateMicrosoftTeamsChannelConfigurationCommand} */ @@ -228,6 +310,23 @@ export interface Chatbot { cb: (err: any, data?: DeleteChimeWebhookConfigurationCommandOutput) => void ): void; + /** + * @see {@link DeleteCustomActionCommand} + */ + deleteCustomAction( + args: DeleteCustomActionCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteCustomAction( + args: DeleteCustomActionCommandInput, + cb: (err: any, data?: DeleteCustomActionCommandOutput) => void + ): void; + deleteCustomAction( + args: DeleteCustomActionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteCustomActionCommandOutput) => void + ): void; + /** * @see {@link DeleteMicrosoftTeamsChannelConfigurationCommand} */ @@ -402,6 +501,23 @@ export interface Chatbot { cb: (err: any, data?: DescribeSlackWorkspacesCommandOutput) => void ): void; + /** + * @see {@link DisassociateFromConfigurationCommand} + */ + disassociateFromConfiguration( + args: DisassociateFromConfigurationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + disassociateFromConfiguration( + args: DisassociateFromConfigurationCommandInput, + cb: (err: any, data?: DisassociateFromConfigurationCommandOutput) => void + ): void; + disassociateFromConfiguration( + args: DisassociateFromConfigurationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DisassociateFromConfigurationCommandOutput) => void + ): void; + /** * @see {@link GetAccountPreferencesCommand} */ @@ -420,6 +536,20 @@ export interface Chatbot { cb: (err: any, data?: GetAccountPreferencesCommandOutput) => void ): void; + /** + * @see {@link GetCustomActionCommand} + */ + getCustomAction( + args: GetCustomActionCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getCustomAction(args: GetCustomActionCommandInput, cb: (err: any, data?: GetCustomActionCommandOutput) => void): void; + getCustomAction( + args: GetCustomActionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetCustomActionCommandOutput) => void + ): void; + /** * @see {@link GetMicrosoftTeamsChannelConfigurationCommand} */ @@ -437,6 +567,41 @@ export interface Chatbot { cb: (err: any, data?: GetMicrosoftTeamsChannelConfigurationCommandOutput) => void ): void; + /** + * @see {@link ListAssociationsCommand} + */ + listAssociations( + args: ListAssociationsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listAssociations( + args: ListAssociationsCommandInput, + cb: (err: any, data?: ListAssociationsCommandOutput) => void + ): void; + listAssociations( + args: ListAssociationsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListAssociationsCommandOutput) => void + ): void; + + /** + * @see {@link ListCustomActionsCommand} + */ + listCustomActions(): Promise; + listCustomActions( + args: ListCustomActionsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listCustomActions( + args: ListCustomActionsCommandInput, + cb: (err: any, data?: ListCustomActionsCommandOutput) => void + ): void; + listCustomActions( + args: ListCustomActionsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListCustomActionsCommandOutput) => void + ): void; + /** * @see {@link ListMicrosoftTeamsChannelConfigurationsCommand} */ @@ -565,6 +730,23 @@ export interface Chatbot { cb: (err: any, data?: UpdateChimeWebhookConfigurationCommandOutput) => void ): void; + /** + * @see {@link UpdateCustomActionCommand} + */ + updateCustomAction( + args: UpdateCustomActionCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateCustomAction( + args: UpdateCustomActionCommandInput, + cb: (err: any, data?: UpdateCustomActionCommandOutput) => void + ): void; + updateCustomAction( + args: UpdateCustomActionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateCustomActionCommandOutput) => void + ): void; + /** * @see {@link UpdateMicrosoftTeamsChannelConfigurationCommand} */ diff --git a/clients/client-chatbot/src/ChatbotClient.ts b/clients/client-chatbot/src/ChatbotClient.ts index ffbff31a020a0..f2d814d1ad8fd 100644 --- a/clients/client-chatbot/src/ChatbotClient.ts +++ b/clients/client-chatbot/src/ChatbotClient.ts @@ -53,10 +53,15 @@ import { HttpAuthSchemeResolvedConfig, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider"; +import { + AssociateToConfigurationCommandInput, + AssociateToConfigurationCommandOutput, +} from "./commands/AssociateToConfigurationCommand"; import { CreateChimeWebhookConfigurationCommandInput, CreateChimeWebhookConfigurationCommandOutput, } from "./commands/CreateChimeWebhookConfigurationCommand"; +import { CreateCustomActionCommandInput, CreateCustomActionCommandOutput } from "./commands/CreateCustomActionCommand"; import { CreateMicrosoftTeamsChannelConfigurationCommandInput, CreateMicrosoftTeamsChannelConfigurationCommandOutput, @@ -69,6 +74,7 @@ import { DeleteChimeWebhookConfigurationCommandInput, DeleteChimeWebhookConfigurationCommandOutput, } from "./commands/DeleteChimeWebhookConfigurationCommand"; +import { DeleteCustomActionCommandInput, DeleteCustomActionCommandOutput } from "./commands/DeleteCustomActionCommand"; import { DeleteMicrosoftTeamsChannelConfigurationCommandInput, DeleteMicrosoftTeamsChannelConfigurationCommandOutput, @@ -109,14 +115,21 @@ import { DescribeSlackWorkspacesCommandInput, DescribeSlackWorkspacesCommandOutput, } from "./commands/DescribeSlackWorkspacesCommand"; +import { + DisassociateFromConfigurationCommandInput, + DisassociateFromConfigurationCommandOutput, +} from "./commands/DisassociateFromConfigurationCommand"; import { GetAccountPreferencesCommandInput, GetAccountPreferencesCommandOutput, } from "./commands/GetAccountPreferencesCommand"; +import { GetCustomActionCommandInput, GetCustomActionCommandOutput } from "./commands/GetCustomActionCommand"; import { GetMicrosoftTeamsChannelConfigurationCommandInput, GetMicrosoftTeamsChannelConfigurationCommandOutput, } from "./commands/GetMicrosoftTeamsChannelConfigurationCommand"; +import { ListAssociationsCommandInput, ListAssociationsCommandOutput } from "./commands/ListAssociationsCommand"; +import { ListCustomActionsCommandInput, ListCustomActionsCommandOutput } from "./commands/ListCustomActionsCommand"; import { ListMicrosoftTeamsChannelConfigurationsCommandInput, ListMicrosoftTeamsChannelConfigurationsCommandOutput, @@ -143,6 +156,7 @@ import { UpdateChimeWebhookConfigurationCommandInput, UpdateChimeWebhookConfigurationCommandOutput, } from "./commands/UpdateChimeWebhookConfigurationCommand"; +import { UpdateCustomActionCommandInput, UpdateCustomActionCommandOutput } from "./commands/UpdateCustomActionCommand"; import { UpdateMicrosoftTeamsChannelConfigurationCommandInput, UpdateMicrosoftTeamsChannelConfigurationCommandOutput, @@ -166,10 +180,13 @@ export { __Client }; * @public */ export type ServiceInputTypes = + | AssociateToConfigurationCommandInput | CreateChimeWebhookConfigurationCommandInput + | CreateCustomActionCommandInput | CreateMicrosoftTeamsChannelConfigurationCommandInput | CreateSlackChannelConfigurationCommandInput | DeleteChimeWebhookConfigurationCommandInput + | DeleteCustomActionCommandInput | DeleteMicrosoftTeamsChannelConfigurationCommandInput | DeleteMicrosoftTeamsConfiguredTeamCommandInput | DeleteMicrosoftTeamsUserIdentityCommandInput @@ -180,8 +197,12 @@ export type ServiceInputTypes = | DescribeSlackChannelConfigurationsCommandInput | DescribeSlackUserIdentitiesCommandInput | DescribeSlackWorkspacesCommandInput + | DisassociateFromConfigurationCommandInput | GetAccountPreferencesCommandInput + | GetCustomActionCommandInput | GetMicrosoftTeamsChannelConfigurationCommandInput + | ListAssociationsCommandInput + | ListCustomActionsCommandInput | ListMicrosoftTeamsChannelConfigurationsCommandInput | ListMicrosoftTeamsConfiguredTeamsCommandInput | ListMicrosoftTeamsUserIdentitiesCommandInput @@ -190,6 +211,7 @@ export type ServiceInputTypes = | UntagResourceCommandInput | UpdateAccountPreferencesCommandInput | UpdateChimeWebhookConfigurationCommandInput + | UpdateCustomActionCommandInput | UpdateMicrosoftTeamsChannelConfigurationCommandInput | UpdateSlackChannelConfigurationCommandInput; @@ -197,10 +219,13 @@ export type ServiceInputTypes = * @public */ export type ServiceOutputTypes = + | AssociateToConfigurationCommandOutput | CreateChimeWebhookConfigurationCommandOutput + | CreateCustomActionCommandOutput | CreateMicrosoftTeamsChannelConfigurationCommandOutput | CreateSlackChannelConfigurationCommandOutput | DeleteChimeWebhookConfigurationCommandOutput + | DeleteCustomActionCommandOutput | DeleteMicrosoftTeamsChannelConfigurationCommandOutput | DeleteMicrosoftTeamsConfiguredTeamCommandOutput | DeleteMicrosoftTeamsUserIdentityCommandOutput @@ -211,8 +236,12 @@ export type ServiceOutputTypes = | DescribeSlackChannelConfigurationsCommandOutput | DescribeSlackUserIdentitiesCommandOutput | DescribeSlackWorkspacesCommandOutput + | DisassociateFromConfigurationCommandOutput | GetAccountPreferencesCommandOutput + | GetCustomActionCommandOutput | GetMicrosoftTeamsChannelConfigurationCommandOutput + | ListAssociationsCommandOutput + | ListCustomActionsCommandOutput | ListMicrosoftTeamsChannelConfigurationsCommandOutput | ListMicrosoftTeamsConfiguredTeamsCommandOutput | ListMicrosoftTeamsUserIdentitiesCommandOutput @@ -221,6 +250,7 @@ export type ServiceOutputTypes = | UntagResourceCommandOutput | UpdateAccountPreferencesCommandOutput | UpdateChimeWebhookConfigurationCommandOutput + | UpdateCustomActionCommandOutput | UpdateMicrosoftTeamsChannelConfigurationCommandOutput | UpdateSlackChannelConfigurationCommandOutput; diff --git a/clients/client-chatbot/src/commands/AssociateToConfigurationCommand.ts b/clients/client-chatbot/src/commands/AssociateToConfigurationCommand.ts new file mode 100644 index 0000000000000..444da3292fe3f --- /dev/null +++ b/clients/client-chatbot/src/commands/AssociateToConfigurationCommand.ts @@ -0,0 +1,100 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ChatbotClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ChatbotClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { AssociateToConfigurationRequest, AssociateToConfigurationResult } from "../models/models_0"; +import { de_AssociateToConfigurationCommand, se_AssociateToConfigurationCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link AssociateToConfigurationCommand}. + */ +export interface AssociateToConfigurationCommandInput extends AssociateToConfigurationRequest {} +/** + * @public + * + * The output of {@link AssociateToConfigurationCommand}. + */ +export interface AssociateToConfigurationCommandOutput extends AssociateToConfigurationResult, __MetadataBearer {} + +/** + *

Links a resource (for example, a custom action) to a channel configuration.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ChatbotClient, AssociateToConfigurationCommand } from "@aws-sdk/client-chatbot"; // ES Modules import + * // const { ChatbotClient, AssociateToConfigurationCommand } = require("@aws-sdk/client-chatbot"); // CommonJS import + * const client = new ChatbotClient(config); + * const input = { // AssociateToConfigurationRequest + * Resource: "STRING_VALUE", // required + * ChatConfiguration: "STRING_VALUE", // required + * }; + * const command = new AssociateToConfigurationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param AssociateToConfigurationCommandInput - {@link AssociateToConfigurationCommandInput} + * @returns {@link AssociateToConfigurationCommandOutput} + * @see {@link AssociateToConfigurationCommandInput} for command's `input` shape. + * @see {@link AssociateToConfigurationCommandOutput} for command's `response` shape. + * @see {@link ChatbotClientResolvedConfig | config} for ChatbotClient's `config` shape. + * + * @throws {@link InternalServiceError} (server fault) + *

Unexpected error during processing of request.

+ * + * @throws {@link InvalidRequestException} (client fault) + *

Your request input doesn't meet the constraints required by AWS Chatbot.

+ * + * @throws {@link UnauthorizedException} (client fault) + *

The request was rejected because it doesn't have valid credentials for the target resource.

+ * + * @throws {@link ChatbotServiceException} + *

Base exception class for all service exceptions from Chatbot service.

+ * + * @public + */ +export class AssociateToConfigurationCommand extends $Command + .classBuilder< + AssociateToConfigurationCommandInput, + AssociateToConfigurationCommandOutput, + ChatbotClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: ChatbotClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("WheatleyOrchestration_20171011", "AssociateToConfiguration", {}) + .n("ChatbotClient", "AssociateToConfigurationCommand") + .f(void 0, void 0) + .ser(se_AssociateToConfigurationCommand) + .de(de_AssociateToConfigurationCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: AssociateToConfigurationRequest; + output: {}; + }; + sdk: { + input: AssociateToConfigurationCommandInput; + output: AssociateToConfigurationCommandOutput; + }; + }; +} diff --git a/clients/client-chatbot/src/commands/CreateCustomActionCommand.ts b/clients/client-chatbot/src/commands/CreateCustomActionCommand.ts new file mode 100644 index 0000000000000..8a4a84199e1b2 --- /dev/null +++ b/clients/client-chatbot/src/commands/CreateCustomActionCommand.ts @@ -0,0 +1,134 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ChatbotClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ChatbotClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { CreateCustomActionRequest, CreateCustomActionResult } from "../models/models_0"; +import { de_CreateCustomActionCommand, se_CreateCustomActionCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link CreateCustomActionCommand}. + */ +export interface CreateCustomActionCommandInput extends CreateCustomActionRequest {} +/** + * @public + * + * The output of {@link CreateCustomActionCommand}. + */ +export interface CreateCustomActionCommandOutput extends CreateCustomActionResult, __MetadataBearer {} + +/** + *

Creates a custom action that can be invoked as an alias or as a button on a notification.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ChatbotClient, CreateCustomActionCommand } from "@aws-sdk/client-chatbot"; // ES Modules import + * // const { ChatbotClient, CreateCustomActionCommand } = require("@aws-sdk/client-chatbot"); // CommonJS import + * const client = new ChatbotClient(config); + * const input = { // CreateCustomActionRequest + * Definition: { // CustomActionDefinition + * CommandText: "STRING_VALUE", // required + * }, + * AliasName: "STRING_VALUE", + * Attachments: [ // CustomActionAttachmentList + * { // CustomActionAttachment + * NotificationType: "STRING_VALUE", + * ButtonText: "STRING_VALUE", + * Criteria: [ // CustomActionAttachmentCriteriaList + * { // CustomActionAttachmentCriteria + * Operator: "HAS_VALUE" || "EQUALS", // required + * VariableName: "STRING_VALUE", // required + * Value: "STRING_VALUE", + * }, + * ], + * Variables: { // CustomActionAttachmentVariables + * "": "STRING_VALUE", + * }, + * }, + * ], + * Tags: [ // TagList + * { // Tag + * TagKey: "STRING_VALUE", // required + * TagValue: "STRING_VALUE", // required + * }, + * ], + * ClientToken: "STRING_VALUE", + * ActionName: "STRING_VALUE", // required + * }; + * const command = new CreateCustomActionCommand(input); + * const response = await client.send(command); + * // { // CreateCustomActionResult + * // CustomActionArn: "STRING_VALUE", // required + * // }; + * + * ``` + * + * @param CreateCustomActionCommandInput - {@link CreateCustomActionCommandInput} + * @returns {@link CreateCustomActionCommandOutput} + * @see {@link CreateCustomActionCommandInput} for command's `input` shape. + * @see {@link CreateCustomActionCommandOutput} for command's `response` shape. + * @see {@link ChatbotClientResolvedConfig | config} for ChatbotClient's `config` shape. + * + * @throws {@link ConflictException} (client fault) + *

There was an issue processing your request.

+ * + * @throws {@link InternalServiceError} (server fault) + *

Unexpected error during processing of request.

+ * + * @throws {@link InvalidRequestException} (client fault) + *

Your request input doesn't meet the constraints required by AWS Chatbot.

+ * + * @throws {@link LimitExceededException} (client fault) + *

You have exceeded a service limit for AWS Chatbot.

+ * + * @throws {@link UnauthorizedException} (client fault) + *

The request was rejected because it doesn't have valid credentials for the target resource.

+ * + * @throws {@link ChatbotServiceException} + *

Base exception class for all service exceptions from Chatbot service.

+ * + * @public + */ +export class CreateCustomActionCommand extends $Command + .classBuilder< + CreateCustomActionCommandInput, + CreateCustomActionCommandOutput, + ChatbotClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: ChatbotClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("WheatleyOrchestration_20171011", "CreateCustomAction", {}) + .n("ChatbotClient", "CreateCustomActionCommand") + .f(void 0, void 0) + .ser(se_CreateCustomActionCommand) + .de(de_CreateCustomActionCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: CreateCustomActionRequest; + output: CreateCustomActionResult; + }; + sdk: { + input: CreateCustomActionCommandInput; + output: CreateCustomActionCommandOutput; + }; + }; +} diff --git a/clients/client-chatbot/src/commands/DeleteCustomActionCommand.ts b/clients/client-chatbot/src/commands/DeleteCustomActionCommand.ts new file mode 100644 index 0000000000000..5474e8874ee6f --- /dev/null +++ b/clients/client-chatbot/src/commands/DeleteCustomActionCommand.ts @@ -0,0 +1,102 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ChatbotClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ChatbotClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { DeleteCustomActionRequest, DeleteCustomActionResult } from "../models/models_0"; +import { de_DeleteCustomActionCommand, se_DeleteCustomActionCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DeleteCustomActionCommand}. + */ +export interface DeleteCustomActionCommandInput extends DeleteCustomActionRequest {} +/** + * @public + * + * The output of {@link DeleteCustomActionCommand}. + */ +export interface DeleteCustomActionCommandOutput extends DeleteCustomActionResult, __MetadataBearer {} + +/** + *

Deletes a custom action.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ChatbotClient, DeleteCustomActionCommand } from "@aws-sdk/client-chatbot"; // ES Modules import + * // const { ChatbotClient, DeleteCustomActionCommand } = require("@aws-sdk/client-chatbot"); // CommonJS import + * const client = new ChatbotClient(config); + * const input = { // DeleteCustomActionRequest + * CustomActionArn: "STRING_VALUE", // required + * }; + * const command = new DeleteCustomActionCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteCustomActionCommandInput - {@link DeleteCustomActionCommandInput} + * @returns {@link DeleteCustomActionCommandOutput} + * @see {@link DeleteCustomActionCommandInput} for command's `input` shape. + * @see {@link DeleteCustomActionCommandOutput} for command's `response` shape. + * @see {@link ChatbotClientResolvedConfig | config} for ChatbotClient's `config` shape. + * + * @throws {@link InternalServiceError} (server fault) + *

Unexpected error during processing of request.

+ * + * @throws {@link InvalidRequestException} (client fault) + *

Your request input doesn't meet the constraints required by AWS Chatbot.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

We were unable to find the resource for your request

+ * + * @throws {@link UnauthorizedException} (client fault) + *

The request was rejected because it doesn't have valid credentials for the target resource.

+ * + * @throws {@link ChatbotServiceException} + *

Base exception class for all service exceptions from Chatbot service.

+ * + * @public + */ +export class DeleteCustomActionCommand extends $Command + .classBuilder< + DeleteCustomActionCommandInput, + DeleteCustomActionCommandOutput, + ChatbotClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: ChatbotClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("WheatleyOrchestration_20171011", "DeleteCustomAction", {}) + .n("ChatbotClient", "DeleteCustomActionCommand") + .f(void 0, void 0) + .ser(se_DeleteCustomActionCommand) + .de(de_DeleteCustomActionCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DeleteCustomActionRequest; + output: {}; + }; + sdk: { + input: DeleteCustomActionCommandInput; + output: DeleteCustomActionCommandOutput; + }; + }; +} diff --git a/clients/client-chatbot/src/commands/DisassociateFromConfigurationCommand.ts b/clients/client-chatbot/src/commands/DisassociateFromConfigurationCommand.ts new file mode 100644 index 0000000000000..d6525aca9d62a --- /dev/null +++ b/clients/client-chatbot/src/commands/DisassociateFromConfigurationCommand.ts @@ -0,0 +1,105 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ChatbotClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ChatbotClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { DisassociateFromConfigurationRequest, DisassociateFromConfigurationResult } from "../models/models_0"; +import { + de_DisassociateFromConfigurationCommand, + se_DisassociateFromConfigurationCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DisassociateFromConfigurationCommand}. + */ +export interface DisassociateFromConfigurationCommandInput extends DisassociateFromConfigurationRequest {} +/** + * @public + * + * The output of {@link DisassociateFromConfigurationCommand}. + */ +export interface DisassociateFromConfigurationCommandOutput + extends DisassociateFromConfigurationResult, + __MetadataBearer {} + +/** + *

Unlink a resource, for example a custom action, from a channel configuration.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ChatbotClient, DisassociateFromConfigurationCommand } from "@aws-sdk/client-chatbot"; // ES Modules import + * // const { ChatbotClient, DisassociateFromConfigurationCommand } = require("@aws-sdk/client-chatbot"); // CommonJS import + * const client = new ChatbotClient(config); + * const input = { // DisassociateFromConfigurationRequest + * Resource: "STRING_VALUE", // required + * ChatConfiguration: "STRING_VALUE", // required + * }; + * const command = new DisassociateFromConfigurationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DisassociateFromConfigurationCommandInput - {@link DisassociateFromConfigurationCommandInput} + * @returns {@link DisassociateFromConfigurationCommandOutput} + * @see {@link DisassociateFromConfigurationCommandInput} for command's `input` shape. + * @see {@link DisassociateFromConfigurationCommandOutput} for command's `response` shape. + * @see {@link ChatbotClientResolvedConfig | config} for ChatbotClient's `config` shape. + * + * @throws {@link InternalServiceError} (server fault) + *

Unexpected error during processing of request.

+ * + * @throws {@link InvalidRequestException} (client fault) + *

Your request input doesn't meet the constraints required by AWS Chatbot.

+ * + * @throws {@link UnauthorizedException} (client fault) + *

The request was rejected because it doesn't have valid credentials for the target resource.

+ * + * @throws {@link ChatbotServiceException} + *

Base exception class for all service exceptions from Chatbot service.

+ * + * @public + */ +export class DisassociateFromConfigurationCommand extends $Command + .classBuilder< + DisassociateFromConfigurationCommandInput, + DisassociateFromConfigurationCommandOutput, + ChatbotClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: ChatbotClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("WheatleyOrchestration_20171011", "DisassociateFromConfiguration", {}) + .n("ChatbotClient", "DisassociateFromConfigurationCommand") + .f(void 0, void 0) + .ser(se_DisassociateFromConfigurationCommand) + .de(de_DisassociateFromConfigurationCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DisassociateFromConfigurationRequest; + output: {}; + }; + sdk: { + input: DisassociateFromConfigurationCommandInput; + output: DisassociateFromConfigurationCommandOutput; + }; + }; +} diff --git a/clients/client-chatbot/src/commands/GetCustomActionCommand.ts b/clients/client-chatbot/src/commands/GetCustomActionCommand.ts new file mode 100644 index 0000000000000..60ac0752a4bd1 --- /dev/null +++ b/clients/client-chatbot/src/commands/GetCustomActionCommand.ts @@ -0,0 +1,127 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ChatbotClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ChatbotClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { GetCustomActionRequest, GetCustomActionResult } from "../models/models_0"; +import { de_GetCustomActionCommand, se_GetCustomActionCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetCustomActionCommand}. + */ +export interface GetCustomActionCommandInput extends GetCustomActionRequest {} +/** + * @public + * + * The output of {@link GetCustomActionCommand}. + */ +export interface GetCustomActionCommandOutput extends GetCustomActionResult, __MetadataBearer {} + +/** + *

Returns a custom action.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ChatbotClient, GetCustomActionCommand } from "@aws-sdk/client-chatbot"; // ES Modules import + * // const { ChatbotClient, GetCustomActionCommand } = require("@aws-sdk/client-chatbot"); // CommonJS import + * const client = new ChatbotClient(config); + * const input = { // GetCustomActionRequest + * CustomActionArn: "STRING_VALUE", // required + * }; + * const command = new GetCustomActionCommand(input); + * const response = await client.send(command); + * // { // GetCustomActionResult + * // CustomAction: { // CustomAction + * // CustomActionArn: "STRING_VALUE", // required + * // Definition: { // CustomActionDefinition + * // CommandText: "STRING_VALUE", // required + * // }, + * // AliasName: "STRING_VALUE", + * // Attachments: [ // CustomActionAttachmentList + * // { // CustomActionAttachment + * // NotificationType: "STRING_VALUE", + * // ButtonText: "STRING_VALUE", + * // Criteria: [ // CustomActionAttachmentCriteriaList + * // { // CustomActionAttachmentCriteria + * // Operator: "HAS_VALUE" || "EQUALS", // required + * // VariableName: "STRING_VALUE", // required + * // Value: "STRING_VALUE", + * // }, + * // ], + * // Variables: { // CustomActionAttachmentVariables + * // "": "STRING_VALUE", + * // }, + * // }, + * // ], + * // ActionName: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param GetCustomActionCommandInput - {@link GetCustomActionCommandInput} + * @returns {@link GetCustomActionCommandOutput} + * @see {@link GetCustomActionCommandInput} for command's `input` shape. + * @see {@link GetCustomActionCommandOutput} for command's `response` shape. + * @see {@link ChatbotClientResolvedConfig | config} for ChatbotClient's `config` shape. + * + * @throws {@link InternalServiceError} (server fault) + *

Unexpected error during processing of request.

+ * + * @throws {@link InvalidRequestException} (client fault) + *

Your request input doesn't meet the constraints required by AWS Chatbot.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

We were unable to find the resource for your request

+ * + * @throws {@link UnauthorizedException} (client fault) + *

The request was rejected because it doesn't have valid credentials for the target resource.

+ * + * @throws {@link ChatbotServiceException} + *

Base exception class for all service exceptions from Chatbot service.

+ * + * @public + */ +export class GetCustomActionCommand extends $Command + .classBuilder< + GetCustomActionCommandInput, + GetCustomActionCommandOutput, + ChatbotClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: ChatbotClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("WheatleyOrchestration_20171011", "GetCustomAction", {}) + .n("ChatbotClient", "GetCustomActionCommand") + .f(void 0, void 0) + .ser(se_GetCustomActionCommand) + .de(de_GetCustomActionCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetCustomActionRequest; + output: GetCustomActionResult; + }; + sdk: { + input: GetCustomActionCommandInput; + output: GetCustomActionCommandOutput; + }; + }; +} diff --git a/clients/client-chatbot/src/commands/ListAssociationsCommand.ts b/clients/client-chatbot/src/commands/ListAssociationsCommand.ts new file mode 100644 index 0000000000000..0de071947b63c --- /dev/null +++ b/clients/client-chatbot/src/commands/ListAssociationsCommand.ts @@ -0,0 +1,99 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ChatbotClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ChatbotClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { ListAssociationsRequest, ListAssociationsResult } from "../models/models_0"; +import { de_ListAssociationsCommand, se_ListAssociationsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListAssociationsCommand}. + */ +export interface ListAssociationsCommandInput extends ListAssociationsRequest {} +/** + * @public + * + * The output of {@link ListAssociationsCommand}. + */ +export interface ListAssociationsCommandOutput extends ListAssociationsResult, __MetadataBearer {} + +/** + *

Lists resources associated with a channel configuration.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ChatbotClient, ListAssociationsCommand } from "@aws-sdk/client-chatbot"; // ES Modules import + * // const { ChatbotClient, ListAssociationsCommand } = require("@aws-sdk/client-chatbot"); // CommonJS import + * const client = new ChatbotClient(config); + * const input = { // ListAssociationsRequest + * ChatConfiguration: "STRING_VALUE", // required + * MaxResults: Number("int"), + * NextToken: "STRING_VALUE", + * }; + * const command = new ListAssociationsCommand(input); + * const response = await client.send(command); + * // { // ListAssociationsResult + * // Associations: [ // AssociationList // required + * // { // AssociationListing + * // Resource: "STRING_VALUE", // required + * // }, + * // ], + * // NextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListAssociationsCommandInput - {@link ListAssociationsCommandInput} + * @returns {@link ListAssociationsCommandOutput} + * @see {@link ListAssociationsCommandInput} for command's `input` shape. + * @see {@link ListAssociationsCommandOutput} for command's `response` shape. + * @see {@link ChatbotClientResolvedConfig | config} for ChatbotClient's `config` shape. + * + * @throws {@link ChatbotServiceException} + *

Base exception class for all service exceptions from Chatbot service.

+ * + * @public + */ +export class ListAssociationsCommand extends $Command + .classBuilder< + ListAssociationsCommandInput, + ListAssociationsCommandOutput, + ChatbotClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: ChatbotClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("WheatleyOrchestration_20171011", "ListAssociations", {}) + .n("ChatbotClient", "ListAssociationsCommand") + .f(void 0, void 0) + .ser(se_ListAssociationsCommand) + .de(de_ListAssociationsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListAssociationsRequest; + output: ListAssociationsResult; + }; + sdk: { + input: ListAssociationsCommandInput; + output: ListAssociationsCommandOutput; + }; + }; +} diff --git a/clients/client-chatbot/src/commands/ListCustomActionsCommand.ts b/clients/client-chatbot/src/commands/ListCustomActionsCommand.ts new file mode 100644 index 0000000000000..444a8d2937c0c --- /dev/null +++ b/clients/client-chatbot/src/commands/ListCustomActionsCommand.ts @@ -0,0 +1,105 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ChatbotClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ChatbotClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { ListCustomActionsRequest, ListCustomActionsResult } from "../models/models_0"; +import { de_ListCustomActionsCommand, se_ListCustomActionsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListCustomActionsCommand}. + */ +export interface ListCustomActionsCommandInput extends ListCustomActionsRequest {} +/** + * @public + * + * The output of {@link ListCustomActionsCommand}. + */ +export interface ListCustomActionsCommandOutput extends ListCustomActionsResult, __MetadataBearer {} + +/** + *

Lists custom actions defined in this account.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ChatbotClient, ListCustomActionsCommand } from "@aws-sdk/client-chatbot"; // ES Modules import + * // const { ChatbotClient, ListCustomActionsCommand } = require("@aws-sdk/client-chatbot"); // CommonJS import + * const client = new ChatbotClient(config); + * const input = { // ListCustomActionsRequest + * MaxResults: Number("int"), + * NextToken: "STRING_VALUE", + * }; + * const command = new ListCustomActionsCommand(input); + * const response = await client.send(command); + * // { // ListCustomActionsResult + * // CustomActions: [ // CustomActionArnList // required + * // "STRING_VALUE", + * // ], + * // NextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListCustomActionsCommandInput - {@link ListCustomActionsCommandInput} + * @returns {@link ListCustomActionsCommandOutput} + * @see {@link ListCustomActionsCommandInput} for command's `input` shape. + * @see {@link ListCustomActionsCommandOutput} for command's `response` shape. + * @see {@link ChatbotClientResolvedConfig | config} for ChatbotClient's `config` shape. + * + * @throws {@link InternalServiceError} (server fault) + *

Unexpected error during processing of request.

+ * + * @throws {@link InvalidRequestException} (client fault) + *

Your request input doesn't meet the constraints required by AWS Chatbot.

+ * + * @throws {@link UnauthorizedException} (client fault) + *

The request was rejected because it doesn't have valid credentials for the target resource.

+ * + * @throws {@link ChatbotServiceException} + *

Base exception class for all service exceptions from Chatbot service.

+ * + * @public + */ +export class ListCustomActionsCommand extends $Command + .classBuilder< + ListCustomActionsCommandInput, + ListCustomActionsCommandOutput, + ChatbotClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: ChatbotClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("WheatleyOrchestration_20171011", "ListCustomActions", {}) + .n("ChatbotClient", "ListCustomActionsCommand") + .f(void 0, void 0) + .ser(se_ListCustomActionsCommand) + .de(de_ListCustomActionsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListCustomActionsRequest; + output: ListCustomActionsResult; + }; + sdk: { + input: ListCustomActionsCommandInput; + output: ListCustomActionsCommandOutput; + }; + }; +} diff --git a/clients/client-chatbot/src/commands/UpdateCustomActionCommand.ts b/clients/client-chatbot/src/commands/UpdateCustomActionCommand.ts new file mode 100644 index 0000000000000..18abe0380dfb2 --- /dev/null +++ b/clients/client-chatbot/src/commands/UpdateCustomActionCommand.ts @@ -0,0 +1,124 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ChatbotClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ChatbotClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { UpdateCustomActionRequest, UpdateCustomActionResult } from "../models/models_0"; +import { de_UpdateCustomActionCommand, se_UpdateCustomActionCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link UpdateCustomActionCommand}. + */ +export interface UpdateCustomActionCommandInput extends UpdateCustomActionRequest {} +/** + * @public + * + * The output of {@link UpdateCustomActionCommand}. + */ +export interface UpdateCustomActionCommandOutput extends UpdateCustomActionResult, __MetadataBearer {} + +/** + *

Updates a custom action.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ChatbotClient, UpdateCustomActionCommand } from "@aws-sdk/client-chatbot"; // ES Modules import + * // const { ChatbotClient, UpdateCustomActionCommand } = require("@aws-sdk/client-chatbot"); // CommonJS import + * const client = new ChatbotClient(config); + * const input = { // UpdateCustomActionRequest + * CustomActionArn: "STRING_VALUE", // required + * Definition: { // CustomActionDefinition + * CommandText: "STRING_VALUE", // required + * }, + * AliasName: "STRING_VALUE", + * Attachments: [ // CustomActionAttachmentList + * { // CustomActionAttachment + * NotificationType: "STRING_VALUE", + * ButtonText: "STRING_VALUE", + * Criteria: [ // CustomActionAttachmentCriteriaList + * { // CustomActionAttachmentCriteria + * Operator: "HAS_VALUE" || "EQUALS", // required + * VariableName: "STRING_VALUE", // required + * Value: "STRING_VALUE", + * }, + * ], + * Variables: { // CustomActionAttachmentVariables + * "": "STRING_VALUE", + * }, + * }, + * ], + * }; + * const command = new UpdateCustomActionCommand(input); + * const response = await client.send(command); + * // { // UpdateCustomActionResult + * // CustomActionArn: "STRING_VALUE", // required + * // }; + * + * ``` + * + * @param UpdateCustomActionCommandInput - {@link UpdateCustomActionCommandInput} + * @returns {@link UpdateCustomActionCommandOutput} + * @see {@link UpdateCustomActionCommandInput} for command's `input` shape. + * @see {@link UpdateCustomActionCommandOutput} for command's `response` shape. + * @see {@link ChatbotClientResolvedConfig | config} for ChatbotClient's `config` shape. + * + * @throws {@link InternalServiceError} (server fault) + *

Unexpected error during processing of request.

+ * + * @throws {@link InvalidRequestException} (client fault) + *

Your request input doesn't meet the constraints required by AWS Chatbot.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

We were unable to find the resource for your request

+ * + * @throws {@link UnauthorizedException} (client fault) + *

The request was rejected because it doesn't have valid credentials for the target resource.

+ * + * @throws {@link ChatbotServiceException} + *

Base exception class for all service exceptions from Chatbot service.

+ * + * @public + */ +export class UpdateCustomActionCommand extends $Command + .classBuilder< + UpdateCustomActionCommandInput, + UpdateCustomActionCommandOutput, + ChatbotClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: ChatbotClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("WheatleyOrchestration_20171011", "UpdateCustomAction", {}) + .n("ChatbotClient", "UpdateCustomActionCommand") + .f(void 0, void 0) + .ser(se_UpdateCustomActionCommand) + .de(de_UpdateCustomActionCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: UpdateCustomActionRequest; + output: UpdateCustomActionResult; + }; + sdk: { + input: UpdateCustomActionCommandInput; + output: UpdateCustomActionCommandOutput; + }; + }; +} diff --git a/clients/client-chatbot/src/commands/index.ts b/clients/client-chatbot/src/commands/index.ts index 724a632763b45..9e8b7e8fcb3e6 100644 --- a/clients/client-chatbot/src/commands/index.ts +++ b/clients/client-chatbot/src/commands/index.ts @@ -1,8 +1,11 @@ // smithy-typescript generated code +export * from "./AssociateToConfigurationCommand"; export * from "./CreateChimeWebhookConfigurationCommand"; +export * from "./CreateCustomActionCommand"; export * from "./CreateMicrosoftTeamsChannelConfigurationCommand"; export * from "./CreateSlackChannelConfigurationCommand"; export * from "./DeleteChimeWebhookConfigurationCommand"; +export * from "./DeleteCustomActionCommand"; export * from "./DeleteMicrosoftTeamsChannelConfigurationCommand"; export * from "./DeleteMicrosoftTeamsConfiguredTeamCommand"; export * from "./DeleteMicrosoftTeamsUserIdentityCommand"; @@ -13,8 +16,12 @@ export * from "./DescribeChimeWebhookConfigurationsCommand"; export * from "./DescribeSlackChannelConfigurationsCommand"; export * from "./DescribeSlackUserIdentitiesCommand"; export * from "./DescribeSlackWorkspacesCommand"; +export * from "./DisassociateFromConfigurationCommand"; export * from "./GetAccountPreferencesCommand"; +export * from "./GetCustomActionCommand"; export * from "./GetMicrosoftTeamsChannelConfigurationCommand"; +export * from "./ListAssociationsCommand"; +export * from "./ListCustomActionsCommand"; export * from "./ListMicrosoftTeamsChannelConfigurationsCommand"; export * from "./ListMicrosoftTeamsConfiguredTeamsCommand"; export * from "./ListMicrosoftTeamsUserIdentitiesCommand"; @@ -23,5 +30,6 @@ export * from "./TagResourceCommand"; export * from "./UntagResourceCommand"; export * from "./UpdateAccountPreferencesCommand"; export * from "./UpdateChimeWebhookConfigurationCommand"; +export * from "./UpdateCustomActionCommand"; export * from "./UpdateMicrosoftTeamsChannelConfigurationCommand"; export * from "./UpdateSlackChannelConfigurationCommand"; diff --git a/clients/client-chatbot/src/models/models_0.ts b/clients/client-chatbot/src/models/models_0.ts index 884364498bec1..47e41b9b62ff9 100644 --- a/clients/client-chatbot/src/models/models_0.ts +++ b/clients/client-chatbot/src/models/models_0.ts @@ -23,6 +23,102 @@ export interface AccountPreferences { TrainingDataCollectionEnabled?: boolean | undefined; } +/** + * @public + */ +export interface AssociateToConfigurationRequest { + /** + *

The resource Amazon Resource Name (ARN) to link.

+ * @public + */ + Resource: string | undefined; + + /** + *

The channel configuration to associate with the resource.

+ * @public + */ + ChatConfiguration: string | undefined; +} + +/** + * @public + */ +export interface AssociateToConfigurationResult {} + +/** + *

Unexpected error during processing of request.

+ * @public + */ +export class InternalServiceError extends __BaseException { + readonly name: "InternalServiceError" = "InternalServiceError"; + readonly $fault: "server" = "server"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InternalServiceError", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, InternalServiceError.prototype); + this.Message = opts.Message; + } +} + +/** + *

Your request input doesn't meet the constraints required by AWS Chatbot.

+ * @public + */ +export class InvalidRequestException extends __BaseException { + readonly name: "InvalidRequestException" = "InvalidRequestException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InvalidRequestException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidRequestException.prototype); + } +} + +/** + *

The request was rejected because it doesn't have valid credentials for the target resource.

+ * @public + */ +export class UnauthorizedException extends __BaseException { + readonly name: "UnauthorizedException" = "UnauthorizedException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "UnauthorizedException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, UnauthorizedException.prototype); + } +} + +/** + *

A listing of an association with a channel configuration.

+ * @public + */ +export interface AssociationListing { + /** + *

The Amazon Resource Name (ARN) of the resource (for example, a custom action).

+ * @public + */ + Resource: string | undefined; +} + /** *

A key-value pair. A tag consists of a tag key and a tag value. Tag keys and tag values are both required, but tag values can be empty (null) strings.

* @@ -59,7 +155,7 @@ export interface ChimeWebhookConfiguration { WebhookDescription: string | undefined; /** - *

The Amazon Resource Number (ARN) of the ChimeWebhookConfiguration.

+ *

The Amazon Resource Name (ARN) of the ChimeWebhookConfiguration.

* @public */ ChatConfigurationArn: string | undefined; @@ -274,43 +370,157 @@ export class InvalidParameterException extends __BaseException { } /** - *

Your request input doesn't meet the constraints required by AWS Chatbot.

+ *

You have exceeded a service limit for AWS Chatbot.

* @public */ -export class InvalidRequestException extends __BaseException { - readonly name: "InvalidRequestException" = "InvalidRequestException"; +export class LimitExceededException extends __BaseException { + readonly name: "LimitExceededException" = "LimitExceededException"; readonly $fault: "client" = "client"; /** * @internal */ - constructor(opts: __ExceptionOptionType) { + constructor(opts: __ExceptionOptionType) { super({ - name: "InvalidRequestException", + name: "LimitExceededException", $fault: "client", ...opts, }); - Object.setPrototypeOf(this, InvalidRequestException.prototype); + Object.setPrototypeOf(this, LimitExceededException.prototype); } } /** - *

You have exceeded a service limit for AWS Chatbot.

* @public + * @enum */ -export class LimitExceededException extends __BaseException { - readonly name: "LimitExceededException" = "LimitExceededException"; - readonly $fault: "client" = "client"; +export const CustomActionAttachmentCriteriaOperator = { + EQUALS: "EQUALS", + HAS_VALUE: "HAS_VALUE", +} as const; + +/** + * @public + */ +export type CustomActionAttachmentCriteriaOperator = + (typeof CustomActionAttachmentCriteriaOperator)[keyof typeof CustomActionAttachmentCriteriaOperator]; + +/** + *

A criteria for when a button should be shown based on values in the notification

+ * @public + */ +export interface CustomActionAttachmentCriteria { /** - * @internal + *

The operation to perform on the named variable.

+ * @public */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "LimitExceededException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, LimitExceededException.prototype); - } + Operator: CustomActionAttachmentCriteriaOperator | undefined; + + /** + *

The name of the variable to operate on.

+ * @public + */ + VariableName: string | undefined; + + /** + *

A value that is compared with the actual value of the variable based on the behavior of the operator.

+ * @public + */ + Value?: string | undefined; +} + +/** + *

Defines when a custom action button should be attached to a notification.

+ * @public + */ +export interface CustomActionAttachment { + /** + *

The type of notification that the custom action should be attached to.

+ * @public + */ + NotificationType?: string | undefined; + + /** + *

The text of the button that appears on the notification.

+ * @public + */ + ButtonText?: string | undefined; + + /** + *

The criteria for when a button should be shown based on values in the notification.

+ * @public + */ + Criteria?: CustomActionAttachmentCriteria[] | undefined; + + /** + *

The variables to extract from the notification.

+ * @public + */ + Variables?: Record | undefined; +} + +/** + *

The definition of the command to run when invoked as an alias or as an action button.

+ * @public + */ +export interface CustomActionDefinition { + /** + *

The command string to run which may include variables by prefixing with a dollar sign ($).

+ * @public + */ + CommandText: string | undefined; +} + +/** + * @public + */ +export interface CreateCustomActionRequest { + /** + *

The definition of the command to run when invoked as an alias or as an action button.

+ * @public + */ + Definition: CustomActionDefinition | undefined; + + /** + *

The name used to invoke this action in a chat channel. For example, @aws run my-alias.

+ * @public + */ + AliasName?: string | undefined; + + /** + *

Defines when this custom action button should be attached to a notification.

+ * @public + */ + Attachments?: CustomActionAttachment[] | undefined; + + /** + *

A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.

+ * @public + */ + Tags?: Tag[] | undefined; + + /** + *

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.

+ *

If you do not specify a client token, one is automatically generated by the SDK.

+ * @public + */ + ClientToken?: string | undefined; + + /** + *

The name of the custom action. This name is included in the Amazon Resource Name (ARN).

+ * @public + */ + ActionName: string | undefined; +} + +/** + * @public + */ +export interface CreateCustomActionResult { + /** + *

The fully defined ARN of the custom action.

+ * @public + */ + CustomActionArn: string | undefined; } /** @@ -654,7 +864,7 @@ export interface SlackChannelConfiguration { SlackChannelName: string | undefined; /** - *

The Amazon Resource Number (ARN) of the SlackChannelConfiguration.

+ *

The Amazon Resource Name (ARN) of the SlackChannelConfiguration.

* @public */ ChatConfigurationArn: string | undefined; @@ -730,42 +940,56 @@ export interface CreateSlackChannelConfigurationResult { } /** - *

We can’t process your request right now because of a server issue. Try again later.

+ *

Represents a parameterized command that can be invoked as an alias or as a notification button in the chat client.

* @public */ -export class DeleteChimeWebhookConfigurationException extends __BaseException { - readonly name: "DeleteChimeWebhookConfigurationException" = "DeleteChimeWebhookConfigurationException"; - readonly $fault: "server" = "server"; - Message?: string | undefined; +export interface CustomAction { /** - * @internal + *

The fully defined Amazon Resource Name (ARN) of the custom action.

+ * @public */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "DeleteChimeWebhookConfigurationException", - $fault: "server", - ...opts, - }); - Object.setPrototypeOf(this, DeleteChimeWebhookConfigurationException.prototype); - this.Message = opts.Message; - } + CustomActionArn: string | undefined; + + /** + *

The definition of the command to run when invoked an alias or as an action button.

+ * @public + */ + Definition: CustomActionDefinition | undefined; + + /** + *

The name used to invoke this action in the chat channel. For example, @aws run my-alias.

+ * @public + */ + AliasName?: string | undefined; + + /** + *

Defines when this custom action button should be attached to a notification.

+ * @public + */ + Attachments?: CustomActionAttachment[] | undefined; + + /** + *

The name of the custom action that is included in the ARN.

+ * @public + */ + ActionName?: string | undefined; } /** * @public */ -export interface DeleteChimeWebhookConfigurationRequest { +export interface DeleteCustomActionRequest { /** - *

The Amazon Resource Name (ARN) of the ChimeWebhookConfiguration to delete.

+ *

The fully defined ARN of the custom action.

* @public */ - ChatConfigurationArn: string | undefined; + CustomActionArn: string | undefined; } /** * @public */ -export interface DeleteChimeWebhookConfigurationResult {} +export interface DeleteCustomActionResult {} /** *

We were unable to find the resource for your request

@@ -789,6 +1013,140 @@ export class ResourceNotFoundException extends __BaseException { } } +/** + * @public + */ +export interface GetCustomActionRequest { + /** + *

Returns the fully defined Amazon Resource Name (ARN) of the custom action.

+ * @public + */ + CustomActionArn: string | undefined; +} + +/** + * @public + */ +export interface GetCustomActionResult { + /** + *

Returns the custom action.

+ * @public + */ + CustomAction?: CustomAction | undefined; +} + +/** + * @public + */ +export interface ListCustomActionsRequest { + /** + *

The maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

+ * @public + */ + MaxResults?: number | undefined; + + /** + *

An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

+ * @public + */ + NextToken?: string | undefined; +} + +/** + * @public + */ +export interface ListCustomActionsResult { + /** + *

A list of custom actions.

+ * @public + */ + CustomActions: string[] | undefined; + + /** + *

An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

+ * @public + */ + NextToken?: string | undefined; +} + +/** + * @public + */ +export interface UpdateCustomActionRequest { + /** + *

The fully defined Amazon Resource Name (ARN) of the custom action.

+ * @public + */ + CustomActionArn: string | undefined; + + /** + *

The definition of the command to run when invoked as an alias or as an action button.

+ * @public + */ + Definition: CustomActionDefinition | undefined; + + /** + *

The name used to invoke this action in the chat channel. For example, @aws run my-alias.

+ * @public + */ + AliasName?: string | undefined; + + /** + *

Defines when this custom action button should be attached to a notification.

+ * @public + */ + Attachments?: CustomActionAttachment[] | undefined; +} + +/** + * @public + */ +export interface UpdateCustomActionResult { + /** + *

The fully defined ARN of the custom action.

+ * @public + */ + CustomActionArn: string | undefined; +} + +/** + *

We can’t process your request right now because of a server issue. Try again later.

+ * @public + */ +export class DeleteChimeWebhookConfigurationException extends __BaseException { + readonly name: "DeleteChimeWebhookConfigurationException" = "DeleteChimeWebhookConfigurationException"; + readonly $fault: "server" = "server"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "DeleteChimeWebhookConfigurationException", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, DeleteChimeWebhookConfigurationException.prototype); + this.Message = opts.Message; + } +} + +/** + * @public + */ +export interface DeleteChimeWebhookConfigurationRequest { + /** + *

The Amazon Resource Name (ARN) of the ChimeWebhookConfiguration to delete.

+ * @public + */ + ChatConfigurationArn: string | undefined; +} + +/** + * @public + */ +export interface DeleteChimeWebhookConfigurationResult {} + /** *

We can’t process your request right now because of a server issue. Try again later.

* @public @@ -1078,7 +1436,7 @@ export interface DescribeChimeWebhookConfigurationsRequest { NextToken?: string | undefined; /** - *

An optional Amazon Resource Number (ARN) of a ChimeWebhookConfiguration to describe.

+ *

An optional Amazon Resource Name (ARN) of a ChimeWebhookConfiguration to describe.

* @public */ ChatConfigurationArn?: string | undefined; @@ -1143,7 +1501,7 @@ export interface DescribeSlackChannelConfigurationsRequest { NextToken?: string | undefined; /** - *

An optional Amazon Resource Number (ARN) of a SlackChannelConfiguration to describe.

+ *

An optional Amazon Resource Name (ARN) of a SlackChannelConfiguration to describe.

* @public */ ChatConfigurationArn?: string | undefined; @@ -1194,7 +1552,7 @@ export class DescribeSlackUserIdentitiesException extends __BaseException { */ export interface DescribeSlackUserIdentitiesRequest { /** - *

The Amazon Resource Number (ARN) of the SlackChannelConfiguration associated with the user identities to describe.

+ *

The Amazon Resource Name (ARN) of the SlackChannelConfiguration associated with the user identities to describe.

* @public */ ChatConfigurationArn?: string | undefined; @@ -1228,7 +1586,7 @@ export interface SlackUserIdentity { IamRoleArn: string | undefined; /** - *

The Amazon Resource Number (ARN) of the SlackChannelConfiguration associated with the user identity to delete.

+ *

The Amazon Resource Name (ARN) of the SlackChannelConfiguration associated with the user identity to delete.

* @public */ ChatConfigurationArn: string | undefined; @@ -1360,6 +1718,28 @@ export interface DescribeSlackWorkspacesResult { NextToken?: string | undefined; } +/** + * @public + */ +export interface DisassociateFromConfigurationRequest { + /** + *

The resource (for example, a custom action) Amazon Resource Name (ARN) to unlink.

+ * @public + */ + Resource: string | undefined; + + /** + *

The channel configuration the resource is being disassociated from.

+ * @public + */ + ChatConfiguration: string | undefined; +} + +/** + * @public + */ +export interface DisassociateFromConfigurationResult {} + /** *

We can’t process your request right now because of a server issue. Try again later.

* @public @@ -1425,7 +1805,7 @@ export class GetTeamsChannelConfigurationException extends __BaseException { */ export interface GetTeamsChannelConfigurationRequest { /** - *

The Amazon Resource Number (ARN) of the MicrosoftTeamsChannelConfiguration to retrieve.

+ *

The Amazon Resource Name (ARN) of the MicrosoftTeamsChannelConfiguration to retrieve.

* @public */ ChatConfigurationArn: string | undefined; @@ -1443,25 +1823,43 @@ export interface GetTeamsChannelConfigurationResult { } /** - *

Unexpected error during processing of request.

* @public */ -export class InternalServiceError extends __BaseException { - readonly name: "InternalServiceError" = "InternalServiceError"; - readonly $fault: "server" = "server"; - Message?: string | undefined; +export interface ListAssociationsRequest { /** - * @internal + *

The channel configuration to list associations for.

+ * @public */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "InternalServiceError", - $fault: "server", - ...opts, - }); - Object.setPrototypeOf(this, InternalServiceError.prototype); - this.Message = opts.Message; - } + ChatConfiguration: string | undefined; + + /** + *

The maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

+ * @public + */ + MaxResults?: number | undefined; + + /** + *

An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

+ * @public + */ + NextToken?: string | undefined; +} + +/** + * @public + */ +export interface ListAssociationsResult { + /** + *

The resources associated with this channel configuration.

+ * @public + */ + Associations: AssociationListing[] | undefined; + + /** + *

An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

+ * @public + */ + NextToken?: string | undefined; } /** @@ -1611,7 +2009,7 @@ export class ListMicrosoftTeamsUserIdentitiesException extends __BaseException { */ export interface ListMicrosoftTeamsUserIdentitiesRequest { /** - *

The Amazon Resource Number (ARN) of the MicrosoftTeamsChannelConfiguration associated with the user identities to list.

+ *

The Amazon Resource Name (ARN) of the MicrosoftTeamsChannelConfiguration associated with the user identities to list.

* @public */ ChatConfigurationArn?: string | undefined; @@ -1706,7 +2104,7 @@ export interface ListMicrosoftTeamsUserIdentitiesResult { */ export interface ListTagsForResourceRequest { /** - *

The ARN you specified to list the tags of.

+ *

The ARN of the resource to list tags for.

* @public */ ResourceARN: string | undefined; @@ -1886,7 +2284,7 @@ export class UpdateChimeWebhookConfigurationException extends __BaseException { */ export interface UpdateChimeWebhookConfigurationRequest { /** - *

The Amazon Resource Number (ARN) of the ChimeWebhookConfiguration to update.

+ *

The Amazon Resource Name (ARN) of the ChimeWebhookConfiguration to update.

* @public */ ChatConfigurationArn: string | undefined; @@ -1964,7 +2362,7 @@ export class UpdateTeamsChannelConfigurationException extends __BaseException { */ export interface UpdateTeamsChannelConfigurationRequest { /** - *

The Amazon Resource Number (ARN) of the TeamsChannelConfiguration to update.

+ *

The Amazon Resource Name (ARN) of the TeamsChannelConfiguration to update.

* @public */ ChatConfigurationArn: string | undefined; @@ -2053,7 +2451,7 @@ export class UpdateSlackChannelConfigurationException extends __BaseException { */ export interface UpdateSlackChannelConfigurationRequest { /** - *

The Amazon Resource Number (ARN) of the SlackChannelConfiguration to update.

+ *

The Amazon Resource Name (ARN) of the SlackChannelConfiguration to update.

* @public */ ChatConfigurationArn: string | undefined; diff --git a/clients/client-chatbot/src/pagination/ListAssociationsPaginator.ts b/clients/client-chatbot/src/pagination/ListAssociationsPaginator.ts new file mode 100644 index 0000000000000..040602b81e23a --- /dev/null +++ b/clients/client-chatbot/src/pagination/ListAssociationsPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { ChatbotClient } from "../ChatbotClient"; +import { + ListAssociationsCommand, + ListAssociationsCommandInput, + ListAssociationsCommandOutput, +} from "../commands/ListAssociationsCommand"; +import { ChatbotPaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListAssociations: ( + config: ChatbotPaginationConfiguration, + input: ListAssociationsCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + ChatbotPaginationConfiguration, + ListAssociationsCommandInput, + ListAssociationsCommandOutput +>(ChatbotClient, ListAssociationsCommand, "NextToken", "NextToken", "MaxResults"); diff --git a/clients/client-chatbot/src/pagination/ListCustomActionsPaginator.ts b/clients/client-chatbot/src/pagination/ListCustomActionsPaginator.ts new file mode 100644 index 0000000000000..3d824e3faa2a1 --- /dev/null +++ b/clients/client-chatbot/src/pagination/ListCustomActionsPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { ChatbotClient } from "../ChatbotClient"; +import { + ListCustomActionsCommand, + ListCustomActionsCommandInput, + ListCustomActionsCommandOutput, +} from "../commands/ListCustomActionsCommand"; +import { ChatbotPaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListCustomActions: ( + config: ChatbotPaginationConfiguration, + input: ListCustomActionsCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + ChatbotPaginationConfiguration, + ListCustomActionsCommandInput, + ListCustomActionsCommandOutput +>(ChatbotClient, ListCustomActionsCommand, "NextToken", "NextToken", "MaxResults"); diff --git a/clients/client-chatbot/src/pagination/index.ts b/clients/client-chatbot/src/pagination/index.ts index 0541f0bd03639..3b13ed845fc6d 100644 --- a/clients/client-chatbot/src/pagination/index.ts +++ b/clients/client-chatbot/src/pagination/index.ts @@ -7,6 +7,8 @@ export * from "./DescribeSlackUserIdentitiesPaginator"; export * from "./DescribeSlackWorkspacesPaginator"; // smithy-typescript generated code export * from "./Interfaces"; +export * from "./ListAssociationsPaginator"; +export * from "./ListCustomActionsPaginator"; export * from "./ListMicrosoftTeamsChannelConfigurationsPaginator"; export * from "./ListMicrosoftTeamsConfiguredTeamsPaginator"; export * from "./ListMicrosoftTeamsUserIdentitiesPaginator"; diff --git a/clients/client-chatbot/src/protocols/Aws_restJson1.ts b/clients/client-chatbot/src/protocols/Aws_restJson1.ts index 474a4584ee8c0..e934bfdd713d6 100644 --- a/clients/client-chatbot/src/protocols/Aws_restJson1.ts +++ b/clients/client-chatbot/src/protocols/Aws_restJson1.ts @@ -18,11 +18,17 @@ import { ResponseMetadata as __ResponseMetadata, SerdeContext as __SerdeContext, } from "@smithy/types"; +import { v4 as generateIdempotencyToken } from "uuid"; +import { + AssociateToConfigurationCommandInput, + AssociateToConfigurationCommandOutput, +} from "../commands/AssociateToConfigurationCommand"; import { CreateChimeWebhookConfigurationCommandInput, CreateChimeWebhookConfigurationCommandOutput, } from "../commands/CreateChimeWebhookConfigurationCommand"; +import { CreateCustomActionCommandInput, CreateCustomActionCommandOutput } from "../commands/CreateCustomActionCommand"; import { CreateMicrosoftTeamsChannelConfigurationCommandInput, CreateMicrosoftTeamsChannelConfigurationCommandOutput, @@ -35,6 +41,7 @@ import { DeleteChimeWebhookConfigurationCommandInput, DeleteChimeWebhookConfigurationCommandOutput, } from "../commands/DeleteChimeWebhookConfigurationCommand"; +import { DeleteCustomActionCommandInput, DeleteCustomActionCommandOutput } from "../commands/DeleteCustomActionCommand"; import { DeleteMicrosoftTeamsChannelConfigurationCommandInput, DeleteMicrosoftTeamsChannelConfigurationCommandOutput, @@ -75,14 +82,21 @@ import { DescribeSlackWorkspacesCommandInput, DescribeSlackWorkspacesCommandOutput, } from "../commands/DescribeSlackWorkspacesCommand"; +import { + DisassociateFromConfigurationCommandInput, + DisassociateFromConfigurationCommandOutput, +} from "../commands/DisassociateFromConfigurationCommand"; import { GetAccountPreferencesCommandInput, GetAccountPreferencesCommandOutput, } from "../commands/GetAccountPreferencesCommand"; +import { GetCustomActionCommandInput, GetCustomActionCommandOutput } from "../commands/GetCustomActionCommand"; import { GetMicrosoftTeamsChannelConfigurationCommandInput, GetMicrosoftTeamsChannelConfigurationCommandOutput, } from "../commands/GetMicrosoftTeamsChannelConfigurationCommand"; +import { ListAssociationsCommandInput, ListAssociationsCommandOutput } from "../commands/ListAssociationsCommand"; +import { ListCustomActionsCommandInput, ListCustomActionsCommandOutput } from "../commands/ListCustomActionsCommand"; import { ListMicrosoftTeamsChannelConfigurationsCommandInput, ListMicrosoftTeamsChannelConfigurationsCommandOutput, @@ -109,6 +123,7 @@ import { UpdateChimeWebhookConfigurationCommandInput, UpdateChimeWebhookConfigurationCommandOutput, } from "../commands/UpdateChimeWebhookConfigurationCommand"; +import { UpdateCustomActionCommandInput, UpdateCustomActionCommandOutput } from "../commands/UpdateCustomActionCommand"; import { UpdateMicrosoftTeamsChannelConfigurationCommandInput, UpdateMicrosoftTeamsChannelConfigurationCommandOutput, @@ -123,6 +138,9 @@ import { CreateChimeWebhookConfigurationException, CreateSlackChannelConfigurationException, CreateTeamsChannelConfigurationException, + CustomActionAttachment, + CustomActionAttachmentCriteria, + CustomActionDefinition, DeleteChimeWebhookConfigurationException, DeleteMicrosoftTeamsUserIdentityException, DeleteSlackChannelConfigurationException, @@ -147,12 +165,36 @@ import { ServiceUnavailableException, Tag, TooManyTagsException, + UnauthorizedException, UpdateAccountPreferencesException, UpdateChimeWebhookConfigurationException, UpdateSlackChannelConfigurationException, UpdateTeamsChannelConfigurationException, } from "../models/models_0"; +/** + * serializeAws_restJson1AssociateToConfigurationCommand + */ +export const se_AssociateToConfigurationCommand = async ( + input: AssociateToConfigurationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/associate-to-configuration"); + let body: any; + body = JSON.stringify( + take(input, { + ChatConfiguration: [], + Resource: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1CreateChimeWebhookConfigurationCommand */ @@ -181,6 +223,33 @@ export const se_CreateChimeWebhookConfigurationCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1CreateCustomActionCommand + */ +export const se_CreateCustomActionCommand = async ( + input: CreateCustomActionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/create-custom-action"); + let body: any; + body = JSON.stringify( + take(input, { + ActionName: [], + AliasName: [], + Attachments: (_) => _json(_), + ClientToken: [true, (_) => _ ?? generateIdempotencyToken()], + Definition: (_) => _json(_), + Tags: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1CreateMicrosoftTeamsChannelConfigurationCommand */ @@ -267,6 +336,28 @@ export const se_DeleteChimeWebhookConfigurationCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1DeleteCustomActionCommand + */ +export const se_DeleteCustomActionCommand = async ( + input: DeleteCustomActionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/delete-custom-action"); + let body: any; + body = JSON.stringify( + take(input, { + CustomActionArn: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1DeleteMicrosoftTeamsChannelConfigurationCommand */ @@ -497,6 +588,29 @@ export const se_DescribeSlackWorkspacesCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1DisassociateFromConfigurationCommand + */ +export const se_DisassociateFromConfigurationCommand = async ( + input: DisassociateFromConfigurationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/disassociate-from-configuration"); + let body: any; + body = JSON.stringify( + take(input, { + ChatConfiguration: [], + Resource: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1GetAccountPreferencesCommand */ @@ -512,6 +626,28 @@ export const se_GetAccountPreferencesCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1GetCustomActionCommand + */ +export const se_GetCustomActionCommand = async ( + input: GetCustomActionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/get-custom-action"); + let body: any; + body = JSON.stringify( + take(input, { + CustomActionArn: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1GetMicrosoftTeamsChannelConfigurationCommand */ @@ -534,6 +670,53 @@ export const se_GetMicrosoftTeamsChannelConfigurationCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1ListAssociationsCommand + */ +export const se_ListAssociationsCommand = async ( + input: ListAssociationsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/list-associations"); + let body: any; + body = JSON.stringify( + take(input, { + ChatConfiguration: [], + MaxResults: [], + NextToken: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ListCustomActionsCommand + */ +export const se_ListCustomActionsCommand = async ( + input: ListCustomActionsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/list-custom-actions"); + let body: any; + body = JSON.stringify( + take(input, { + MaxResults: [], + NextToken: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1ListMicrosoftTeamsChannelConfigurationsCommand */ @@ -723,6 +906,31 @@ export const se_UpdateChimeWebhookConfigurationCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1UpdateCustomActionCommand + */ +export const se_UpdateCustomActionCommand = async ( + input: UpdateCustomActionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/update-custom-action"); + let body: any; + body = JSON.stringify( + take(input, { + AliasName: [], + Attachments: (_) => _json(_), + CustomActionArn: [], + Definition: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1UpdateMicrosoftTeamsChannelConfigurationCommand */ @@ -781,6 +989,23 @@ export const se_UpdateSlackChannelConfigurationCommand = async ( return b.build(); }; +/** + * deserializeAws_restJson1AssociateToConfigurationCommand + */ +export const de_AssociateToConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + /** * deserializeAws_restJson1CreateChimeWebhookConfigurationCommand */ @@ -802,6 +1027,27 @@ export const de_CreateChimeWebhookConfigurationCommand = async ( return contents; }; +/** + * deserializeAws_restJson1CreateCustomActionCommand + */ +export const de_CreateCustomActionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CustomActionArn: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1CreateMicrosoftTeamsChannelConfigurationCommand */ @@ -861,6 +1107,23 @@ export const de_DeleteChimeWebhookConfigurationCommand = async ( return contents; }; +/** + * deserializeAws_restJson1DeleteCustomActionCommand + */ +export const de_DeleteCustomActionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + /** * deserializeAws_restJson1DeleteMicrosoftTeamsChannelConfigurationCommand */ @@ -1051,6 +1314,23 @@ export const de_DescribeSlackWorkspacesCommand = async ( return contents; }; +/** + * deserializeAws_restJson1DisassociateFromConfigurationCommand + */ +export const de_DisassociateFromConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + /** * deserializeAws_restJson1GetAccountPreferencesCommand */ @@ -1072,6 +1352,27 @@ export const de_GetAccountPreferencesCommand = async ( return contents; }; +/** + * deserializeAws_restJson1GetCustomActionCommand + */ +export const de_GetCustomActionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CustomAction: _json, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1GetMicrosoftTeamsChannelConfigurationCommand */ @@ -1093,6 +1394,50 @@ export const de_GetMicrosoftTeamsChannelConfigurationCommand = async ( return contents; }; +/** + * deserializeAws_restJson1ListAssociationsCommand + */ +export const de_ListAssociationsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Associations: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListCustomActionsCommand + */ +export const de_ListCustomActionsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CustomActions: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1ListMicrosoftTeamsChannelConfigurationsCommand */ @@ -1256,6 +1601,27 @@ export const de_UpdateChimeWebhookConfigurationCommand = async ( return contents; }; +/** + * deserializeAws_restJson1UpdateCustomActionCommand + */ +export const de_UpdateCustomActionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CustomActionArn: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1UpdateMicrosoftTeamsChannelConfigurationCommand */ @@ -1308,6 +1674,15 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "InternalServiceError": + case "com.amazonaws.chatbot#InternalServiceError": + throw await de_InternalServiceErrorRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.chatbot#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.chatbot#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); case "ConflictException": case "com.amazonaws.chatbot#ConflictException": throw await de_ConflictExceptionRes(parsedOutput, context); @@ -1317,9 +1692,6 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): case "InvalidParameterException": case "com.amazonaws.chatbot#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.chatbot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); case "LimitExceededException": case "com.amazonaws.chatbot#LimitExceededException": throw await de_LimitExceededExceptionRes(parsedOutput, context); @@ -1380,9 +1752,6 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): case "ListMicrosoftTeamsUserIdentitiesException": case "com.amazonaws.chatbot#ListMicrosoftTeamsUserIdentitiesException": throw await de_ListMicrosoftTeamsUserIdentitiesExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.chatbot#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); case "ServiceUnavailableException": case "com.amazonaws.chatbot#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); @@ -1949,6 +2318,26 @@ const de_TooManyTagsExceptionRes = async ( return __decorateServiceException(exception, parsedOutput.body); }; +/** + * deserializeAws_restJson1UnauthorizedExceptionRes + */ +const de_UnauthorizedExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new UnauthorizedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + /** * deserializeAws_restJson1UpdateAccountPreferencesExceptionRes */ @@ -2029,6 +2418,18 @@ const de_UpdateTeamsChannelConfigurationExceptionRes = async ( return __decorateServiceException(exception, parsedOutput.body); }; +// se_CustomActionAttachment omitted. + +// se_CustomActionAttachmentCriteria omitted. + +// se_CustomActionAttachmentCriteriaList omitted. + +// se_CustomActionAttachmentList omitted. + +// se_CustomActionAttachmentVariables omitted. + +// se_CustomActionDefinition omitted. + // se_GuardrailPolicyArnList omitted. // se_SnsTopicArnList omitted. @@ -2043,6 +2444,10 @@ const de_UpdateTeamsChannelConfigurationExceptionRes = async ( // de_AccountPreferences omitted. +// de_AssociationList omitted. + +// de_AssociationListing omitted. + // de_ChimeWebhookConfiguration omitted. // de_ChimeWebhookConfigurationList omitted. @@ -2051,6 +2456,22 @@ const de_UpdateTeamsChannelConfigurationExceptionRes = async ( // de_ConfiguredTeamsList omitted. +// de_CustomAction omitted. + +// de_CustomActionArnList omitted. + +// de_CustomActionAttachment omitted. + +// de_CustomActionAttachmentCriteria omitted. + +// de_CustomActionAttachmentCriteriaList omitted. + +// de_CustomActionAttachmentList omitted. + +// de_CustomActionAttachmentVariables omitted. + +// de_CustomActionDefinition omitted. + // de_GuardrailPolicyArnList omitted. // de_SlackChannelConfiguration omitted. diff --git a/codegen/sdk-codegen/aws-models/chatbot.json b/codegen/sdk-codegen/aws-models/chatbot.json index 0488ca7750f03..9064fd39c37d1 100644 --- a/codegen/sdk-codegen/aws-models/chatbot.json +++ b/codegen/sdk-codegen/aws-models/chatbot.json @@ -41,6 +41,105 @@ "smithy.api#pattern": "^arn:aws:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}$" } }, + "com.amazonaws.chatbot#AssociateToConfiguration": { + "type": "operation", + "input": { + "target": "com.amazonaws.chatbot#AssociateToConfigurationRequest" + }, + "output": { + "target": "com.amazonaws.chatbot#AssociateToConfigurationResult" + }, + "errors": [ + { + "target": "com.amazonaws.chatbot#InternalServiceError" + }, + { + "target": "com.amazonaws.chatbot#InvalidRequestException" + }, + { + "target": "com.amazonaws.chatbot#UnauthorizedException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to associate a resource with a configuration", + "resources": { + "required": { + "ChatbotConfiguration": {}, + "custom-action": {} + } + } + }, + "smithy.api#documentation": "

Links a resource (for example, a custom action) to a channel configuration.

", + "smithy.api#examples": [ + { + "title": "Associate a custom action to a configuration", + "documentation": "Associate a custom action to a channel configuration, allowing it to be used in that channel", + "input": { + "Resource": "arn:aws:chatbot::1234567890:custom-action/my-custom-action", + "ChatConfiguration": "arn:aws:chatbot::1234567890:chat-configuration/slack-channel/my-channel" + }, + "output": {} + } + ], + "smithy.api#http": { + "code": 201, + "method": "POST", + "uri": "/associate-to-configuration" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.chatbot#AssociateToConfigurationRequest": { + "type": "structure", + "members": { + "Resource": { + "target": "com.amazonaws.chatbot#ResourceIdentifier", + "traits": { + "smithy.api#documentation": "

The resource Amazon Resource Name (ARN) to link.

", + "smithy.api#required": {} + } + }, + "ChatConfiguration": { + "target": "com.amazonaws.chatbot#ChatConfigurationArn", + "traits": { + "smithy.api#documentation": "

The channel configuration to associate with the resource.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.chatbot#AssociateToConfigurationResult": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.chatbot#AssociationList": { + "type": "list", + "member": { + "target": "com.amazonaws.chatbot#AssociationListing" + } + }, + "com.amazonaws.chatbot#AssociationListing": { + "type": "structure", + "members": { + "Resource": { + "target": "com.amazonaws.chatbot#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource (for example, a custom action).

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

A listing of an association with a channel configuration.

" + } + }, "com.amazonaws.chatbot#AwsUserIdentity": { "type": "string", "traits": { @@ -77,7 +176,7 @@ "ChatConfigurationArn": { "target": "com.amazonaws.chatbot#ChatConfigurationArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Number (ARN) of the ChimeWebhookConfiguration.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the ChimeWebhookConfiguration.

", "smithy.api#required": {} } }, @@ -157,6 +256,16 @@ "smithy.api#sensitive": {} } }, + "com.amazonaws.chatbot#ClientToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 33, + "max": 126 + }, + "smithy.api#pattern": "^[\\x21-\\x7F]+$" + } + }, "com.amazonaws.chatbot#ConfigurationName": { "type": "string", "traits": { @@ -252,6 +361,10 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to create an AWS Chatbot Chime Webhook Configuration", + "createsResources": ["ChatbotConfiguration"] + }, "smithy.api#documentation": "

Creates an AWS Chatbot configuration for Amazon Chime.

", "smithy.api#http": { "method": "POST", @@ -342,6 +455,142 @@ "smithy.api#output": {} } }, + "com.amazonaws.chatbot#CreateCustomAction": { + "type": "operation", + "input": { + "target": "com.amazonaws.chatbot#CreateCustomActionRequest" + }, + "output": { + "target": "com.amazonaws.chatbot#CreateCustomActionResult" + }, + "errors": [ + { + "target": "com.amazonaws.chatbot#ConflictException" + }, + { + "target": "com.amazonaws.chatbot#InternalServiceError" + }, + { + "target": "com.amazonaws.chatbot#InvalidRequestException" + }, + { + "target": "com.amazonaws.chatbot#LimitExceededException" + }, + { + "target": "com.amazonaws.chatbot#UnauthorizedException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to create a custom action" + }, + "smithy.api#documentation": "

Creates a custom action that can be invoked as an alias or as a button on a notification.

", + "smithy.api#examples": [ + { + "title": "Create an alias that invokes a Lambda function", + "documentation": "Creates an alias that invokes a Lambda function from chat channels. You can use this alias by entering 'run invoke', after which you're prompted for the function name.", + "input": { + "ActionName": "my-custom-action", + "Definition": { + "CommandText": "lambda invoke $functionName" + }, + "AliasName": "invoke" + }, + "output": { + "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action" + } + }, + { + "title": "Create a custom action to list alarms", + "documentation": "Creates a button on all Cloudwatch notifications that lists alarms in the ‘ALARM’ state.", + "input": { + "ActionName": "describe-alarms", + "Definition": { + "CommandText": "cloudwatch describe-alarms --state-value ALARM" + }, + "Attachments": [ + { + "NotificationType": "CloudWatch", + "ButtonText": "List alarms" + } + ] + }, + "output": { + "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/describe-alarms" + } + } + ], + "smithy.api#http": { + "code": 201, + "method": "POST", + "uri": "/create-custom-action" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.chatbot#CreateCustomActionRequest": { + "type": "structure", + "members": { + "Definition": { + "target": "com.amazonaws.chatbot#CustomActionDefinition", + "traits": { + "smithy.api#documentation": "

The definition of the command to run when invoked as an alias or as an action button.

", + "smithy.api#required": {} + } + }, + "AliasName": { + "target": "com.amazonaws.chatbot#CustomActionAliasName", + "traits": { + "smithy.api#documentation": "

The name used to invoke this action in a chat channel. For example, @aws run my-alias.

" + } + }, + "Attachments": { + "target": "com.amazonaws.chatbot#CustomActionAttachmentList", + "traits": { + "smithy.api#documentation": "

Defines when this custom action button should be attached to a notification.

" + } + }, + "Tags": { + "target": "com.amazonaws.chatbot#TagList", + "traits": { + "smithy.api#documentation": "

A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.

" + } + }, + "ClientToken": { + "target": "com.amazonaws.chatbot#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.

\n

If you do not specify a client token, one is automatically generated by the SDK.

", + "smithy.api#idempotencyToken": {} + } + }, + "ActionName": { + "target": "com.amazonaws.chatbot#CustomActionName", + "traits": { + "smithy.api#documentation": "

The name of the custom action. This name is included in the Amazon Resource Name (ARN).

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.chatbot#CreateCustomActionResult": { + "type": "structure", + "members": { + "CustomActionArn": { + "target": "com.amazonaws.chatbot#CustomActionArn", + "traits": { + "smithy.api#documentation": "

The fully defined ARN of the custom action.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "CustomActionArn" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.chatbot#CreateMicrosoftTeamsChannelConfiguration": { "type": "operation", "input": { @@ -368,6 +617,10 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to create an AWS Chatbot Microsoft Teams Channel Configuration", + "createsResources": ["ChatbotConfiguration"] + }, "smithy.api#documentation": "

Creates an AWS Chatbot configuration for Microsoft Teams.

", "smithy.api#http": { "method": "POST", @@ -403,6 +656,10 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to create an AWS Chatbot Slack Channel Configuration", + "createsResources": ["ChatbotConfiguration"] + }, "smithy.api#documentation": "

Creates an AWS Chatbot confugration for Slack.

", "smithy.api#http": { "method": "POST", @@ -622,6 +879,313 @@ "smithy.api#output": {} } }, + "com.amazonaws.chatbot#CustomAction": { + "type": "structure", + "members": { + "CustomActionArn": { + "target": "com.amazonaws.chatbot#CustomActionArn", + "traits": { + "smithy.api#documentation": "

The fully defined Amazon Resource Name (ARN) of the custom action.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "CustomActionArn" + } + }, + "Definition": { + "target": "com.amazonaws.chatbot#CustomActionDefinition", + "traits": { + "smithy.api#documentation": "

The definition of the command to run when invoked an alias or as an action button.

", + "smithy.api#required": {} + } + }, + "AliasName": { + "target": "com.amazonaws.chatbot#CustomActionAliasName", + "traits": { + "smithy.api#documentation": "

The name used to invoke this action in the chat channel. For example, @aws run my-alias.

" + } + }, + "Attachments": { + "target": "com.amazonaws.chatbot#CustomActionAttachmentList", + "traits": { + "smithy.api#documentation": "

Defines when this custom action button should be attached to a notification.

" + } + }, + "ActionName": { + "target": "com.amazonaws.chatbot#CustomActionName", + "traits": { + "smithy.api#documentation": "

The name of the custom action that is included in the ARN.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a parameterized command that can be invoked as an alias or as a notification button in the chat client.

" + } + }, + "com.amazonaws.chatbot#CustomActionAliasName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 30 + }, + "smithy.api#pattern": "^[A-Za-z0-9-_]+$" + } + }, + "com.amazonaws.chatbot#CustomActionArn": { + "type": "string", + "traits": { + "aws.api#arnReference": { + "type": "AWS::Chatbot::CustomAction", + "service": "com.amazonaws.chatbot#WheatleyOrchestration_20171011", + "resource": "com.amazonaws.chatbot#CustomActionResource" + }, + "smithy.api#length": { + "min": 1, + "max": 1011 + }, + "smithy.api#pattern": "^arn:aws:chatbot:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:custom-action/[a-zA-Z0-9_-]{1,64}$" + } + }, + "com.amazonaws.chatbot#CustomActionArnList": { + "type": "list", + "member": { + "target": "com.amazonaws.chatbot#CustomActionArn" + } + }, + "com.amazonaws.chatbot#CustomActionAttachment": { + "type": "structure", + "members": { + "NotificationType": { + "target": "com.amazonaws.chatbot#CustomActionAttachmentNotificationType", + "traits": { + "smithy.api#documentation": "

The type of notification that the custom action should be attached to.

" + } + }, + "ButtonText": { + "target": "com.amazonaws.chatbot#CustomActionButtonText", + "traits": { + "smithy.api#documentation": "

The text of the button that appears on the notification.

" + } + }, + "Criteria": { + "target": "com.amazonaws.chatbot#CustomActionAttachmentCriteriaList", + "traits": { + "smithy.api#documentation": "

The criteria for when a button should be shown based on values in the notification.

" + } + }, + "Variables": { + "target": "com.amazonaws.chatbot#CustomActionAttachmentVariables", + "traits": { + "smithy.api#documentation": "

The variables to extract from the notification.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Defines when a custom action button should be attached to a notification.

" + } + }, + "com.amazonaws.chatbot#CustomActionAttachmentCriteria": { + "type": "structure", + "members": { + "Operator": { + "target": "com.amazonaws.chatbot#CustomActionAttachmentCriteriaOperator", + "traits": { + "smithy.api#documentation": "

The operation to perform on the named variable.

", + "smithy.api#required": {} + } + }, + "VariableName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the variable to operate on.

", + "smithy.api#length": { + "min": 1, + "max": 100 + }, + "smithy.api#pattern": "^[A-Za-z0-9-_]+$", + "smithy.api#required": {} + } + }, + "Value": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A value that is compared with the actual value of the variable based on the behavior of the operator.

", + "smithy.api#length": { + "min": 0, + "max": 1024 + }, + "smithy.api#pattern": "^[\\S\\s]+$" + } + } + }, + "traits": { + "smithy.api#documentation": "

A criteria for when a button should be shown based on values in the notification

" + } + }, + "com.amazonaws.chatbot#CustomActionAttachmentCriteriaList": { + "type": "list", + "member": { + "target": "com.amazonaws.chatbot#CustomActionAttachmentCriteria" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 5 + } + } + }, + "com.amazonaws.chatbot#CustomActionAttachmentCriteriaOperator": { + "type": "enum", + "members": { + "HAS_VALUE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HAS_VALUE" + } + }, + "EQUALS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EQUALS" + } + } + } + }, + "com.amazonaws.chatbot#CustomActionAttachmentList": { + "type": "list", + "member": { + "target": "com.amazonaws.chatbot#CustomActionAttachment" + } + }, + "com.amazonaws.chatbot#CustomActionAttachmentNotificationType": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + }, + "smithy.api#pattern": "^[a-zA-Z0-9-]+$" + } + }, + "com.amazonaws.chatbot#CustomActionAttachmentVariables": { + "type": "map", + "key": { + "target": "smithy.api#String", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + }, + "smithy.api#pattern": "^[A-Za-z0-9-_]+$" + } + }, + "value": { + "target": "smithy.api#String", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1024 + }, + "smithy.api#pattern": "^[\\x21-\\x7F]+$" + } + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 5 + } + } + }, + "com.amazonaws.chatbot#CustomActionButtonText": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 50 + }, + "smithy.api#pattern": "^[\\S\\s]+$" + } + }, + "com.amazonaws.chatbot#CustomActionDefinition": { + "type": "structure", + "members": { + "CommandText": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The command string to run which may include variables by prefixing with a dollar sign ($).

", + "smithy.api#length": { + "min": 1, + "max": 100 + }, + "smithy.api#pattern": "^[\\S\\s]+$", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The definition of the command to run when invoked as an alias or as an action button.

" + } + }, + "com.amazonaws.chatbot#CustomActionName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "com.amazonaws.chatbot#CustomActionResource": { + "type": "resource", + "identifiers": { + "CustomActionArn": { + "target": "com.amazonaws.chatbot#CustomActionArn" + } + }, + "properties": { + "ActionName": { + "target": "com.amazonaws.chatbot#CustomActionName" + }, + "Definition": { + "target": "com.amazonaws.chatbot#CustomActionDefinition" + }, + "AliasName": { + "target": "com.amazonaws.chatbot#CustomActionAliasName" + }, + "Attachments": { + "target": "com.amazonaws.chatbot#CustomActionAttachmentList" + }, + "Tags": { + "target": "com.amazonaws.chatbot#TagList" + } + }, + "create": { + "target": "com.amazonaws.chatbot#CreateCustomAction" + }, + "read": { + "target": "com.amazonaws.chatbot#GetCustomAction" + }, + "update": { + "target": "com.amazonaws.chatbot#UpdateCustomAction" + }, + "delete": { + "target": "com.amazonaws.chatbot#DeleteCustomAction" + }, + "list": { + "target": "com.amazonaws.chatbot#ListCustomActions" + }, + "traits": { + "aws.api#arn": { + "template": "{CustomActionArn}", + "absolute": true + }, + "aws.iam#disableConditionKeyInference": {}, + "aws.iam#iamResource": { + "name": "custom-action", + "relativeDocumentation": "what-is.html" + } + } + }, "com.amazonaws.chatbot#CustomerCwLogLevel": { "type": "string", "traits": { @@ -655,6 +1219,14 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to delete an AWS Chatbot Chime Webhook Configuration", + "resources": { + "required": { + "ChatbotConfiguration": {} + } + } + }, "smithy.api#documentation": "

Deletes a Amazon Chime webhook configuration for AWS Chatbot.

", "smithy.api#http": { "method": "POST", @@ -698,6 +1270,73 @@ "smithy.api#output": {} } }, + "com.amazonaws.chatbot#DeleteCustomAction": { + "type": "operation", + "input": { + "target": "com.amazonaws.chatbot#DeleteCustomActionRequest" + }, + "output": { + "target": "com.amazonaws.chatbot#DeleteCustomActionResult" + }, + "errors": [ + { + "target": "com.amazonaws.chatbot#InternalServiceError" + }, + { + "target": "com.amazonaws.chatbot#InvalidRequestException" + }, + { + "target": "com.amazonaws.chatbot#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.chatbot#UnauthorizedException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to delete a custom action" + }, + "smithy.api#documentation": "

Deletes a custom action.

", + "smithy.api#examples": [ + { + "title": "Delete a custom action", + "input": { + "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action" + }, + "output": {} + } + ], + "smithy.api#http": { + "code": 204, + "method": "POST", + "uri": "/delete-custom-action" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.chatbot#DeleteCustomActionRequest": { + "type": "structure", + "members": { + "CustomActionArn": { + "target": "com.amazonaws.chatbot#CustomActionArn", + "traits": { + "smithy.api#documentation": "

The fully defined ARN of the custom action.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "CustomActionArn" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.chatbot#DeleteCustomActionResult": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.chatbot#DeleteMicrosoftTeamsChannelConfiguration": { "type": "operation", "input": { @@ -721,6 +1360,14 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to delete an AWS Chatbot Microsoft Teams Channel Configuration", + "resources": { + "required": { + "ChatbotConfiguration": {} + } + } + }, "smithy.api#documentation": "

Deletes a Microsoft Teams channel configuration for AWS Chatbot

", "smithy.api#http": { "method": "POST", @@ -747,6 +1394,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to delete the Microsoft Teams configured with AWS Chatbot in an AWS account" + }, "smithy.api#documentation": "

Deletes the Microsoft Teams team authorization allowing for channels to be configured in that Microsoft Teams team. Note that the Microsoft Teams team must have no channels configured to remove it.\n

", "smithy.api#http": { "method": "POST", @@ -776,6 +1426,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to delete an AWS Chatbot Microsoft Teams User Identity" + }, "smithy.api#documentation": "

Identifes a user level permission for a channel configuration.

", "smithy.api#http": { "method": "POST", @@ -849,6 +1502,14 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to delete an AWS Chatbot Slack Channel Configuration", + "resources": { + "required": { + "ChatbotConfiguration": {} + } + } + }, "smithy.api#documentation": "

Deletes a Slack channel configuration for AWS Chatbot

", "smithy.api#http": { "method": "POST", @@ -912,6 +1573,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to delete an AWS Chatbot Slack User Identity" + }, "smithy.api#documentation": "

Deletes a user level permission for a Slack channel configuration.

", "smithy.api#http": { "method": "POST", @@ -986,6 +1650,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to delete the Slack workspace authorization with AWS Chatbot, associated with an AWS account" + }, "smithy.api#documentation": "

Deletes the Slack workspace authorization that allows channels to be configured in that workspace. This requires all configured channels in the workspace to be deleted.\n

", "smithy.api#http": { "method": "POST", @@ -1119,6 +1786,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to list all AWS Chatbot Chime Webhook Configurations in an AWS Account" + }, "smithy.api#documentation": "

Lists Amazon Chime webhook configurations optionally filtered by ChatConfigurationArn

", "smithy.api#http": { "method": "POST", @@ -1165,7 +1835,7 @@ "ChatConfigurationArn": { "target": "com.amazonaws.chatbot#ChatConfigurationArn", "traits": { - "smithy.api#documentation": "

An optional Amazon Resource Number (ARN) of a ChimeWebhookConfiguration to describe.

" + "smithy.api#documentation": "

An optional Amazon Resource Name (ARN) of a ChimeWebhookConfiguration to describe.

" } } }, @@ -1213,6 +1883,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to list all AWS Chatbot Slack Channel Configurations in an AWS account" + }, "smithy.api#documentation": "

Lists Slack channel configurations optionally filtered by ChatConfigurationArn

", "smithy.api#http": { "method": "POST", @@ -1259,7 +1932,7 @@ "ChatConfigurationArn": { "target": "com.amazonaws.chatbot#ChatConfigurationArn", "traits": { - "smithy.api#documentation": "

An optional Amazon Resource Number (ARN) of a SlackChannelConfiguration to describe.

" + "smithy.api#documentation": "

An optional Amazon Resource Name (ARN) of a SlackChannelConfiguration to describe.

" } } }, @@ -1307,6 +1980,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to describe AWS Chatbot Slack User Identities" + }, "smithy.api#documentation": "

Lists all Slack user identities with a mapped role.

", "smithy.api#http": { "method": "POST", @@ -1341,7 +2017,7 @@ "ChatConfigurationArn": { "target": "com.amazonaws.chatbot#ChatConfigurationArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Number (ARN) of the SlackChannelConfiguration associated with the user identities to describe.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the SlackChannelConfiguration associated with the user identities to describe.

" } }, "NextToken": { @@ -1401,6 +2077,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to list all authorized Slack workspaces connected to the AWS Account onboarded with AWS Chatbot service" + }, "smithy.api#documentation": "

List all authorized Slack workspaces connected to the AWS Account onboarded with AWS Chatbot.

", "smithy.api#http": { "method": "POST", @@ -1469,6 +2148,83 @@ "smithy.api#output": {} } }, + "com.amazonaws.chatbot#DisassociateFromConfiguration": { + "type": "operation", + "input": { + "target": "com.amazonaws.chatbot#DisassociateFromConfigurationRequest" + }, + "output": { + "target": "com.amazonaws.chatbot#DisassociateFromConfigurationResult" + }, + "errors": [ + { + "target": "com.amazonaws.chatbot#InternalServiceError" + }, + { + "target": "com.amazonaws.chatbot#InvalidRequestException" + }, + { + "target": "com.amazonaws.chatbot#UnauthorizedException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to disassociate a resource from a configuration", + "resources": { + "required": { + "ChatbotConfiguration": {}, + "custom-action": {} + } + } + }, + "smithy.api#documentation": "

Unlink a resource, for example a custom action, from a channel configuration.

", + "smithy.api#examples": [ + { + "title": "Disassociate a custom action from a configuration", + "input": { + "Resource": "arn:aws:chatbot::1234567890:custom-action/my-custom-action", + "ChatConfiguration": "arn:aws:chatbot::1234567890:chat-configuration/slack-channel/my-channel" + }, + "output": {} + } + ], + "smithy.api#http": { + "code": 204, + "method": "POST", + "uri": "/disassociate-from-configuration" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.chatbot#DisassociateFromConfigurationRequest": { + "type": "structure", + "members": { + "Resource": { + "target": "com.amazonaws.chatbot#ResourceIdentifier", + "traits": { + "smithy.api#documentation": "

The resource (for example, a custom action) Amazon Resource Name (ARN) to unlink.

", + "smithy.api#required": {} + } + }, + "ChatConfiguration": { + "target": "com.amazonaws.chatbot#ChatConfigurationArn", + "traits": { + "smithy.api#documentation": "

The channel configuration the resource is being disassociated from.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.chatbot#DisassociateFromConfigurationResult": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.chatbot#ErrorMessage": { "type": "string" }, @@ -1489,42 +2245,128 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to retrieve AWS Chatbot account preferences" + }, "smithy.api#documentation": "

Returns AWS Chatbot account preferences.

", "smithy.api#http": { "method": "POST", - "uri": "/get-account-preferences", - "code": 200 + "uri": "/get-account-preferences", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.chatbot#GetAccountPreferencesException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.chatbot#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

We can’t process your request right now because of a server issue. Try again later.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500 + } + }, + "com.amazonaws.chatbot#GetAccountPreferencesRequest": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.chatbot#GetAccountPreferencesResult": { + "type": "structure", + "members": { + "AccountPreferences": { + "target": "com.amazonaws.chatbot#AccountPreferences", + "traits": { + "smithy.api#documentation": "

The preferences related to AWS Chatbot usage in the calling AWS account.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.chatbot#GetCustomAction": { + "type": "operation", + "input": { + "target": "com.amazonaws.chatbot#GetCustomActionRequest" + }, + "output": { + "target": "com.amazonaws.chatbot#GetCustomActionResult" + }, + "errors": [ + { + "target": "com.amazonaws.chatbot#InternalServiceError" + }, + { + "target": "com.amazonaws.chatbot#InvalidRequestException" + }, + { + "target": "com.amazonaws.chatbot#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.chatbot#UnauthorizedException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to get a custom action" + }, + "smithy.api#documentation": "

Returns a custom action.

", + "smithy.api#examples": [ + { + "title": "Get a custom action", + "input": { + "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action" + }, + "output": { + "CustomAction": { + "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action", + "ActionName": "my-custom-action", + "Definition": { + "CommandText": "lambda invoke $functionName" + } + } + } + } + ], + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/get-custom-action" }, "smithy.api#readonly": {} } }, - "com.amazonaws.chatbot#GetAccountPreferencesException": { + "com.amazonaws.chatbot#GetCustomActionRequest": { "type": "structure", "members": { - "Message": { - "target": "com.amazonaws.chatbot#ErrorMessage" + "CustomActionArn": { + "target": "com.amazonaws.chatbot#CustomActionArn", + "traits": { + "smithy.api#documentation": "

Returns the fully defined Amazon Resource Name (ARN) of the custom action.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "CustomActionArn" + } } }, - "traits": { - "smithy.api#documentation": "

We can’t process your request right now because of a server issue. Try again later.

", - "smithy.api#error": "server", - "smithy.api#httpError": 500 - } - }, - "com.amazonaws.chatbot#GetAccountPreferencesRequest": { - "type": "structure", - "members": {}, "traits": { "smithy.api#input": {} } }, - "com.amazonaws.chatbot#GetAccountPreferencesResult": { + "com.amazonaws.chatbot#GetCustomActionResult": { "type": "structure", "members": { - "AccountPreferences": { - "target": "com.amazonaws.chatbot#AccountPreferences", + "CustomAction": { + "target": "com.amazonaws.chatbot#CustomAction", "traits": { - "smithy.api#documentation": "

The preferences related to AWS Chatbot usage in the calling AWS account.

" + "smithy.api#documentation": "

Returns the custom action.

", + "smithy.api#nestedProperties": {} } } }, @@ -1552,6 +2394,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to get a single AWS Chatbot Microsoft Teams Channel Configurations in an AWS account" + }, "smithy.api#documentation": "

Returns a Microsoft Teams channel configuration in an AWS account.

", "smithy.api#http": { "method": "POST", @@ -1581,7 +2426,7 @@ "ChatConfigurationArn": { "target": "com.amazonaws.chatbot#ChatConfigurationArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Number (ARN) of the MicrosoftTeamsChannelConfiguration to retrieve.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the MicrosoftTeamsChannelConfiguration to retrieve.

", "smithy.api#required": {} } } @@ -1672,6 +2517,217 @@ "smithy.api#httpError": 403 } }, + "com.amazonaws.chatbot#ListAssociations": { + "type": "operation", + "input": { + "target": "com.amazonaws.chatbot#ListAssociationsRequest" + }, + "output": { + "target": "com.amazonaws.chatbot#ListAssociationsResult" + }, + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to list resources associated with a configuration", + "resources": { + "required": { + "ChatbotConfiguration": {} + } + } + }, + "smithy.api#documentation": "

Lists resources associated with a channel configuration.

", + "smithy.api#examples": [ + { + "title": "List custom actions associated with a configuration", + "input": { + "ChatConfiguration": "arn:aws:chatbot::1234567890:chat-configuration/slack-channel/my-channel" + }, + "output": { + "Associations": [ + { + "Resource": "arn:aws:chatbot::1234567890:custom-action/my-custom-action" + } + ] + } + } + ], + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/list-associations" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Associations" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.chatbot#ListAssociationsRequest": { + "type": "structure", + "members": { + "ChatConfiguration": { + "target": "com.amazonaws.chatbot#ChatConfigurationArn", + "traits": { + "smithy.api#documentation": "

The channel configuration to list associations for.

", + "smithy.api#required": {} + } + }, + "MaxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

", + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "NextToken": { + "target": "com.amazonaws.chatbot#String", + "traits": { + "smithy.api#documentation": "

An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

", + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^[\\x20-\\x7F]+$" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.chatbot#ListAssociationsResult": { + "type": "structure", + "members": { + "Associations": { + "target": "com.amazonaws.chatbot#AssociationList", + "traits": { + "smithy.api#documentation": "

The resources associated with this channel configuration.

", + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "com.amazonaws.chatbot#String", + "traits": { + "smithy.api#documentation": "

An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

", + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^[\\x20-\\x7F]+$" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.chatbot#ListCustomActions": { + "type": "operation", + "input": { + "target": "com.amazonaws.chatbot#ListCustomActionsRequest" + }, + "output": { + "target": "com.amazonaws.chatbot#ListCustomActionsResult" + }, + "errors": [ + { + "target": "com.amazonaws.chatbot#InternalServiceError" + }, + { + "target": "com.amazonaws.chatbot#InvalidRequestException" + }, + { + "target": "com.amazonaws.chatbot#UnauthorizedException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to list custom actions" + }, + "smithy.api#documentation": "

Lists custom actions defined in this account.

", + "smithy.api#examples": [ + { + "title": "List custom actions", + "input": {}, + "output": { + "CustomActions": ["arn:aws:chatbot::1234567890:custom-action/my-custom-action"] + } + } + ], + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/list-custom-actions" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "CustomActions" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.chatbot#ListCustomActionsRequest": { + "type": "structure", + "members": { + "MaxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

", + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "NextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

", + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^[\\x20-\\x7F]+$" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.chatbot#ListCustomActionsResult": { + "type": "structure", + "members": { + "CustomActions": { + "target": "com.amazonaws.chatbot#CustomActionArnList", + "traits": { + "smithy.api#documentation": "

A list of custom actions.

", + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

", + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^[\\x20-\\x7F]+$" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.chatbot#ListMicrosoftTeamsChannelConfigurations": { "type": "operation", "input": { @@ -1692,6 +2748,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to list all AWS Chatbot Microsoft Teams Channel Configurations in an AWS account" + }, "smithy.api#documentation": "

Lists all AWS Chatbot Microsoft Teams channel configurations in an AWS account.

", "smithy.api#http": { "method": "POST", @@ -1728,6 +2787,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to list all Microsoft Teams connected to the AWS Account onboarded with AWS Chatbot service" + }, "smithy.api#documentation": "

Lists all authorized Microsoft Teams for an AWS Account

", "smithy.api#http": { "method": "POST", @@ -1816,6 +2878,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to describe AWS Chatbot Microsoft Teams User Identities" + }, "smithy.api#documentation": "

A list all Microsoft Teams user identities with a mapped role.

", "smithy.api#http": { "method": "POST", @@ -1850,7 +2915,7 @@ "ChatConfigurationArn": { "target": "com.amazonaws.chatbot#ChatConfigurationArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Number (ARN) of the MicrosoftTeamsChannelConfiguration associated with the user identities to list.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the MicrosoftTeamsChannelConfiguration associated with the user identities to list.

" } }, "NextToken": { @@ -1910,6 +2975,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to List all tags associated with the AWS Chatbot Channel Configuration" + }, "smithy.api#documentation": "

Lists all of the tags associated with the Amazon Resource Name (ARN) that you specify. The resource can be a user, server, or role.

", "smithy.api#http": { "method": "POST", @@ -1925,7 +2993,7 @@ "ResourceARN": { "target": "com.amazonaws.chatbot#AmazonResourceName", "traits": { - "smithy.api#documentation": "

The ARN you specified to list the tags of.

", + "smithy.api#documentation": "

The ARN of the resource to list tags for.

", "smithy.api#required": {} } } @@ -2026,6 +3094,16 @@ "smithy.api#pattern": "^[a-zA-Z0-9=\\/+_.\\-,#:\\\\\"{}]{4,1276}$" } }, + "com.amazonaws.chatbot#ResourceIdentifier": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1011 + }, + "smithy.api#pattern": "^arn:aws:chatbot:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:custom-action/[a-zA-Z0-9_-]{1,64}$" + } + }, "com.amazonaws.chatbot#ResourceNotFoundException": { "type": "structure", "members": { @@ -2092,7 +3170,7 @@ "ChatConfigurationArn": { "target": "com.amazonaws.chatbot#ChatConfigurationArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Number (ARN) of the SlackChannelConfiguration.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the SlackChannelConfiguration.

", "smithy.api#required": {} } }, @@ -2231,7 +3309,7 @@ "ChatConfigurationArn": { "target": "com.amazonaws.chatbot#ChatConfigurationArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Number (ARN) of the SlackChannelConfiguration associated with the user identity to delete.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the SlackChannelConfiguration associated with the user identity to delete.

", "smithy.api#required": {} } }, @@ -2346,6 +3424,7 @@ "target": "com.amazonaws.chatbot#TagKey" }, "traits": { + "aws.api#data": "tagging", "smithy.api#length": { "min": 0, "max": 200 @@ -2387,6 +3466,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to create tags on AWS Chatbot Channel Configuration" + }, "smithy.api#documentation": "

Attaches a key-value pair to a resource, as identified by its Amazon Resource Name (ARN). Resources are users, servers, roles, and other entities.

", "smithy.api#http": { "method": "POST", @@ -2408,6 +3490,7 @@ "Tags": { "target": "com.amazonaws.chatbot#TagList", "traits": { + "aws.api#data": "tagging", "smithy.api#documentation": "

A list of tags to apply to the configuration.

", "smithy.api#required": {} } @@ -2663,6 +3746,19 @@ "smithy.api#pattern": "^[0-9A-Fa-f]{8}(?:-[0-9A-Fa-f]{4}){3}-[0-9A-Fa-f]{12}$" } }, + "com.amazonaws.chatbot#UnauthorizedException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.chatbot#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

The request was rejected because it doesn't have valid credentials for the target resource.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, "com.amazonaws.chatbot#UntagResource": { "type": "operation", "input": { @@ -2683,6 +3779,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to remove tags on AWS Chatbot Channel Configuration" + }, "smithy.api#documentation": "

Detaches a key-value pair from a resource, as identified by its Amazon Resource Name (ARN). Resources are users, servers, roles, and other entities.

", "smithy.api#http": { "method": "POST", @@ -2704,6 +3803,7 @@ "TagKeys": { "target": "com.amazonaws.chatbot#TagKeyList", "traits": { + "aws.api#data": "tagging", "smithy.api#documentation": "

TagKeys are key-value pairs assigned to ARNs that can be used to group and search for resources by type. This metadata can be attached to resources for any purpose.

", "smithy.api#required": {} } @@ -2740,6 +3840,9 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to update AWS Chatbot account preferences" + }, "smithy.api#documentation": "

Updates AWS Chatbot account preferences.

", "smithy.api#http": { "method": "POST", @@ -2818,6 +3921,14 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to update an AWS Chatbot Chime Webhook Configuration", + "resources": { + "required": { + "ChatbotConfiguration": {} + } + } + }, "smithy.api#documentation": "

Updates a Amazon Chime webhook configuration.

", "smithy.api#http": { "method": "POST", @@ -2845,7 +3956,7 @@ "ChatConfigurationArn": { "target": "com.amazonaws.chatbot#ChatConfigurationArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Number (ARN) of the ChimeWebhookConfiguration to update.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the ChimeWebhookConfiguration to update.

", "smithy.api#required": {} } }, @@ -2898,6 +4009,106 @@ "smithy.api#output": {} } }, + "com.amazonaws.chatbot#UpdateCustomAction": { + "type": "operation", + "input": { + "target": "com.amazonaws.chatbot#UpdateCustomActionRequest" + }, + "output": { + "target": "com.amazonaws.chatbot#UpdateCustomActionResult" + }, + "errors": [ + { + "target": "com.amazonaws.chatbot#InternalServiceError" + }, + { + "target": "com.amazonaws.chatbot#InvalidRequestException" + }, + { + "target": "com.amazonaws.chatbot#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.chatbot#UnauthorizedException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to update a custom action" + }, + "smithy.api#documentation": "

Updates a custom action.

", + "smithy.api#examples": [ + { + "title": "Update the command definition of an existing action", + "documentation": "Updates the command text of a custom action without altering the existing alias name or attachment criteria", + "input": { + "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action", + "Definition": { + "CommandText": "lambda invoke MyNewFunction" + } + }, + "output": { + "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action" + } + } + ], + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/update-custom-action" + } + } + }, + "com.amazonaws.chatbot#UpdateCustomActionRequest": { + "type": "structure", + "members": { + "CustomActionArn": { + "target": "com.amazonaws.chatbot#CustomActionArn", + "traits": { + "smithy.api#documentation": "

The fully defined Amazon Resource Name (ARN) of the custom action.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "CustomActionArn" + } + }, + "Definition": { + "target": "com.amazonaws.chatbot#CustomActionDefinition", + "traits": { + "smithy.api#documentation": "

The definition of the command to run when invoked as an alias or as an action button.

", + "smithy.api#required": {} + } + }, + "AliasName": { + "target": "com.amazonaws.chatbot#CustomActionAliasName", + "traits": { + "smithy.api#documentation": "

The name used to invoke this action in the chat channel. For example, @aws run my-alias.

" + } + }, + "Attachments": { + "target": "com.amazonaws.chatbot#CustomActionAttachmentList", + "traits": { + "smithy.api#documentation": "

Defines when this custom action button should be attached to a notification.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.chatbot#UpdateCustomActionResult": { + "type": "structure", + "members": { + "CustomActionArn": { + "target": "com.amazonaws.chatbot#CustomActionArn", + "traits": { + "smithy.api#documentation": "

The fully defined ARN of the custom action.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "CustomActionArn" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.chatbot#UpdateMicrosoftTeamsChannelConfiguration": { "type": "operation", "input": { @@ -2921,6 +4132,14 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to update an AWS Chatbot Microsoft Teams Channel Configuration", + "resources": { + "required": { + "ChatbotConfiguration": {} + } + } + }, "smithy.api#documentation": "

Updates an Microsoft Teams channel configuration.

", "smithy.api#http": { "method": "POST", @@ -2953,6 +4172,14 @@ } ], "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to update an AWS Chatbot Slack Channel Configuration", + "resources": { + "required": { + "ChatbotConfiguration": {} + } + } + }, "smithy.api#documentation": "

Updates a Slack channel configuration.

", "smithy.api#http": { "method": "POST", @@ -2980,7 +4207,7 @@ "ChatConfigurationArn": { "target": "com.amazonaws.chatbot#ChatConfigurationArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Number (ARN) of the SlackChannelConfiguration to update.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the SlackChannelConfiguration to update.

", "smithy.api#required": {} } }, @@ -3065,7 +4292,7 @@ "ChatConfigurationArn": { "target": "com.amazonaws.chatbot#ChatConfigurationArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Number (ARN) of the TeamsChannelConfiguration to update.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the TeamsChannelConfiguration to update.

", "smithy.api#required": {} } }, @@ -3135,6 +4362,9 @@ "type": "service", "version": "2017-10-11", "operations": [ + { + "target": "com.amazonaws.chatbot#AssociateToConfiguration" + }, { "target": "com.amazonaws.chatbot#CreateChimeWebhookConfiguration" }, @@ -3177,12 +4407,18 @@ { "target": "com.amazonaws.chatbot#DescribeSlackWorkspaces" }, + { + "target": "com.amazonaws.chatbot#DisassociateFromConfiguration" + }, { "target": "com.amazonaws.chatbot#GetAccountPreferences" }, { "target": "com.amazonaws.chatbot#GetMicrosoftTeamsChannelConfiguration" }, + { + "target": "com.amazonaws.chatbot#ListAssociations" + }, { "target": "com.amazonaws.chatbot#ListMicrosoftTeamsChannelConfigurations" }, @@ -3214,6 +4450,11 @@ "target": "com.amazonaws.chatbot#UpdateSlackChannelConfiguration" } ], + "resources": [ + { + "target": "com.amazonaws.chatbot#CustomActionResource" + } + ], "traits": { "aws.api#service": { "sdkId": "chatbot", @@ -3225,6 +4466,7 @@ "aws.auth#sigv4": { "name": "chatbot" }, + "aws.iam#supportedPrincipalTypes": ["Root", "IAMUser", "IAMRole", "FederatedUser"], "aws.protocols#restJson1": {}, "smithy.api#auth": ["aws.auth#sigv4"], "smithy.api#cors": {