AWS Chatbot

2024/11/22 - AWS Chatbot - 8 new api methods

Changes  Adds support for programmatic management of custom actions and aliases which can be associated with channel configurations.

ListCustomActions (new) Link ¶

Lists custom actions defined in this account.

See also: AWS API Documentation

Request Syntax

client.list_custom_actions(
    MaxResults=123,
    NextToken='string'
)
type MaxResults:

integer

param MaxResults:

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.

type NextToken:

string

param NextToken:

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.

rtype:

dict

returns:

Response Syntax

{
    'CustomActions': [
        'string',
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • CustomActions (list) --

      A list of custom actions.

      • (string) --

    • NextToken (string) --

      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.

UpdateCustomAction (new) Link ¶

Updates a custom action.

See also: AWS API Documentation

Request Syntax

client.update_custom_action(
    CustomActionArn='string',
    Definition={
        'CommandText': 'string'
    },
    AliasName='string',
    Attachments=[
        {
            'NotificationType': 'string',
            'ButtonText': 'string',
            'Criteria': [
                {
                    'Operator': 'HAS_VALUE'|'EQUALS',
                    'VariableName': 'string',
                    'Value': 'string'
                },
            ],
            'Variables': {
                'string': 'string'
            }
        },
    ]
)
type CustomActionArn:

string

param CustomActionArn:

[REQUIRED]

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

type Definition:

dict

param Definition:

[REQUIRED]

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

  • CommandText (string) -- [REQUIRED]

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

type AliasName:

string

param AliasName:

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

type Attachments:

list

param Attachments:

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

  • (dict) --

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

    • NotificationType (string) --

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

    • ButtonText (string) --

      The text of the button that appears on the notification.

    • Criteria (list) --

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

      • (dict) --

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

        • Operator (string) -- [REQUIRED]

          The operation to perform on the named variable.

        • VariableName (string) -- [REQUIRED]

          The name of the variable to operate on.

        • Value (string) --

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

    • Variables (dict) --

      The variables to extract from the notification.

      • (string) --

        • (string) --

rtype:

dict

returns:

Response Syntax

{
    'CustomActionArn': 'string'
}

Response Structure

  • (dict) --

    • CustomActionArn (string) --

      The fully defined ARN of the custom action.

GetCustomAction (new) Link ¶

Returns a custom action.

See also: AWS API Documentation

Request Syntax

client.get_custom_action(
    CustomActionArn='string'
)
type CustomActionArn:

string

param CustomActionArn:

[REQUIRED]

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

rtype:

dict

returns:

Response Syntax

{
    'CustomAction': {
        'CustomActionArn': 'string',
        'Definition': {
            'CommandText': 'string'
        },
        'AliasName': 'string',
        'Attachments': [
            {
                'NotificationType': 'string',
                'ButtonText': 'string',
                'Criteria': [
                    {
                        'Operator': 'HAS_VALUE'|'EQUALS',
                        'VariableName': 'string',
                        'Value': 'string'
                    },
                ],
                'Variables': {
                    'string': 'string'
                }
            },
        ],
        'ActionName': 'string'
    }
}

Response Structure

  • (dict) --

    • CustomAction (dict) --

      Returns the custom action.

      • CustomActionArn (string) --

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

      • Definition (dict) --

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

        • CommandText (string) --

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

      • AliasName (string) --

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

      • Attachments (list) --

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

        • (dict) --

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

          • NotificationType (string) --

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

          • ButtonText (string) --

            The text of the button that appears on the notification.

          • Criteria (list) --

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

            • (dict) --

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

              • Operator (string) --

                The operation to perform on the named variable.

              • VariableName (string) --

                The name of the variable to operate on.

              • Value (string) --

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

          • Variables (dict) --

            The variables to extract from the notification.

            • (string) --

              • (string) --

      • ActionName (string) --

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

DeleteCustomAction (new) Link ¶

Deletes a custom action.

See also: AWS API Documentation

Request Syntax

client.delete_custom_action(
    CustomActionArn='string'
)
type CustomActionArn:

string

param CustomActionArn:

[REQUIRED]

The fully defined ARN of the custom action.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

DisassociateFromConfiguration (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

client.disassociate_from_configuration(
    Resource='string',
    ChatConfiguration='string'
)
type Resource:

string

param Resource:

[REQUIRED]

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

type ChatConfiguration:

string

param ChatConfiguration:

[REQUIRED]

The channel configuration the resource is being disassociated from.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

CreateCustomAction (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

client.create_custom_action(
    Definition={
        'CommandText': 'string'
    },
    AliasName='string',
    Attachments=[
        {
            'NotificationType': 'string',
            'ButtonText': 'string',
            'Criteria': [
                {
                    'Operator': 'HAS_VALUE'|'EQUALS',
                    'VariableName': 'string',
                    'Value': 'string'
                },
            ],
            'Variables': {
                'string': 'string'
            }
        },
    ],
    Tags=[
        {
            'TagKey': 'string',
            'TagValue': 'string'
        },
    ],
    ClientToken='string',
    ActionName='string'
)
type Definition:

dict

param Definition:

[REQUIRED]

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

  • CommandText (string) -- [REQUIRED]

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

type AliasName:

string

param AliasName:

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

type Attachments:

list

param Attachments:

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

  • (dict) --

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

    • NotificationType (string) --

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

    • ButtonText (string) --

      The text of the button that appears on the notification.

    • Criteria (list) --

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

      • (dict) --

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

        • Operator (string) -- [REQUIRED]

          The operation to perform on the named variable.

        • VariableName (string) -- [REQUIRED]

          The name of the variable to operate on.

        • Value (string) --

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

    • Variables (dict) --

      The variables to extract from the notification.

      • (string) --

        • (string) --

type Tags:

list

param Tags:

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

  • (dict) --

    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.

    For more information, see User-Defined Tag Restrictions in the AWS Billing and Cost Management User Guide.

    • TagKey (string) -- [REQUIRED]

      The key of the tag.

    • TagValue (string) -- [REQUIRED]

      The value of the tag.

type ClientToken:

string

param ClientToken:

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.

This field is autopopulated if not provided.

type ActionName:

string

param ActionName:

[REQUIRED]

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

rtype:

dict

returns:

Response Syntax

{
    'CustomActionArn': 'string'
}

Response Structure

  • (dict) --

    • CustomActionArn (string) --

      The fully defined ARN of the custom action.

AssociateToConfiguration (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

client.associate_to_configuration(
    Resource='string',
    ChatConfiguration='string'
)
type Resource:

string

param Resource:

[REQUIRED]

The resource Amazon Resource Name (ARN) to link.

type ChatConfiguration:

string

param ChatConfiguration:

[REQUIRED]

The channel configuration to associate with the resource.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

ListAssociations (new) Link ¶

Lists resources associated with a channel configuration.

See also: AWS API Documentation

Request Syntax

client.list_associations(
    ChatConfiguration='string',
    MaxResults=123,
    NextToken='string'
)
type ChatConfiguration:

string

param ChatConfiguration:

[REQUIRED]

The channel configuration to list associations for.

type MaxResults:

integer

param MaxResults:

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.

type NextToken:

string

param NextToken:

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.

rtype:

dict

returns:

Response Syntax

{
    'Associations': [
        {
            'Resource': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Associations (list) --

      The resources associated with this channel configuration.

      • (dict) --

        A listing of an association with a channel configuration.

        • Resource (string) --

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

    • NextToken (string) --

      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.