Connect / Client / create_data_table_attribute

create_data_table_attribute

Connect.Client.create_data_table_attribute(**kwargs)

Adds an attribute to an existing data table. Creating a new primary attribute uses the empty value for the specified value type for all existing records. This should not affect uniqueness of published data tables since the existing primary values will already be unique. Creating attributes does not create any values. System managed tables may not allow customers to create new attributes.

See also: AWS API Documentation

Request Syntax

response = client.create_data_table_attribute(
    InstanceId='string',
    DataTableId='string',
    Name='string',
    ValueType='TEXT'|'NUMBER'|'BOOLEAN'|'TEXT_LIST'|'NUMBER_LIST',
    Description='string',
    Primary=True|False,
    Validation={
        'MinLength': 123,
        'MaxLength': 123,
        'MinValues': 123,
        'MaxValues': 123,
        'IgnoreCase': True|False,
        'Minimum': 123.0,
        'Maximum': 123.0,
        'ExclusiveMinimum': 123.0,
        'ExclusiveMaximum': 123.0,
        'MultipleOf': 123.0,
        'Enum': {
            'Strict': True|False,
            'Values': [
                'string',
            ]
        }
    }
)
Parameters:
  • InstanceId (string) –

    [REQUIRED]

    The unique identifier for the Amazon Connect instance.

  • DataTableId (string) –

    [REQUIRED]

    The unique identifier for the data table. Must also accept the table ARN with or without a version alias. If the version is provided as part of the identifier or ARN, the version must be one of the two available system managed aliases, $SAVED or $LATEST.

  • Name (string) –

    [REQUIRED]

    The name for the attribute. Must conform to Connect human readable string specification and have 1-127 characters. Must not start with the reserved case insensitive values ‘connect:’ and ‘aws:’. Whitespace trimmed before persisting. Must be unique for the data table using case-insensitive comparison.

  • ValueType (string) –

    [REQUIRED]

    The type of value allowed or the resultant type after the value’s expression is evaluated. Must be one of TEXT, TEXT_LIST, NUMBER, NUMBER_LIST, and BOOLEAN.

  • Description (string) – An optional description for the attribute. Must conform to Connect human readable string specification and have 0-250 characters. Whitespace trimmed before persisting.

  • Primary (boolean) – Optional boolean that defaults to false. Determines if the value is used to identify a record in the table. Values for primary attributes must not be expressions.

  • Validation (dict) –

    Optional validation rules for the attribute. Borrows heavily from JSON Schema - Draft 2020-12. The maximum length of arrays within validations and depth of validations is 5. There are default limits that apply to all types. Customer specified limits in excess of the default limits are not permitted.

    • MinLength (integer) –

      The minimum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be less than or equal to MaxLength.

    • MaxLength (integer) –

      The maximum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be greater than or equal to MinLength.

    • MinValues (integer) –

      The minimum number of values in a list. Must be an integer greater than or equal to 0 and less than or equal to MaxValues. Applies to all list types.

    • MaxValues (integer) –

      The maximum number of values in a list. Must be an integer greater than or equal to 0 and greater than or equal to MinValues. Applies to all list types.

    • IgnoreCase (boolean) –

      Boolean that defaults to false. Applies to text lists and text primary attributes. When true, enforces case-insensitive uniqueness for primary attributes and allows case-insensitive lookups.

    • Minimum (float) –

      The smallest inclusive numeric value for NUMBER value type. Cannot be provided when ExclusiveMinimum is also provided. Must be less than or equal to Maximum and less than ExclusiveMaximum. Applies to NUMBER and values within NUMBER_LIST.

    • Maximum (float) –

      The largest inclusive numeric value for NUMBER value type. Can be provided alongside ExclusiveMaximum where both operate independently. Must be greater than or equal to Minimum and greater than ExclusiveMinimum. Applies to NUMBER and values within NUMBER_LIST.

    • ExclusiveMinimum (float) –

      The smallest exclusive numeric value for NUMBER value type. Can be provided alongside Minimum where both operate independently. Must be less than ExclusiveMaximum and Maximum. Applies to NUMBER and values within NUMBER_LIST.

    • ExclusiveMaximum (float) –

      The largest exclusive numeric value for NUMBER value type. Can be provided alongside Maximum where both operate independently. Must be greater than ExclusiveMinimum and Minimum. Applies to NUMBER and values within NUMBER_LIST.

    • MultipleOf (float) –

      Specifies that numeric values must be multiples of this number. Must be greater than 0. The result of dividing a value by this multiple must result in an integer. Applies to NUMBER and values within NUMBER_LIST.

    • Enum (dict) –

      Defines enumeration constraints for attribute values. Can specify a list of allowed values and whether custom values are permitted beyond the enumerated list.

      • Strict (boolean) –

        Boolean that defaults to false. When true, only values specified in the enum list are allowed. When false, custom values beyond the enumerated list are permitted.

      • Values (list) –

        A list of predefined values that are allowed for this attribute. These values are always permitted regardless of the Strict setting.

        • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'Name': 'string',
    'AttributeId': 'string',
    'LockVersion': {
        'DataTable': 'string',
        'Attribute': 'string',
        'PrimaryValues': 'string',
        'Value': 'string'
    }
}

Response Structure

  • (dict) –

    • Name (string) –

      The name of the created attribute since it also serves as the identifier. This could be different than the parameter passed in since it will be trimmed for whitespace.

    • AttributeId (string) –

      The unique identifier assigned to the created attribute.

    • LockVersion (dict) –

      The lock version information for the data table and attribute, used for optimistic locking and versioning.

      • DataTable (string) –

        The lock version for the data table itself. Used for optimistic locking and table versioning. Changes with each update to the table’s metadata or structure.

      • Attribute (string) –

        The lock version for a specific attribute. When the ValueLockLevel is ATTRIBUTE, this version changes when any value for the attribute changes. For other lock levels, it only changes when the attribute’s properties are directly updated.

      • PrimaryValues (string) –

        The lock version for a specific set of primary values (record). This includes the default record even if the table does not have any primary attributes. Used for record-level locking.

      • Value (string) –

        The lock version for a specific value. Changes each time the individual value is modified. Used for the finest-grained locking control.

Exceptions