Skip to content

create_data_table_attribute async

create_data_table_attribute(
    instance_id: InstanceId,
    data_table_id: DataTableId,
    name: DataTableName,
    value_type: DataTableAttributeValueType,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    description: Optional[DataTableDescription] = None,
    primary: Optional[Boolean] = None,
    validation: Optional[Validation] = None,
) -> CreateDataTableAttributeResponse

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.

Parameters:

  • instance_id (InstanceId) –

    The unique identifier for the Amazon Connect instance.

  • data_table_id (DataTableId) –

    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 (DataTableName) –

    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.

  • value_type (DataTableAttributeValueType) –

    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 (Optional[DataTableDescription], default: None ) –

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

  • primary (Optional[Boolean], default: None ) –

    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 (Optional[Validation], default: None ) –

    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.

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def create_data_table_attribute(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    data_table_id: "capo_connect.types.data_table_id.DataTableId",
    name: "capo_connect.types.data_table_name.DataTableName",
    value_type: "capo_connect.types.data_table_attribute_value_type.DataTableAttributeValueType",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    description: Optional[
        "capo_connect.types.data_table_description.DataTableDescription"
    ] = None,
    primary: Optional["capo_connect.types.boolean.Boolean"] = None,
    validation: Optional["capo_connect.types.validation.Validation"] = None,
) -> "capo_connect.types.create_data_table_attribute_response.CreateDataTableAttributeResponse":
    """<p>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.</p>

    Args:
        instance_id: <p>The unique identifier for the Amazon Connect instance.</p>
        data_table_id: <p>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.</p>
        name: <p>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.</p>
        value_type: <p>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.</p>
        description: <p>An optional description for the attribute. Must conform to Connect human readable string specification and have 0-250 characters. Whitespace trimmed before persisting.</p>
        primary: <p>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.</p>
        validation: <p>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.</p>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_connect.errors.conflict_exception.ConflictException: <p>Operation cannot be performed at this time as there is a conflict with another operation or contact state.</p>
        capo_connect.errors.duplicate_resource_exception.DuplicateResourceException: <p>A resource with the specified name already exists.</p>
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the specified parameters are not valid.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connect.types.create_data_table_attribute_request.CreateDataTableAttributeRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.create_data_table_attribute_response.CreateDataTableAttributeResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.create_data_table_attribute

        (
            output,
            http_response,
        ) = await capo_connect._operations.amazon_connect_service.create_data_table_attribute.async_create_data_table_attribute(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDataTableAttribute")
    )
    input_: capo_connect.types.create_data_table_attribute_request.CreateDataTableAttributeRequest = {
        "instance_id": instance_id,
        "data_table_id": data_table_id,
        "name": name,
        "value_type": value_type,
    }
    if description is not None:
        input_["description"] = description
    if primary is not None:
        input_["primary"] = primary
    if validation is not None:
        input_["validation"] = validation

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output