Skip to content

update_domain

update_domain(
    domain_id: DomainId,
    name: DomainName,
    server_side_encryption_configuration: ServerSideEncryptionConfiguration,
    *,
    config_overrides: Optional[VoiceIDClientConfig] = None,
    description: Optional[Description] = None,
) -> UpdateDomainResponse

Updates the specified domain. This API has clobber behavior, and clears and replaces all attributes. If an optional field, such as 'Description' is not provided, it is removed from the domain.

Parameters:

  • domain_id (DomainId) –

    The identifier of the domain to be updated.

  • name (DomainName) –

    The name of the domain.

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

    A brief description about this domain.

  • server_side_encryption_configuration (ServerSideEncryptionConfiguration) –

    The configuration, containing the KMS key identifier, to be used by Voice ID for the server-side encryption of your data. Changing the domain's associated KMS key immediately triggers an asynchronous process to remove dependency on the old KMS key, such that the domain's data can only be accessed using the new KMS key. The domain's ServerSideEncryptionUpdateDetails contains the details for this process.

Raises:

Source code in docs_src/capo_voice_id/_services/voice_id.py
def update_domain(
    self,
    domain_id: "capo_voice_id.types.domain_id.DomainId",
    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,
) -> "capo_voice_id.types.update_domain_response.UpdateDomainResponse":
    """<p>Updates the specified domain. This API has clobber behavior, and clears and replaces all attributes. If an optional field, such as 'Description' is not provided, it is removed from the domain.</p>

    Args:
        domain_id: <p>The identifier of the domain to be updated.</p>
        name: <p>The name of the domain.</p>
        description: <p>A brief description about 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. Changing the domain's associated KMS key immediately triggers an asynchronous process to remove dependency on the old KMS key, such that the domain's data can only be accessed using the new KMS key. The domain's <code>ServerSideEncryptionUpdateDetails</code> contains the details for this process.</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.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.update_domain_request.UpdateDomainRequest]",
    ) -> OperationResponse[
        "capo_voice_id.types.update_domain_response.UpdateDomainResponse"
    ]:
        import capo_voice_id._operations.voice_id.update_domain

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

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

        return capo_voice_id.types.update_domain_request.redact_sensitive(input_)

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

        return capo_voice_id.types.update_domain_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateDomain", redact_input=_redact_input, redact_output=_redact_output
        ),
    )
    input_: capo_voice_id.types.update_domain_request.UpdateDomainRequest = {
        "domain_id": domain_id,
        "name": name,
        "server_side_encryption_configuration": server_side_encryption_configuration,
    }
    if description is not None:
        input_["description"] = description

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