Skip to content

Commit

Permalink
feat(clients): update command documentation examples as of 2024-11-25
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Nov 25, 2024
1 parent 453f462 commit 21b5399
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ export interface AssociateToConfigurationCommandOutput extends AssociateToConfig
* <p>Base exception class for all service exceptions from Chatbot service.</p>
*
* @public
* @example Associate a custom action to a configuration
* ```javascript
* // Associate a custom action to a channel configuration, allowing it to be used in that channel
* const input = {
* "ChatConfiguration": "arn:aws:chatbot::1234567890:chat-configuration/slack-channel/my-channel",
* "Resource": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
* };
* const command = new AssociateToConfigurationCommand(input);
* await client.send(command);
* // example id: example-1
* ```
*
*/
export class AssociateToConfigurationCommand extends $Command
.classBuilder<
Expand Down
45 changes: 45 additions & 0 deletions clients/client-chatbot/src/commands/CreateCustomActionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,51 @@ export interface CreateCustomActionCommandOutput extends CreateCustomActionResul
* <p>Base exception class for all service exceptions from Chatbot service.</p>
*
* @public
* @example Create an alias that invokes a Lambda function
* ```javascript
* // 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.
* const input = {
* "ActionName": "my-custom-action",
* "AliasName": "invoke",
* "Definition": {
* "CommandText": "lambda invoke $functionName"
* }
* };
* const command = new CreateCustomActionCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
* }
* *\/
* // example id: example-1
* ```
*
* @example Create a custom action to list alarms
* ```javascript
* // Creates a button on all Cloudwatch notifications that lists alarms in the ‘ALARM’ state.
* const input = {
* "ActionName": "describe-alarms",
* "Attachments": [
* {
* "ButtonText": "List alarms",
* "NotificationType": "CloudWatch"
* }
* ],
* "Definition": {
* "CommandText": "cloudwatch describe-alarms --state-value ALARM"
* }
* };
* const command = new CreateCustomActionCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/describe-alarms"
* }
* *\/
* // example id: example-2
* ```
*
*/
export class CreateCustomActionCommand extends $Command
.classBuilder<
Expand Down
11 changes: 11 additions & 0 deletions clients/client-chatbot/src/commands/DeleteCustomActionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ export interface DeleteCustomActionCommandOutput extends DeleteCustomActionResul
* <p>Base exception class for all service exceptions from Chatbot service.</p>
*
* @public
* @example Delete a custom action
* ```javascript
* //
* const input = {
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
* };
* const command = new DeleteCustomActionCommand(input);
* await client.send(command);
* // example id: example-1
* ```
*
*/
export class DeleteCustomActionCommand extends $Command
.classBuilder<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ export interface DisassociateFromConfigurationCommandOutput
* <p>Base exception class for all service exceptions from Chatbot service.</p>
*
* @public
* @example Disassociate a custom action from a configuration
* ```javascript
* //
* const input = {
* "ChatConfiguration": "arn:aws:chatbot::1234567890:chat-configuration/slack-channel/my-channel",
* "Resource": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
* };
* const command = new DisassociateFromConfigurationCommand(input);
* await client.send(command);
* // example id: example-1
* ```
*
*/
export class DisassociateFromConfigurationCommand extends $Command
.classBuilder<
Expand Down
22 changes: 22 additions & 0 deletions clients/client-chatbot/src/commands/GetCustomActionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,28 @@ export interface GetCustomActionCommandOutput extends GetCustomActionResult, __M
* <p>Base exception class for all service exceptions from Chatbot service.</p>
*
* @public
* @example Get a custom action
* ```javascript
* //
* const input = {
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
* };
* const command = new GetCustomActionCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "CustomAction": {
* "ActionName": "my-custom-action",
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action",
* "Definition": {
* "CommandText": "lambda invoke $functionName"
* }
* }
* }
* *\/
* // example id: example-1
* ```
*
*/
export class GetCustomActionCommand extends $Command
.classBuilder<
Expand Down
20 changes: 20 additions & 0 deletions clients/client-chatbot/src/commands/ListAssociationsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,26 @@ export interface ListAssociationsCommandOutput extends ListAssociationsResult, _
* <p>Base exception class for all service exceptions from Chatbot service.</p>
*
* @public
* @example List custom actions associated with a configuration
* ```javascript
* //
* const input = {
* "ChatConfiguration": "arn:aws:chatbot::1234567890:chat-configuration/slack-channel/my-channel"
* };
* const command = new ListAssociationsCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "Associations": [
* {
* "Resource": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
* }
* ]
* }
* *\/
* // example id: example-1
* ```
*
*/
export class ListAssociationsCommand extends $Command
.classBuilder<
Expand Down
16 changes: 16 additions & 0 deletions clients/client-chatbot/src/commands/ListCustomActionsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@ export interface ListCustomActionsCommandOutput extends ListCustomActionsResult,
* <p>Base exception class for all service exceptions from Chatbot service.</p>
*
* @public
* @example List custom actions
* ```javascript
* //
* const input = {};
* const command = new ListCustomActionsCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "CustomActions": [
* "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
* ]
* }
* *\/
* // example id: example-1
* ```
*
*/
export class ListCustomActionsCommand extends $Command
.classBuilder<
Expand Down
19 changes: 19 additions & 0 deletions clients/client-chatbot/src/commands/UpdateCustomActionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,25 @@ export interface UpdateCustomActionCommandOutput extends UpdateCustomActionResul
* <p>Base exception class for all service exceptions from Chatbot service.</p>
*
* @public
* @example Update the command definition of an existing action
* ```javascript
* // Updates the command text of a custom action without altering the existing alias name or attachment criteria
* const input = {
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action",
* "Definition": {
* "CommandText": "lambda invoke MyNewFunction"
* }
* };
* const command = new UpdateCustomActionCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "CustomActionArn": "arn:aws:chatbot::1234567890:custom-action/my-custom-action"
* }
* *\/
* // example id: example-1
* ```
*
*/
export class UpdateCustomActionCommand extends $Command
.classBuilder<
Expand Down

0 comments on commit 21b5399

Please sign in to comment.