Skip to content

list_watchlists

list_watchlists(
    domain_id: DomainId,
    *,
    config_overrides: Optional[VoiceIDClientConfig] = None,
    max_results: Optional[MaxResultsForList] = None,
    next_token: Optional[NextToken] = None,
) -> ListWatchlistsResponse

Lists all watchlists in a specified domain.

Parameters:

  • domain_id (DomainId) –

    The identifier of the domain.

  • max_results (Optional[MaxResultsForList], default: None ) –

    The maximum number of results that are returned per call. You can use NextToken to obtain more pages of results. The default is 100; the maximum allowed page size is also 100.

  • next_token (Optional[NextToken], default: None ) –

    If NextToken is returned, there are more results available. The value of NextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours.

Raises:

Source code in docs_src/capo_voice_id/_services/voice_id.py
def list_watchlists(
    self,
    domain_id: "capo_voice_id.types.domain_id.DomainId",
    *,
    config_overrides: Optional[VoiceIDClientConfig] = None,
    max_results: Optional[
        "capo_voice_id.types.max_results_for_list.MaxResultsForList"
    ] = None,
    next_token: Optional["capo_voice_id.types.next_token.NextToken"] = None,
) -> "capo_voice_id.types.list_watchlists_response.ListWatchlistsResponse":
    """<p>Lists all watchlists in a specified domain.</p>

    Args:
        domain_id: <p>The identifier of the domain.</p>
        max_results: <p>The maximum number of results that are returned per call. You can use <code>NextToken</code> to obtain more pages of results. The default is 100; the maximum allowed page size is also 100. </p>
        next_token: <p>If <code>NextToken</code> is returned, there are more results available. The value of <code>NextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. </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.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.list_watchlists_request.ListWatchlistsRequest]",
    ) -> OperationResponse[
        "capo_voice_id.types.list_watchlists_response.ListWatchlistsResponse"
    ]:
        import capo_voice_id._operations.voice_id.list_watchlists

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

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

        return capo_voice_id.types.list_watchlists_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListWatchlists", redact_output=_redact_output),
    )
    input_: capo_voice_id.types.list_watchlists_request.ListWatchlistsRequest = {
        "domain_id": domain_id
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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