Skip to content

create_watchlist

create_watchlist(
    domain_id: DomainId,
    name: WatchlistName,
    *,
    config_overrides: Optional[VoiceIDClientConfig] = None,
    description: Optional[WatchlistDescription] = None,
    client_token: Optional[ClientTokenString] = None,
) -> CreateWatchlistResponse

Creates a watchlist that fraudsters can be a part of.

Parameters:

Raises:

Source code in docs_src/capo_voice_id/_services/voice_id.py
def create_watchlist(
    self,
    domain_id: "capo_voice_id.types.domain_id.DomainId",
    name: "capo_voice_id.types.watchlist_name.WatchlistName",
    *,
    config_overrides: Optional[VoiceIDClientConfig] = None,
    description: Optional[
        "capo_voice_id.types.watchlist_description.WatchlistDescription"
    ] = None,
    client_token: Optional[
        "capo_voice_id.types.client_token_string.ClientTokenString"
    ] = None,
) -> "capo_voice_id.types.create_watchlist_response.CreateWatchlistResponse":
    """<p>Creates a watchlist that fraudsters can be a part of.</p>

    Args:
        domain_id: <p>The identifier of the domain that contains the watchlist.</p>
        name: <p>The name of the watchlist.</p>
        description: <p>A brief description of this watchlist.</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>

    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_watchlist_request.CreateWatchlistRequest]",
    ) -> OperationResponse[
        "capo_voice_id.types.create_watchlist_response.CreateWatchlistResponse"
    ]:
        import capo_voice_id._operations.voice_id.create_watchlist

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

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

        return capo_voice_id.types.create_watchlist_request.redact_sensitive(input_)

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

        return capo_voice_id.types.create_watchlist_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateWatchlist",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_voice_id.types.create_watchlist_request.CreateWatchlistRequest = {
        "domain_id": domain_id,
        "name": name,
    }
    if description is not None:
        input_["description"] = description
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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