Skip to content

create_data_automation_library async

create_data_automation_library(
    library_name: DataAutomationLibraryName,
    *,
    config_overrides: Optional[AsyncBedrockDataAutomationClientConfig] = None,
    library_description: Optional[DataAutomationLibraryDescription] = None,
    client_token: Optional[ClientToken] = None,
    encryption_configuration: Optional[EncryptionConfiguration] = None,
    tags: Optional[TagList] = None,
) -> CreateDataAutomationLibraryResponse

Creates an Amazon Bedrock Data Automation Library

Raises:

Source code in docs_src/capo_bedrock_data_automation/_services/async_bedrock_data_automation.py
async def create_data_automation_library(
    self,
    library_name: "capo_bedrock_data_automation.types.data_automation_library_name.DataAutomationLibraryName",
    *,
    config_overrides: Optional[AsyncBedrockDataAutomationClientConfig] = None,
    library_description: Optional[
        "capo_bedrock_data_automation.types.data_automation_library_description.DataAutomationLibraryDescription"
    ] = None,
    client_token: Optional[
        "capo_bedrock_data_automation.types.client_token.ClientToken"
    ] = None,
    encryption_configuration: Optional[
        "capo_bedrock_data_automation.types.encryption_configuration.EncryptionConfiguration"
    ] = None,
    tags: Optional["capo_bedrock_data_automation.types.tag_list.TagList"] = None,
) -> "capo_bedrock_data_automation.types.create_data_automation_library_response.CreateDataAutomationLibraryResponse":
    """Creates an Amazon Bedrock Data Automation Library

    Raises:
        capo_bedrock_data_automation.errors.access_denied_exception.AccessDeniedException: This exception is thrown when a request is denied per access permissions
        capo_bedrock_data_automation.errors.conflict_exception.ConflictException: This exception is thrown when there is a conflict performing an operation
        capo_bedrock_data_automation.errors.internal_server_exception.InternalServerException: This exception is thrown if there was an unexpected error during processing of request
        capo_bedrock_data_automation.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: This exception is thrown when a request is made beyond the service quota
        capo_bedrock_data_automation.errors.throttling_exception.ThrottlingException: This exception is thrown when the number of requests exceeds the limit
        capo_bedrock_data_automation.errors.validation_exception.ValidationException: This exception is thrown when the request's input validation fails
        capo_bedrock_data_automation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_bedrock_data_automation.types.create_data_automation_library_request.CreateDataAutomationLibraryRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_data_automation.types.create_data_automation_library_response.CreateDataAutomationLibraryResponse"
    ]:
        import capo_bedrock_data_automation._operations.amazon_bedrock_keystone_build_time_service.create_data_automation_library

        (
            output,
            http_response,
        ) = await capo_bedrock_data_automation._operations.amazon_bedrock_keystone_build_time_service.create_data_automation_library.async_create_data_automation_library(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_bedrock_data_automation.types.create_data_automation_library_request.CreateDataAutomationLibraryRequest",
    ) -> dict[str, Any]:
        import capo_bedrock_data_automation.types.create_data_automation_library_request

        return capo_bedrock_data_automation.types.create_data_automation_library_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateDataAutomationLibrary", redact_input=_redact_input),
    )
    input_: capo_bedrock_data_automation.types.create_data_automation_library_request.CreateDataAutomationLibraryRequest = {
        "library_name": library_name
    }
    if library_description is not None:
        input_["library_description"] = library_description
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if encryption_configuration is not None:
        input_["encryption_configuration"] = encryption_configuration
    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