Skip to content

create_domain

create_domain(
    name: DomainName,
    server_side_encryption_configuration: ServerSideEncryptionConfiguration,
    *,
    config_overrides: Optional[VoiceIDClientConfig] = None,
    description: Optional[Description] = None,
    client_token: Optional[ClientTokenString] = None,
    tags: Optional[TagList] = None,
) -> CreateDomainResponse

Creates a domain that contains all Amazon Connect Voice ID data, such as speakers, fraudsters, customer audio, and voiceprints. Every domain is created with a default watchlist that fraudsters can be a part of.

Parameters:

Raises:

Source code in docs_src/capo_voice_id/_services/voice_id.py
def create_domain(
    self,
    name: "capo_voice_id.types.domain_name.DomainName",
    server_side_encryption_configuration: "capo_voice_id.types.server_side_encryption_configuration.ServerSideEncryptionConfiguration",
    *,
    config_overrides: Optional[VoiceIDClientConfig] = None,
    description: Optional["capo_voice_id.types.description.Description"] = None,
    client_token: Optional[
        "capo_voice_id.types.client_token_string.ClientTokenString"
    ] = None,
    tags: Optional["capo_voice_id.types.tag_list.TagList"] = None,
) -> "capo_voice_id.types.create_domain_response.CreateDomainResponse":
    """<p>Creates a domain that contains all Amazon Connect Voice ID data, such as speakers, fraudsters, customer audio, and voiceprints. Every domain is created with a default watchlist that fraudsters can be a part of.</p>

    Args:
        name: <p>The name of the domain.</p>
        description: <p>A brief description of this domain.</p>
        server_side_encryption_configuration: <p>The configuration, containing the KMS key identifier, to be used by Voice ID for the server-side encryption of your data. Refer to <a href="https://docs.aws.amazon.com/connect/latest/adminguide/encryption-at-rest.html#encryption-at-rest-voiceid"> Amazon Connect Voice ID encryption at rest</a> for more details on how the KMS key is used. </p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
        tags: <p>A list of tags you want added to the domain.</p>

    Raises:
        capo_voice_id.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action. Check the error message and try again.</p>
        capo_voice_id.errors.conflict_exception.ConflictException: <p>The request failed due to a conflict. Check the <code>ConflictType</code> and error message for more details.</p>
        capo_voice_id.errors.internal_server_exception.InternalServerException: <p>The request failed due to an unknown error on the server side.</p>
        capo_voice_id.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource cannot be found. Check the <code>ResourceType</code> and error message for more details.</p>
        capo_voice_id.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeded the service quota. Refer to <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#voiceid-quotas">Voice ID Service Quotas</a> and try your request again.</p>
        capo_voice_id.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Please slow down your request rate. Refer to <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html##voiceid-api-quotas"> Amazon Connect Voice ID Service API throttling quotas </a> and try your request again.</p>
        capo_voice_id.errors.validation_exception.ValidationException: <p>The request failed one or more validations; check the error message for more details.</p>
        capo_voice_id.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_voice_id.types.create_domain_request.CreateDomainRequest]",
    ) -> OperationResponse[
        "capo_voice_id.types.create_domain_response.CreateDomainResponse"
    ]:
        import capo_voice_id._operations.voice_id.create_domain

        output, http_response = (
            capo_voice_id._operations.voice_id.create_domain.create_domain(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_voice_id.types.create_domain_request.CreateDomainRequest",
    ) -> dict[str, Any]:
        import capo_voice_id.types.create_domain_request

        return capo_voice_id.types.create_domain_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_voice_id.types.create_domain_response.CreateDomainResponse",
    ) -> dict[str, Any]:
        import capo_voice_id.types.create_domain_response

        return capo_voice_id.types.create_domain_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateDomain", redact_input=_redact_input, redact_output=_redact_output
        ),
    )
    input_: capo_voice_id.types.create_domain_request.CreateDomainRequest = {
        "name": name,
        "server_side_encryption_configuration": server_side_encryption_configuration,
    }
    if description is not None:
        input_["description"] = description
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output