google/cloud/texttospeech_v1beta1/services/text_to_speech/client.py
def list_voices(
        self,
        request: cloud_tts.ListVoicesRequest = None,
        *,
        language_code: str = None,
        retry: retries.Retry = gapic_v1.method.DEFAULT,
        timeout: float = None,
        metadata: Sequence[Tuple[str, str]] = (),
    ) -> cloud_tts.ListVoicesResponse:
        r"""Returns a list of Voice supported for synthesis.

        Args:
            request (:class:`~.cloud_tts.ListVoicesRequest`):
                The request object. The top-level message sent by the
                client for the `ListVoices` method.
            language_code (:class:`str`):
                Optional. Recommended.
                `BCP-47 <https://www.rfc-editor.org/rfc/bcp/bcp47.txt>`__
                language tag. If specified, the ListVoices call will
                only return voices that can be used to synthesize this
                language_code. E.g. when specifying "en-NZ", you will
                get supported "en-\*" voices; when specifying "no", you
                will get supported "no-\*" (Norwegian) and "nb-*"
                (Norwegian Bokmal) voices; specifying "zh" will also get
                supported "cmn-*" voices; specifying "zh-hk" will also
                get supported "yue-\*" voices.
                This corresponds to the ``language_code`` field
                on the ``request`` instance; if ``request`` is provided, this
                should not be set.

            retry (google.api_core.retry.Retry): Designation of what errors, if any,
                should be retried.
            timeout (float): The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            ~.cloud_tts.ListVoicesResponse:
                The message returned to the client by the ``ListVoices``
                method.

        """
        # Create or coerce a protobuf request object.
        # Sanity check: If we got a request object, we should *not* have
        # gotten any keyword arguments that map to the request.
        if request is not None and any([language_code]):
            raise ValueError(
                "If the `request` argument is set, then none of "
                "the individual field arguments should be set."
            )

        request = cloud_tts.ListVoicesRequest(request)

        # If we have keyword arguments corresponding to fields on the
        # request, apply these.

        if language_code is not None:
            request.language_code = language_code

        # Wrap the RPC method; this adds retry and timeout information,
        # and friendly error handling.
        rpc = gapic_v1.method.wrap_method(
            self._transport.list_voices, default_timeout=None, client_info=_client_info
        )

        # Send the request.
        response = rpc(request, retry=retry, timeout=timeout, metadata=metadata)

        # Done; return the response.
        return response
r"""Returns a list of Voice supported for synthesis.

        Args:
            request (:class:`~.cloud_tts.ListVoicesRequest`):
                The request object. The top-level message sent by the
                client for the `ListVoices` method.
            language_code (:class:`str`):
                Optional. Recommended.
                `BCP-47 <https://www.rfc-editor.org/rfc/bcp/bcp47.txt>`__
                language tag. If specified, the ListVoices call will
                only return voices that can be used to synthesize this
                language_code. E.g. when specifying "en-NZ", you will
                get supported "en-\*" voices; when specifying "no", you
                will get supported "no-\*" (Norwegian) and "nb-*"
                (Norwegian Bokmal) voices; specifying "zh" will also get
                supported "cmn-*" voices; specifying "zh-hk" will also
                get supported "yue-\*" voices.
                This corresponds to the ``language_code`` field
                on the ``request`` instance; if ``request`` is provided, this
                should not be set.

            retry (google.api_core.retry.Retry): Designation of what errors, if any,
                should be retried.
            timeout (float): The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            ~.cloud_tts.ListVoicesResponse:
                The message returned to the client by the ``ListVoices``
                method.

        
r"""Returns a list of Voice supported for synthesis.
r " " " Returns a list of Voice supported for synthesis .
def list_voices(
        self,
        request: cloud_tts.ListVoicesRequest = None,
        *,
        language_code: str = None,
        retry: retries.Retry = gapic_v1.method.DEFAULT,
        timeout: float = None,
        metadata: Sequence[Tuple[str, str]] = (),
    ) -> cloud_tts.ListVoicesResponse:
        if request is not None and any([language_code]):
            raise ValueError(
                "If the `request` argument is set, then none of "
                "the individual field arguments should be set."
            )
        request = cloud_tts.ListVoicesRequest(request)
        if language_code is not None:
            request.language_code = language_code
        rpc = gapic_v1.method.wrap_method(
            self._transport.list_voices, default_timeout=None, client_info=_client_info
        )
        response = rpc(request, retry=retry, timeout=timeout, metadata=metadata)
        return response
def list_voices ( self , request : cloud_tts . ListVoicesRequest = None , * , language_code : str = None , retry : retries . Retry = gapic_v1 . method . DEFAULT , timeout : float = None , metadata : Sequence [ Tuple [ str , str ] ] = ( ) , ) -> cloud_tts . ListVoicesResponse : if request is not None and any ( [ language_code ] ) : raise ValueError ( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) request = cloud_tts . ListVoicesRequest ( request ) if language_code is not None : request . language_code = language_code rpc = gapic_v1 . method . wrap_method ( self . _transport . list_voices , default_timeout = None , client_info = _client_info ) response = rpc ( request , retry = retry , timeout = timeout , metadata = metadata ) return response
r"""Returns a list of Voice supported for synthesis.
r " " " Returns a list of Voice supported for synthesis .
r"""Returns a list of Voice supported for synthesis.

        Args:
            request (:class:`~.cloud_tts.ListVoicesRequest`):
                The request object. The top-level message sent by the
                client for the `ListVoices` method.
            language_code (:class:`str`):
                Optional. Recommended.
                `BCP-47 <https://www.rfc-editor.org/rfc/bcp/bcp47.txt>`__
                language tag. If specified, the ListVoices call will
                only return voices that can be used to synthesize this
                language_code. E.g. when specifying "en-NZ", you will
                get supported "en-\*" voices; when specifying "no", you
                will get supported "no-\*" (Norwegian) and "nb-*"
                (Norwegian Bokmal) voices; specifying "zh" will also get
                supported "cmn-*" voices; specifying "zh-hk" will also
                get supported "yue-\*" voices.
                This corresponds to the ``language_code`` field
                on the ``request`` instance; if ``request`` is provided, this
                should not be set.

            retry (google.api_core.retry.Retry): Designation of what errors, if any,
                should be retried.
            timeout (float): The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            ~.cloud_tts.ListVoicesResponse:
                The message returned to the client by the ``ListVoices``
                method.

        """ # Create or coerce a protobuf request object. # Sanity check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. # If we have keyword arguments corresponding to fields on the # request, apply these. # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. # Send the request. # Done; return the response.
The message returned to the client by the ``ListVoices``
method.
The message returned to the client by the ` ` ListVoices ` ` method .
~.cloud_tts.ListVoicesResponse
self
request
cloud_tts.ListVoicesRequest
language_code
str
retry
retries.Retry
Designation of what errors, if any,
should be retried.
Designation of what errors if any should be retried .
timeout
float
The timeout for this request.
The timeout for this request .
metadata
Sequence[Tuple[str, str]]
Strings which should be
sent along with the request as metadata.
Strings which should be sent along with the request as metadata .
request (
`~.cloud_tts.ListVoicesRequest`):
The request object. The top-level message sent by the
client for the `ListVoices` method.
` ~ . cloud_tts . ListVoicesRequest ` ) : The request object . The top - level message sent by the client for the ` ListVoices ` method .
language_code (
`str`):
Optional. Recommended.
`BCP-47 `
language tag. If specified, the ListVoices call will
only return voices that can be used to synthesize this
language_code. E.g. when specifying "en-NZ", you will
get supported "en-\*" voices; when specifying "no", you
will get supported "no-\*" (Norwegian) and "nb-*"
(Norwegian Bokmal) voices; specifying "zh" will also get
supported "cmn-*" voices; specifying "zh-hk" will also
get supported "yue-\*" voices.
This corresponds to the ``language_code`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
` str ` ) : Optional . Recommended . ` BCP - 47 ` language tag . If specified the ListVoices call will only return voices that can be used to synthesize this language_code . E . g . when specifying " en - NZ " you will get supported " en - \ * " voices ; when specifying " no " you will get supported " no - \ * " ( Norwegian ) and " nb - * " ( Norwegian Bokmal ) voices ; specifying " zh " will also get supported " cmn - * " voices ; specifying " zh - hk " will also get supported " yue - \ * " voices . This corresponds to the ` ` language_code ` ` field on the ` ` request ` ` instance ; if ` ` request ` ` is provided this should not be set .