Skip to content

create_data_table async

create_data_table(
    instance_id: InstanceId,
    name: DataTableName,
    time_zone: TimeZone,
    value_lock_level: DataTableLockLevel,
    status: DataTableStatus,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    description: Optional[DataTableDescription] = None,
    tags: Optional[TagMap] = None,
) -> CreateDataTableResponse

Creates a new data table with the specified properties. Supports the creation of all table properties except for attributes and values. A table with no attributes and values is a valid state for a table. The number of tables per instance is limited to 100 per instance. Customers can request an increase by using Amazon Web Services Service Quotas.

Parameters:

  • instance_id (InstanceId) –

    The unique identifier for the Amazon Connect instance where the data table will be created.

  • name (DataTableName) –

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

  • description (Optional[DataTableDescription], default: None ) –

    An optional description for the data table. Must conform to Connect human readable string specification and have 0-250 characters. Whitespace must be trimmed first.

  • time_zone (TimeZone) –

    The IANA timezone identifier to use when resolving time based dynamic values. Required even if no time slices are specified.

  • value_lock_level (DataTableLockLevel) –

    The data level that concurrent value edits are locked on. One of DATA_TABLE, PRIMARY_VALUE, ATTRIBUTE, VALUE, and NONE. NONE is the default if unspecified. This determines how concurrent edits are handled when multiple users attempt to modify values simultaneously.

  • status (DataTableStatus) –

    The status of the data table. One of PUBLISHED or SAVED. Required parameter that determines the initial state of the table.

  • tags (Optional[TagMap], default: None ) –

    Key value pairs for attribute based access control (TBAC or ABAC). Optional tags to apply to the data table for organization and access control purposes.

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def create_data_table(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    name: "capo_connect.types.data_table_name.DataTableName",
    time_zone: "capo_connect.types.time_zone.TimeZone",
    value_lock_level: "capo_connect.types.data_table_lock_level.DataTableLockLevel",
    status: "capo_connect.types.data_table_status.DataTableStatus",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    description: Optional[
        "capo_connect.types.data_table_description.DataTableDescription"
    ] = None,
    tags: Optional["capo_connect.types.tag_map.TagMap"] = None,
) -> "capo_connect.types.create_data_table_response.CreateDataTableResponse":
    """<p>Creates a new data table with the specified properties. Supports the creation of all table properties except for attributes and values. A table with no attributes and values is a valid state for a table. The number of tables per instance is limited to 100 per instance. Customers can request an increase by using Amazon Web Services Service Quotas.</p>

    Args:
        instance_id: <p>The unique identifier for the Amazon Connect instance where the data table will be created.</p>
        name: <p>The name for the data table. Must conform to Connect human readable string specification and have 1-127 characters. Whitespace must be trimmed first. Must not start with the reserved case insensitive values 'connect:' and 'aws:'. Must be unique for the instance using case-insensitive comparison.</p>
        description: <p>An optional description for the data table. Must conform to Connect human readable string specification and have 0-250 characters. Whitespace must be trimmed first.</p>
        time_zone: <p>The IANA timezone identifier to use when resolving time based dynamic values. Required even if no time slices are specified.</p>
        value_lock_level: <p>The data level that concurrent value edits are locked on. One of DATA_TABLE, PRIMARY_VALUE, ATTRIBUTE, VALUE, and NONE. NONE is the default if unspecified. This determines how concurrent edits are handled when multiple users attempt to modify values simultaneously.</p>
        status: <p>The status of the data table. One of PUBLISHED or SAVED. Required parameter that determines the initial state of the table.</p>
        tags: <p>Key value pairs for attribute based access control (TBAC or ABAC). Optional tags to apply to the data table for organization and access control purposes.</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_request.CreateDataTableRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.create_data_table_response.CreateDataTableResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.create_data_table

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDataTable")
    )
    input_: capo_connect.types.create_data_table_request.CreateDataTableRequest = {
        "instance_id": instance_id,
        "name": name,
        "time_zone": time_zone,
        "value_lock_level": value_lock_level,
        "status": status,
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

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