Chatbot / Client / create_custom_action

create_custom_action#

Chatbot.Client.create_custom_action(**kwargs)#

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

response = 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'
)
Parameters:
  • Definition (dict) –

    [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 ($).

  • AliasName (string) – The name used to invoke this action in a 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) – [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) –

  • Tags (list) –

    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.

      Warning

      Do not include confidential or sensitive information in this field.

      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.

  • ClientToken (string) –

    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.

  • ActionName (string) –

    [REQUIRED]

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

Return type:

dict

Returns:

Response Syntax

{
    'CustomActionArn': 'string'
}

Response Structure

  • (dict) –

    • CustomActionArn (string) –

      The fully defined ARN of the custom action.

Exceptions

  • Chatbot.Client.exceptions.InvalidRequestException

  • Chatbot.Client.exceptions.LimitExceededException

  • Chatbot.Client.exceptions.ConflictException

  • Chatbot.Client.exceptions.InternalServiceError

  • Chatbot.Client.exceptions.UnauthorizedException