Skip to content

Commit 21b5399

Browse files
author
awstools
committed
feat(clients): update command documentation examples as of 2024-11-25
1 parent 453f462 commit 21b5399

8 files changed

+157
-0
lines changed

clients/client-chatbot/src/commands/AssociateToConfigurationCommand.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ export interface AssociateToConfigurationCommandOutput extends AssociateToConfig
6464
* <p>Base exception class for all service exceptions from Chatbot service.</p>
6565
*
6666
* @public
67+
* @example Associate a custom action to a configuration
68+
* ```javascript
69+
* // Associate a custom action to a channel configuration, allowing it to be used in that channel
70+
* const input = {
71+
* "ChatConfiguration": "arn:aws:chatbot::1234567890:chat-configuration/slack-channel/my-channel",
72+
* "Resource": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
73+
* };
74+
* const command = new AssociateToConfigurationCommand(input);
75+
* await client.send(command);
76+
* // example id: example-1
77+
* ```
78+
*
6779
*/
6880
export class AssociateToConfigurationCommand extends $Command
6981
.classBuilder<

clients/client-chatbot/src/commands/CreateCustomActionCommand.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,51 @@ export interface CreateCustomActionCommandOutput extends CreateCustomActionResul
9898
* <p>Base exception class for all service exceptions from Chatbot service.</p>
9999
*
100100
* @public
101+
* @example Create an alias that invokes a Lambda function
102+
* ```javascript
103+
* // 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.
104+
* const input = {
105+
* "ActionName": "my-custom-action",
106+
* "AliasName": "invoke",
107+
* "Definition": {
108+
* "CommandText": "lambda invoke $functionName"
109+
* }
110+
* };
111+
* const command = new CreateCustomActionCommand(input);
112+
* const response = await client.send(command);
113+
* /* response ==
114+
* {
115+
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
116+
* }
117+
* *\/
118+
* // example id: example-1
119+
* ```
120+
*
121+
* @example Create a custom action to list alarms
122+
* ```javascript
123+
* // Creates a button on all Cloudwatch notifications that lists alarms in the ‘ALARM’ state.
124+
* const input = {
125+
* "ActionName": "describe-alarms",
126+
* "Attachments": [
127+
* {
128+
* "ButtonText": "List alarms",
129+
* "NotificationType": "CloudWatch"
130+
* }
131+
* ],
132+
* "Definition": {
133+
* "CommandText": "cloudwatch describe-alarms --state-value ALARM"
134+
* }
135+
* };
136+
* const command = new CreateCustomActionCommand(input);
137+
* const response = await client.send(command);
138+
* /* response ==
139+
* {
140+
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/describe-alarms"
141+
* }
142+
* *\/
143+
* // example id: example-2
144+
* ```
145+
*
101146
*/
102147
export class CreateCustomActionCommand extends $Command
103148
.classBuilder<

clients/client-chatbot/src/commands/DeleteCustomActionCommand.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ export interface DeleteCustomActionCommandOutput extends DeleteCustomActionResul
6666
* <p>Base exception class for all service exceptions from Chatbot service.</p>
6767
*
6868
* @public
69+
* @example Delete a custom action
70+
* ```javascript
71+
* //
72+
* const input = {
73+
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
74+
* };
75+
* const command = new DeleteCustomActionCommand(input);
76+
* await client.send(command);
77+
* // example id: example-1
78+
* ```
79+
*
6980
*/
7081
export class DeleteCustomActionCommand extends $Command
7182
.classBuilder<

clients/client-chatbot/src/commands/DisassociateFromConfigurationCommand.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ export interface DisassociateFromConfigurationCommandOutput
6969
* <p>Base exception class for all service exceptions from Chatbot service.</p>
7070
*
7171
* @public
72+
* @example Disassociate a custom action from a configuration
73+
* ```javascript
74+
* //
75+
* const input = {
76+
* "ChatConfiguration": "arn:aws:chatbot::1234567890:chat-configuration/slack-channel/my-channel",
77+
* "Resource": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
78+
* };
79+
* const command = new DisassociateFromConfigurationCommand(input);
80+
* await client.send(command);
81+
* // example id: example-1
82+
* ```
83+
*
7284
*/
7385
export class DisassociateFromConfigurationCommand extends $Command
7486
.classBuilder<

clients/client-chatbot/src/commands/GetCustomActionCommand.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,28 @@ export interface GetCustomActionCommandOutput extends GetCustomActionResult, __M
9191
* <p>Base exception class for all service exceptions from Chatbot service.</p>
9292
*
9393
* @public
94+
* @example Get a custom action
95+
* ```javascript
96+
* //
97+
* const input = {
98+
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
99+
* };
100+
* const command = new GetCustomActionCommand(input);
101+
* const response = await client.send(command);
102+
* /* response ==
103+
* {
104+
* "CustomAction": {
105+
* "ActionName": "my-custom-action",
106+
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action",
107+
* "Definition": {
108+
* "CommandText": "lambda invoke $functionName"
109+
* }
110+
* }
111+
* }
112+
* *\/
113+
* // example id: example-1
114+
* ```
115+
*
94116
*/
95117
export class GetCustomActionCommand extends $Command
96118
.classBuilder<

clients/client-chatbot/src/commands/ListAssociationsCommand.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,26 @@ export interface ListAssociationsCommandOutput extends ListAssociationsResult, _
6363
* <p>Base exception class for all service exceptions from Chatbot service.</p>
6464
*
6565
* @public
66+
* @example List custom actions associated with a configuration
67+
* ```javascript
68+
* //
69+
* const input = {
70+
* "ChatConfiguration": "arn:aws:chatbot::1234567890:chat-configuration/slack-channel/my-channel"
71+
* };
72+
* const command = new ListAssociationsCommand(input);
73+
* const response = await client.send(command);
74+
* /* response ==
75+
* {
76+
* "Associations": [
77+
* {
78+
* "Resource": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
79+
* }
80+
* ]
81+
* }
82+
* *\/
83+
* // example id: example-1
84+
* ```
85+
*
6686
*/
6787
export class ListAssociationsCommand extends $Command
6888
.classBuilder<

clients/client-chatbot/src/commands/ListCustomActionsCommand.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,22 @@ export interface ListCustomActionsCommandOutput extends ListCustomActionsResult,
6969
* <p>Base exception class for all service exceptions from Chatbot service.</p>
7070
*
7171
* @public
72+
* @example List custom actions
73+
* ```javascript
74+
* //
75+
* const input = {};
76+
* const command = new ListCustomActionsCommand(input);
77+
* const response = await client.send(command);
78+
* /* response ==
79+
* {
80+
* "CustomActions": [
81+
* "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
82+
* ]
83+
* }
84+
* *\/
85+
* // example id: example-1
86+
* ```
87+
*
7288
*/
7389
export class ListCustomActionsCommand extends $Command
7490
.classBuilder<

clients/client-chatbot/src/commands/UpdateCustomActionCommand.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,25 @@ export interface UpdateCustomActionCommandOutput extends UpdateCustomActionResul
8888
* <p>Base exception class for all service exceptions from Chatbot service.</p>
8989
*
9090
* @public
91+
* @example Update the command definition of an existing action
92+
* ```javascript
93+
* // Updates the command text of a custom action without altering the existing alias name or attachment criteria
94+
* const input = {
95+
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action",
96+
* "Definition": {
97+
* "CommandText": "lambda invoke MyNewFunction"
98+
* }
99+
* };
100+
* const command = new UpdateCustomActionCommand(input);
101+
* const response = await client.send(command);
102+
* /* response ==
103+
* {
104+
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
105+
* }
106+
* *\/
107+
* // example id: example-1
108+
* ```
109+
*
91110
*/
92111
export class UpdateCustomActionCommand extends $Command
93112
.classBuilder<

0 commit comments

Comments
 (0)