Skip to content

list_speakers async

list_speakers(
    domain_id: DomainId,
    *,
    config_overrides: Optional[AsyncVoiceIDClientConfig] = None,
    max_results: Optional[MaxResultsForList] = None,
    next_token: Optional[NextToken] = None,
) -> ListSpeakersResponse

Lists all speakers 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/async_voice_id.py
async def list_speakers(
    self,
    domain_id: "capo_voice_id.types.domain_id.DomainId",
    *,
    config_overrides: Optional[AsyncVoiceIDClientConfig] = 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_speakers_response.ListSpeakersResponse":
    """<p>Lists all speakers 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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_voice_id.types.list_speakers_request.ListSpeakersRequest]",
    ) -> AsyncOperationResponse[
        "capo_voice_id.types.list_speakers_response.ListSpeakersResponse"
    ]:
        import capo_voice_id._operations.voice_id.list_speakers

        (
            output,
            http_response,
        ) = await capo_voice_id._operations.voice_id.list_speakers.async_list_speakers(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

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

        return capo_voice_id.types.list_speakers_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListSpeakers", redact_output=_redact_output),
    )
    input_: capo_voice_id.types.list_speakers_request.ListSpeakersRequest = {
        "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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output