o
    iHb                    @   s$  d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlm	Z	 d dl
mZmZmZmZmZmZmZmZmZmZmZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ d d	l m!Z" d d
l#m$Z$ d dl%m&Z& d dl'm(Z( d dl)m*Z* d dl+m,Z- zeej.ej/j0df Z1W n e2y   eej.e3df Z1Y nw z
d dlm4Z4 dZ5W n e6y   dZ5Y nw e7e8Z9d dl:m;  m<Z< d dl=m>Z> d dl?m@Z@ d dlAmBZBmCZC ddlDmEZEmFZF ddlGmHZH ddlImJZJ ddlKmLZL G dd deMZNG dd deNdZOejPjQe-jRdZEeSeEdrej;jReE_Td ZUdS )!    N)OrderedDict)
HTTPStatus)CallableDictMappingMutableMappingMutableSequenceOptionalSequenceTupleTypeUnioncast)client_options)
exceptions)gapic_v1)retry)credentials)MutualTLSChannelError)mtls)SslCredentials)service_account)gapic_version)client_loggingTF)operations_pb2)pagers)cloud_speech_adaptationresource   )DEFAULT_CLIENT_INFOAdaptationTransport)AdaptationGrpcTransport)AdaptationGrpcAsyncIOTransport)AdaptationRestTransportc                   @   sL   e Zd ZdZe Zeed< eed< eed< 	d
de	e
 dee fdd	ZdS )AdaptationClientMetazMetaclass for the Adaptation client.

    This provides class-level methods for building and retrieving
    support objects (e.g. transport) without polluting the client instance
    objects.
    grpcgrpc_asynciorestNlabelreturnc                 C   s    |r| j | S tt| j  S )a  Returns an appropriate transport class.

        Args:
            label: The name of the desired transport. If none is
                provided, then the first transport in the registry is used.

        Returns:
            The transport class to use.
        )_transport_registrynextitervalues)clsr(    r/   e/home/ubuntu/.local/lib/python3.10/site-packages/google/cloud/speech_v1/services/adaptation/client.pyget_transport_classY   s   
z(AdaptationClientMeta.get_transport_classN)__name__
__module____qualname____doc__r   r*   r!   r"   r#   r	   strr   r    r1   r/   r/   r/   r0   r$   L   s    r$   c                   @   s  e Zd ZdZedd ZdZeeZdZ	dZ
edd Zed	efd
dZedefddZeZedefddZededededefddZededeeef fddZededededefddZededeeef fddZededefd d!Zededeeef fd"d#Zed$edefd%d&Zededeeef fd'd(Zed)edefd*d+Zededeeef fd,d-Zededefd.d/Z ededeeef fd0d1Z!edededefd2d3Z"ededeeef fd4d5Z#e	6dd7e$e%j& fd8d9Z'ed:d; Z(ed<d= Z)ed>d? Z*ed@e$e dAe$e defdBdCZ+dDdE Z,dFe-j.dd6fdGdHZ/edIdJ Z0edefdKdLZ1d6d6d6e2dMdNe$e3j4 dOe$e5eee6dPef f  d7e$e5e%j&ef  dQe7j8j9dd6f
dRdSZ:	6dd6d6d6e7j;j<e7j;j<dTdUdVe$e5e=j>ef  dWe$e de$e?j@ dXe$e dYeAdZe5eBeCf d[eDeEee5eeFf f  de?j@fd\d]ZG	6dd6e7j;j<e7j;j<dTd^dVe$e5e=jHef  d_e$e dYeAdZe5eBeCf d[eDeEee5eeFf f  de?j@fd`daZI	6dd6e7j;j<e7j;j<dTdbdVe$e5e=jJef  dWe$e dYeAdZe5eBeCf d[eDeEee5eeFf f  deKjLfdcddZM	6dd6d6e7j;j<e7j;j<dTdedVe$e5e=jNef  de$e?j@ dfe$eOjP dYeAdZe5eBeCf d[eDeEee5eeFf f  de?j@fdgdhZQ	6dd6e7j;j<e7j;j<dTd^dVe$e5e=jRef  d_e$e dYeAdZe5eBeCf d[eDeEee5eeFf f  dd6fdidjZS	6dd6d6d6e7j;j<e7j;j<dTdkdVe$e5e=jTef  dWe$e de$e?jU dle$e dYeAdZe5eBeCf d[eDeEee5eeFf f  de?jUfdmdnZV	6dd6e7j;j<e7j;j<dTd^dVe$e5e=jWef  d_e$e dYeAdZe5eBeCf d[eDeEee5eeFf f  de?jUfdodpZX	6dd6e7j;j<e7j;j<dTdbdVe$e5e=jYef  dWe$e dYeAdZe5eBeCf d[eDeEee5eeFf f  deKjZfdqdrZ[	6dd6d6e7j;j<e7j;j<dTdsdVe$e5e=j\ef  de$e?jU dfe$eOjP dYeAdZe5eBeCf d[eDeEee5eeFf f  de?jUfdtduZ]	6dd6e7j;j<e7j;j<dTd^dVe$e5e=j^ef  d_e$e dYeAdZe5eBeCf d[eDeEee5eeFf f  dd6fdvdwZ_ddxdyZ`dzd{ Za	6de7j;j<e7j;j<dTd|dVe$ebjc dYeAdZe5eBeCf d[eDeEee5eeFf f  debjdf
d}d~Ze	6de7j;j<e7j;j<dTd|dVe$ebjf dYeAdZe5eBeCf d[eDeEee5eeFf f  debjgf
ddZhd6S )AdaptationClientz;Service that implements Google Cloud Speech Adaptation API.c                 C   sT   | s| S t d}|| }| \}}}}|s|s| S |r$| ddS | ddS )a\  Converts api endpoint to mTLS endpoint.

        Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to
        "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively.
        Args:
            api_endpoint (Optional[str]): the api endpoint to convert.
        Returns:
            str: converted mTLS api endpoint.
        z[(?P<name>[^.]+)(?P<mtls>\.mtls)?(?P<sandbox>\.sandbox)?(?P<googledomain>\.googleapis\.com)?zsandbox.googleapis.comzmtls.sandbox.googleapis.comz.googleapis.comz.mtls.googleapis.com)recompilematchgroupsreplace)api_endpointmtls_endpoint_remnamer   sandboxgoogledomainr/   r/   r0   _get_default_mtls_endpointr   s   
z+AdaptationClient._get_default_mtls_endpointzspeech.googleapis.comzspeech.{UNIVERSE_DOMAIN}zgoogleapis.comc                  C   s:   t tdr	t S tdd } | dvrtd| dkS )a  Returns whether client certificate should be used for mTLS if the
        google-auth version supports should_use_client_cert automatic mTLS enablement.

        Alternatively, read from the GOOGLE_API_USE_CLIENT_CERTIFICATE env var.

        Returns:
            bool: whether client certificate should be used for mTLS
        Raises:
            ValueError: (If using a version of google-auth without should_use_client_cert and
            GOOGLE_API_USE_CLIENT_CERTIFICATE is set to an unexpected value.)
        should_use_client_cert!GOOGLE_API_USE_CLIENT_CERTIFICATEfalse)truerG   zYEnvironment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`rH   )hasattrr   rE   osgetenvlower
ValueError)use_client_cert_strr/   r/   r0   _use_client_cert_effective   s   
z+AdaptationClient._use_client_cert_effectiveinfoc                 O   "   t j|}||d< | |i |S )az  Creates an instance of this client using the provided credentials
            info.

        Args:
            info (dict): The service account private key info.
            args: Additional arguments to pass to the constructor.
            kwargs: Additional arguments to pass to the constructor.

        Returns:
            AdaptationClient: The constructed client.
        r   )r   Credentialsfrom_service_account_info)r.   rP   argskwargsr   r/   r/   r0   rS      s   z*AdaptationClient.from_service_account_infofilenamec                 O   rQ   )a  Creates an instance of this client using the provided credentials
            file.

        Args:
            filename (str): The path to the service account private key json
                file.
            args: Additional arguments to pass to the constructor.
            kwargs: Additional arguments to pass to the constructor.

        Returns:
            AdaptationClient: The constructed client.
        r   )r   rR   from_service_account_file)r.   rV   rT   rU   r   r/   r/   r0   rW      s   z*AdaptationClient.from_service_account_filer)   c                 C      | j S )zReturns the transport used by the client instance.

        Returns:
            AdaptationTransport: The transport used by the client
                instance.
        )
_transportselfr/   r/   r0   	transport   s   zAdaptationClient.transportprojectlocationcustom_classc                 C      dj | ||dS )z.Returns a fully-qualified custom_class string.zDprojects/{project}/locations/{location}/customClasses/{custom_class}r]   r^   r_   formatra   r/   r/   r0   custom_class_path   
   z"AdaptationClient.custom_class_pathpathc                 C      t d| }|r| S i S )z7Parses a custom_class path into its component segments.z[^projects/(?P<project>.+?)/locations/(?P<location>.+?)/customClasses/(?P<custom_class>.+?)$r9   r;   	groupdictrf   r@   r/   r/   r0   parse_custom_class_path   
   z(AdaptationClient.parse_custom_class_path
phrase_setc                 C   r`   )z,Returns a fully-qualified phrase_set string.z?projects/{project}/locations/{location}/phraseSets/{phrase_set}r]   r^   rm   rb   rn   r/   r/   r0   phrase_set_path   re   z AdaptationClient.phrase_set_pathc                 C   rg   )z5Parses a phrase_set path into its component segments.zV^projects/(?P<project>.+?)/locations/(?P<location>.+?)/phraseSets/(?P<phrase_set>.+?)$rh   rj   r/   r/   r0   parse_phrase_set_path  rl   z&AdaptationClient.parse_phrase_set_pathbilling_accountc                 C      dj | dS )z1Returns a fully-qualified billing_account string.z!billingAccounts/{billing_account}rq   rb   rs   r/   r/   r0   common_billing_account_path     z,AdaptationClient.common_billing_account_pathc                 C   rg   )z9Parse a billing_account path into its component segments.z*^billingAccounts/(?P<billing_account>.+?)$rh   rj   r/   r/   r0   !parse_common_billing_account_path     z2AdaptationClient.parse_common_billing_account_pathfolderc                 C   rr   )z(Returns a fully-qualified folder string.zfolders/{folder}rx   rb   ry   r/   r/   r0   common_folder_path  ru   z#AdaptationClient.common_folder_pathc                 C   rg   )z0Parse a folder path into its component segments.z^folders/(?P<folder>.+?)$rh   rj   r/   r/   r0   parse_common_folder_path(  rw   z)AdaptationClient.parse_common_folder_pathorganizationc                 C   rr   )z.Returns a fully-qualified organization string.zorganizations/{organization}r|   rb   r}   r/   r/   r0   common_organization_path.  ru   z)AdaptationClient.common_organization_pathc                 C   rg   )z6Parse a organization path into its component segments.z%^organizations/(?P<organization>.+?)$rh   rj   r/   r/   r0   parse_common_organization_path7  rw   z/AdaptationClient.parse_common_organization_pathc                 C   rr   )z)Returns a fully-qualified project string.zprojects/{project}r]   rb   r   r/   r/   r0   common_project_path=  ru   z$AdaptationClient.common_project_pathc                 C   rg   )z1Parse a project path into its component segments.z^projects/(?P<project>.+?)$rh   rj   r/   r/   r0   parse_common_project_pathF  rw   z*AdaptationClient.parse_common_project_pathc                 C   s   dj | |dS )z*Returns a fully-qualified location string.z'projects/{project}/locations/{location}r]   r^   rb   r   r/   r/   r0   common_location_pathL  s   z%AdaptationClient.common_location_pathc                 C   rg   )z2Parse a location path into its component segments.z7^projects/(?P<project>.+?)/locations/(?P<location>.+?)$rh   rj   r/   r/   r0   parse_common_location_pathW  rw   z+AdaptationClient.parse_common_location_pathNr   c                 C   s   t dt |du rt }t }tdd}|dvr t	dd}|r3|j
r+|j
}nt r3t }|jdur?|j}||fS |dksI|dkrP|rP| j}||fS | j}||fS )a  Deprecated. Return the API endpoint and client cert source for mutual TLS.

        The client cert source is determined in the following order:
        (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the
        client cert source is None.
        (2) if `client_options.client_cert_source` is provided, use the provided one; if the
        default client cert source exists, use the default one; otherwise the client cert
        source is None.

        The API endpoint is determined in the following order:
        (1) if `client_options.api_endpoint` if provided, use the provided one.
        (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the
        default mTLS endpoint; if the environment variable is "never", use the default API
        endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise
        use the default API endpoint.

        More details can be found at https://google.aip.dev/auth/4114.

        Args:
            client_options (google.api_core.client_options.ClientOptions): Custom options for the
                client. Only the `api_endpoint` and `client_cert_source` properties may be used
                in this method.

        Returns:
            Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the
                client cert source to use.

        Raises:
            google.auth.exceptions.MutualTLSChannelError: If any errors happen.
        zWget_mtls_endpoint_and_cert_source is deprecated. Use the api_endpoint property instead.NGOOGLE_API_USE_MTLS_ENDPOINTautor   neveralwaysWEnvironment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`r   )warningswarnDeprecationWarningclient_options_libClientOptionsr8   rO   rJ   rK   r   client_cert_sourcer   has_default_client_cert_sourcedefault_client_cert_sourcer>   DEFAULT_MTLS_ENDPOINTDEFAULT_ENDPOINT)r.   r   use_client_certuse_mtls_endpointr   r>   r/   r/   r0   !get_mtls_endpoint_and_cert_source]  s6   #
z2AdaptationClient.get_mtls_endpoint_and_cert_sourcec                  C   s<   t  } tdd }td}|dvrtd| ||fS )a  Returns the environment variables used by the client.

        Returns:
            Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
            GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables.

        Raises:
            ValueError: If GOOGLE_API_USE_CLIENT_CERTIFICATE is not
                any of ["true", "false"].
            google.auth.exceptions.MutualTLSChannelError: If GOOGLE_API_USE_MTLS_ENDPOINT
                is not any of ["auto", "never", "always"].
        r   r   GOOGLE_CLOUD_UNIVERSE_DOMAINr   r   )r8   rO   rJ   rK   rL   r   )r   r   universe_domain_envr/   r/   r0   _read_environment_variables  s   

z,AdaptationClient._read_environment_variablesc                 C   s(   d}|r| r
| }|S t  rt  }|S )aZ  Return the client cert source to be used by the client.

        Args:
            provided_cert_source (bytes): The client certificate source provided.
            use_cert_flag (bool): A flag indicating whether to use the client certificate.

        Returns:
            bytes or None: The client cert source to be used by the client.
        N)r   r   r   )provided_cert_sourceuse_cert_flagr   r/   r/   r0   _get_client_cert_source  s   z(AdaptationClient._get_client_cert_sourcec                 C   s^   | dur| }|S |dks|dkr&|r&t j}||kr!td| dt j}|S t jj|d}|S )a  Return the API endpoint used by the client.

        Args:
            api_override (str): The API endpoint override. If specified, this is always
                the return value of this function and the other arguments are not used.
            client_cert_source (bytes): The client certificate source used by the client.
            universe_domain (str): The universe domain used by the client.
            use_mtls_endpoint (str): How to use the mTLS endpoint, which depends also on the other parameters.
                Possible values are "always", "auto", or "never".

        Returns:
            str: The API endpoint to be used by the client.
        Nr   r   z1mTLS is not supported in any universe other than .)UNIVERSE_DOMAIN)r8   _DEFAULT_UNIVERSEr   r   _DEFAULT_ENDPOINT_TEMPLATErc   )api_overrider   universe_domainr   r>   _default_universer/   r/   r0   _get_api_endpoint  s    
z"AdaptationClient._get_api_endpointclient_universe_domainr   c                 C   s<   t j}| dur
| }n|dur|}t| dkrtd|S )a  Return the universe domain used by the client.

        Args:
            client_universe_domain (Optional[str]): The universe domain configured via the client options.
            universe_domain_env (Optional[str]): The universe domain configured via the "GOOGLE_CLOUD_UNIVERSE_DOMAIN" environment variable.

        Returns:
            str: The universe domain to be used by the client.

        Raises:
            ValueError: If the universe domain is an empty string.
        Nr   z*Universe Domain cannot be an empty string.)r8   r   lenstriprM   )r   r   r   r/   r/   r0   _get_universe_domain  s   z%AdaptationClient._get_universe_domainc                 C   s   dS )zValidates client's and credentials' universe domains are consistent.

        Returns:
            bool: True iff the configured universe domain is valid.

        Raises:
            ValueError: If the configured universe domain is not valid.
        Tr/   rZ   r/   r/   r0   _validate_universe_domain  s   z*AdaptationClient._validate_universe_domainerrorc                 C   sf   |j tjtjtjfvrdS | jj}t|dsdS | }|r/t|j	dr1|j	
t| dS dS dS )zAdds credential info string to error details for 401/403/404 errors.

        Args:
            error (google.api_core.exceptions.GoogleAPICallError): The error to add the cred info.
        Nget_cred_infoappend)coder   UNAUTHORIZED	FORBIDDEN	NOT_FOUNDrY   _credentialsrI   r   _detailsr   jsondumps)r[   r   cred	cred_infor/   r/   r0   _add_cred_info_for_auth_errors  s   
z/AdaptationClient._add_cred_info_for_auth_errorsc                 C   rX   )zReturn the API endpoint used by the client instance.

        Returns:
            str: The API endpoint used by the client instance.
        )_api_endpointrZ   r/   r/   r0   r>   .     zAdaptationClient.api_endpointc                 C   rX   )zReturn the universe domain used by the client instance.

        Returns:
            str: The universe domain used by the client instance.
        )_universe_domainrZ   r/   r/   r0   r   7  r   z AdaptationClient.universe_domain)r   r\   r   client_infor   r\   .r   c          
      C   sX  || _ t| j trt| j | _ | j du rt | _ ttj| j | _ t| j dd}t	 \| _
| _| _t| j j| j
| _t|| j| _d| _d| _trQt  t| j dd}|r`|r`tdt|t}|r|so| j jso|rstd| j jr{tdtt|| _| jj| _| jpt| j j| j| j| j| _|sddl}|rt |j!j"d	r|j!j"#|}t|t$s|du rt%|ntt&d
tf |}	|	|| j j| j| j j| j| j j'|d| j j(d	| _dt$| jvr&tr(t)*t+j,r*t)j-dt | jdrdt| jj.ddt/| jj.j0 dt/| jj.j1 t| j2j.ddd  dndddd dS dS dS dS )a  Instantiates the adaptation client.

        Args:
            credentials (Optional[google.auth.credentials.Credentials]): The
                authorization credentials to attach to requests. These
                credentials identify the application to the service; if none
                are specified, the client will attempt to ascertain the
                credentials from the environment.
            transport (Optional[Union[str,AdaptationTransport,Callable[..., AdaptationTransport]]]):
                The transport to use, or a Callable that constructs and returns a new transport.
                If a Callable is given, it will be called with the same set of initialization
                arguments as used in the AdaptationTransport constructor.
                If set to None, a transport is chosen automatically.
            client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
                Custom options for the client.

                1. The ``api_endpoint`` property can be used to override the
                default endpoint provided by the client when ``transport`` is
                not explicitly provided. Only if this property is not set and
                ``transport`` was not explicitly provided, the endpoint is
                determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
                variable, which have one of the following values:
                "always" (always use the default mTLS endpoint), "never" (always
                use the default regular endpoint) and "auto" (auto-switch to the
                default mTLS endpoint if client certificate is present; this is
                the default value).

                2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
                is "true", then the ``client_cert_source`` property can be used
                to provide a client certificate for mTLS transport. If
                not provided, the default SSL client certificate will be used if
                present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
                set, no client certificate will be used.

                3. The ``universe_domain`` property can be used to override the
                default "googleapis.com" universe. Note that the ``api_endpoint``
                property still takes precedence; and ``universe_domain`` is
                currently not supported for mTLS.

            client_info (google.api_core.gapic_v1.client_info.ClientInfo):
                The client info used to send a user-agent string along with
                API requests. If ``None``, then default info will be used.
                Generally, you only need to set this if you're developing
                your own client library.

        Raises:
            google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
                creation failed for any reason.
        Nr   Fapi_keyz=client_options.api_key and credentials are mutually exclusivezFWhen providing a transport instance, provide its credentials directly.zAWhen providing a transport instance, provide its scopes directly.r   get_api_key_credentials.T)	r   credentials_filehostscopesclient_cert_source_for_mtlsquota_project_idr   always_use_jwt_accessapi_audienceasyncz9Created client `google.cloud.speech_v1.AdaptationClient`.r   z!google.cloud.speech.v1.Adaptation r   r   c                   S   s   d S r2   r/   r/   r/   r/   r0   <lambda>  s    z+AdaptationClient.__init__.<locals>.<lambda>)serviceNameuniverseDomaincredentialsTypecredentialsInfo)r   r   )extra)3_client_options
isinstancedictr   	from_dictr   r   getattrr8   r   _use_client_cert_use_mtls_endpoint_universe_domain_envr   r   _client_cert_sourcer   r   r   _is_universe_domain_validCLIENT_LOGGING_SUPPORTEDr   initialize_loggingrM   r    r   r   rY   r   r   r>   google.auth._defaultrI   auth_defaultr   r7   r1   r   r   r   _LOGGERisEnabledForstd_loggingDEBUGdebugr   typer4   r5   r\   )
r[   r   r\   r   r   universe_domain_optapi_key_valuetransport_providedgoogletransport_initr/   r/   r0   __init__@  s   ;









 
zAdaptationClient.__init__r/   )parentrm   phrase_set_idr   timeoutmetadatarequestr   r   r   r   r   c                C      |||g}t dd |D dk}	|dur|	rtdt|tjs:t|}|dur,||_|dur3||_|dur:||_| jj	| jj
 }
t|tjd|jfff }|   |
||||d}|S )a  Create a set of phrase hints. Each item in the set
        can be a single word or a multi-word phrase. The items
        in the PhraseSet are favored by the recognition model
        when you send a call that includes the PhraseSet.

        .. code-block:: python

            # This snippet has been automatically generated and should be regarded as a
            # code template only.
            # It will require modifications to work:
            # - It may require correct/in-range values for request initialization.
            # - It may require specifying regional endpoints when creating the service
            #   client as shown in:
            #   https://googleapis.dev/python/google-api-core/latest/client_options.html
            from google.cloud import speech_v1

            def sample_create_phrase_set():
                # Create a client
                client = speech_v1.AdaptationClient()

                # Initialize request argument(s)
                request = speech_v1.CreatePhraseSetRequest(
                    parent="parent_value",
                    phrase_set_id="phrase_set_id_value",
                )

                # Make the request
                response = client.create_phrase_set(request=request)

                # Handle the response
                print(response)

        Args:
            request (Union[google.cloud.speech_v1.types.CreatePhraseSetRequest, dict]):
                The request object. Message sent by the client for the ``CreatePhraseSet``
                method.
            parent (str):
                Required. The parent resource where this phrase set will
                be created. Format:

                ``projects/{project}/locations/{location}``

                Speech-to-Text supports three locations: ``global``,
                ``us`` (US North America), and ``eu`` (Europe). If you
                are calling the ``speech.googleapis.com`` endpoint, use
                the ``global`` location. To specify a region, use a
                `regional
                endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
                with matching ``us`` or ``eu`` location value.

                This corresponds to the ``parent`` field
                on the ``request`` instance; if ``request`` is provided, this
                should not be set.
            phrase_set (google.cloud.speech_v1.types.PhraseSet):
                Required. The phrase set to create.
                This corresponds to the ``phrase_set`` field
                on the ``request`` instance; if ``request`` is provided, this
                should not be set.
            phrase_set_id (str):
                Required. The ID to use for the
                phrase set, which will become the final
                component of the phrase set's resource
                name.

                This value should restrict to letters,
                numbers, and hyphens, with the first
                character a letter, the last a letter or
                a number, and be 4-63 characters.

                This corresponds to the ``phrase_set_id`` 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, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.

        Returns:
            google.cloud.speech_v1.types.PhraseSet:
                Provides "hints" to the speech
                recognizer to favor specific words and
                phrases in the results.

        c                 S      g | ]}|d ur|qS r2   r/   .0paramr/   r/   r0   
<listcomp>U      z6AdaptationClient.create_phrase_set.<locals>.<listcomp>r   N\If the `request` argument is set, then none of the individual field arguments should be set.r   r   r   r   )r   rM   r   r   CreatePhraseSetRequestr   rm   r   rY   _wrapped_methodscreate_phrase_settupler   routing_headerto_grpc_metadatar   )r[   r   r   rm   r   r   r   r   flattened_paramshas_flattened_paramsrpcresponser/   r/   r0   r     s6   
g
z"AdaptationClient.create_phrase_set)rA   r   r   r   rA   c          
      C      |g}t dd |D dk}|dur|rtdt|tjs*t|}|dur*||_| jj| jj }t	|t
jd|jfff }|   |||||d}	|	S )a
  Get a phrase set.

        .. code-block:: python

            # This snippet has been automatically generated and should be regarded as a
            # code template only.
            # It will require modifications to work:
            # - It may require correct/in-range values for request initialization.
            # - It may require specifying regional endpoints when creating the service
            #   client as shown in:
            #   https://googleapis.dev/python/google-api-core/latest/client_options.html
            from google.cloud import speech_v1

            def sample_get_phrase_set():
                # Create a client
                client = speech_v1.AdaptationClient()

                # Initialize request argument(s)
                request = speech_v1.GetPhraseSetRequest(
                    name="name_value",
                )

                # Make the request
                response = client.get_phrase_set(request=request)

                # Handle the response
                print(response)

        Args:
            request (Union[google.cloud.speech_v1.types.GetPhraseSetRequest, dict]):
                The request object. Message sent by the client for the ``GetPhraseSet``
                method.
            name (str):
                Required. The name of the phrase set to retrieve.
                Format:

                ``projects/{project}/locations/{location}/phraseSets/{phrase_set}``

                Speech-to-Text supports three locations: ``global``,
                ``us`` (US North America), and ``eu`` (Europe). If you
                are calling the ``speech.googleapis.com`` endpoint, use
                the ``global`` location. To specify a region, use a
                `regional
                endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
                with matching ``us`` or ``eu`` location value.

                This corresponds to the ``name`` 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, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.

        Returns:
            google.cloud.speech_v1.types.PhraseSet:
                Provides "hints" to the speech
                recognizer to favor specific words and
                phrases in the results.

        c                 S   r   r2   r/   r   r/   r/   r0   r     r   z3AdaptationClient.get_phrase_set.<locals>.<listcomp>r   Nr   rA   r   )r   rM   r   r   GetPhraseSetRequestrA   rY   r   get_phrase_setr   r   r   r   r   
r[   r   rA   r   r   r   r   r   r   r  r/   r/   r0   r    s.   N
zAdaptationClient.get_phrase_set)r   r   r   r   c          
      C      |g}t dd |D dk}|dur|rtdt|tjs*t|}|dur*||_| jj| jj }t	|t
jd|jfff }|   |||||d}	tj|||	|||d}	|	S )	a  List phrase sets.

        .. code-block:: python

            # This snippet has been automatically generated and should be regarded as a
            # code template only.
            # It will require modifications to work:
            # - It may require correct/in-range values for request initialization.
            # - It may require specifying regional endpoints when creating the service
            #   client as shown in:
            #   https://googleapis.dev/python/google-api-core/latest/client_options.html
            from google.cloud import speech_v1

            def sample_list_phrase_set():
                # Create a client
                client = speech_v1.AdaptationClient()

                # Initialize request argument(s)
                request = speech_v1.ListPhraseSetRequest(
                    parent="parent_value",
                )

                # Make the request
                page_result = client.list_phrase_set(request=request)

                # Handle the response
                for response in page_result:
                    print(response)

        Args:
            request (Union[google.cloud.speech_v1.types.ListPhraseSetRequest, dict]):
                The request object. Message sent by the client for the ``ListPhraseSet``
                method.
            parent (str):
                Required. The parent, which owns this collection of
                phrase set. Format:

                ``projects/{project}/locations/{location}``

                Speech-to-Text supports three locations: ``global``,
                ``us`` (US North America), and ``eu`` (Europe). If you
                are calling the ``speech.googleapis.com`` endpoint, use
                the ``global`` location. To specify a region, use a
                `regional
                endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
                with matching ``us`` or ``eu`` location value.

                This corresponds to the ``parent`` 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, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.

        Returns:
            google.cloud.speech_v1.services.adaptation.pagers.ListPhraseSetPager:
                Message returned to the client by the ListPhraseSet
                method.

                Iterating over this object will yield results and
                resolve additional pages automatically.

        c                 S   r   r2   r/   r   r/   r/   r0   r   N  r   z4AdaptationClient.list_phrase_set.<locals>.<listcomp>r   Nr   r   r   methodr   r  r   r   r   )r   rM   r   r   ListPhraseSetRequestr   rY   r   list_phrase_setr   r   r   r   r   r   ListPhraseSetPager
r[   r   r   r   r   r   r   r   r   r  r/   r/   r0   r
    >   Q
	
z AdaptationClient.list_phrase_set)rm   update_maskr   r   r   r  c                C      ||g}t dd |D dk}|dur|rtdt|tjs2t|}|dur+||_|dur2||_| jj| jj	 }	t
|tjd|jjfff }|   |	||||d}
|
S )a  Update a phrase set.

        .. code-block:: python

            # This snippet has been automatically generated and should be regarded as a
            # code template only.
            # It will require modifications to work:
            # - It may require correct/in-range values for request initialization.
            # - It may require specifying regional endpoints when creating the service
            #   client as shown in:
            #   https://googleapis.dev/python/google-api-core/latest/client_options.html
            from google.cloud import speech_v1

            def sample_update_phrase_set():
                # Create a client
                client = speech_v1.AdaptationClient()

                # Initialize request argument(s)
                request = speech_v1.UpdatePhraseSetRequest(
                )

                # Make the request
                response = client.update_phrase_set(request=request)

                # Handle the response
                print(response)

        Args:
            request (Union[google.cloud.speech_v1.types.UpdatePhraseSetRequest, dict]):
                The request object. Message sent by the client for the ``UpdatePhraseSet``
                method.
            phrase_set (google.cloud.speech_v1.types.PhraseSet):
                Required. The phrase set to update.

                The phrase set's ``name`` field is used to identify the
                set to be updated. Format:

                ``projects/{project}/locations/{location}/phraseSets/{phrase_set}``

                Speech-to-Text supports three locations: ``global``,
                ``us`` (US North America), and ``eu`` (Europe). If you
                are calling the ``speech.googleapis.com`` endpoint, use
                the ``global`` location. To specify a region, use a
                `regional
                endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
                with matching ``us`` or ``eu`` location value.

                This corresponds to the ``phrase_set`` field
                on the ``request`` instance; if ``request`` is provided, this
                should not be set.
            update_mask (google.protobuf.field_mask_pb2.FieldMask):
                The list of fields to be updated.
                This corresponds to the ``update_mask`` 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, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.

        Returns:
            google.cloud.speech_v1.types.PhraseSet:
                Provides "hints" to the speech
                recognizer to favor specific words and
                phrases in the results.

        c                 S   r   r2   r/   r   r/   r/   r0   r     r   z6AdaptationClient.update_phrase_set.<locals>.<listcomp>r   Nr   zphrase_set.namer   )r   rM   r   r   UpdatePhraseSetRequestrm   r  rY   r   update_phrase_setr   r   r   r   rA   r   )r[   r   rm   r  r   r   r   r   r   r   r  r/   r/   r0   r    s6   U
z"AdaptationClient.update_phrase_setc          	      C      |g}t dd |D dk}|dur|rtdt|tjs*t|}|dur*||_| jj| jj }t	|t
jd|jfff }|   |||||d dS )a  Delete a phrase set.

        .. code-block:: python

            # This snippet has been automatically generated and should be regarded as a
            # code template only.
            # It will require modifications to work:
            # - It may require correct/in-range values for request initialization.
            # - It may require specifying regional endpoints when creating the service
            #   client as shown in:
            #   https://googleapis.dev/python/google-api-core/latest/client_options.html
            from google.cloud import speech_v1

            def sample_delete_phrase_set():
                # Create a client
                client = speech_v1.AdaptationClient()

                # Initialize request argument(s)
                request = speech_v1.DeletePhraseSetRequest(
                    name="name_value",
                )

                # Make the request
                client.delete_phrase_set(request=request)

        Args:
            request (Union[google.cloud.speech_v1.types.DeletePhraseSetRequest, dict]):
                The request object. Message sent by the client for the ``DeletePhraseSet``
                method.
            name (str):
                Required. The name of the phrase set to delete. Format:

                ``projects/{project}/locations/{location}/phraseSets/{phrase_set}``

                This corresponds to the ``name`` 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, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.
        c                 S   r   r2   r/   r   r/   r/   r0   r   C  r   z6AdaptationClient.delete_phrase_set.<locals>.<listcomp>r   Nr   rA   r   )r   rM   r   r   DeletePhraseSetRequestrA   rY   r   delete_phrase_setr   r   r   r   r   	r[   r   rA   r   r   r   r   r   r   r/   r/   r0   r    s,   ;

z"AdaptationClient.delete_phrase_set)r   r_   custom_class_idr   r   r   r  c                C   r   )a  Create a custom class.

        .. code-block:: python

            # This snippet has been automatically generated and should be regarded as a
            # code template only.
            # It will require modifications to work:
            # - It may require correct/in-range values for request initialization.
            # - It may require specifying regional endpoints when creating the service
            #   client as shown in:
            #   https://googleapis.dev/python/google-api-core/latest/client_options.html
            from google.cloud import speech_v1

            def sample_create_custom_class():
                # Create a client
                client = speech_v1.AdaptationClient()

                # Initialize request argument(s)
                request = speech_v1.CreateCustomClassRequest(
                    parent="parent_value",
                    custom_class_id="custom_class_id_value",
                )

                # Make the request
                response = client.create_custom_class(request=request)

                # Handle the response
                print(response)

        Args:
            request (Union[google.cloud.speech_v1.types.CreateCustomClassRequest, dict]):
                The request object. Message sent by the client for the ``CreateCustomClass``
                method.
            parent (str):
                Required. The parent resource where this custom class
                will be created. Format:

                ``projects/{project}/locations/{location}/customClasses``

                Speech-to-Text supports three locations: ``global``,
                ``us`` (US North America), and ``eu`` (Europe). If you
                are calling the ``speech.googleapis.com`` endpoint, use
                the ``global`` location. To specify a region, use a
                `regional
                endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
                with matching ``us`` or ``eu`` location value.

                This corresponds to the ``parent`` field
                on the ``request`` instance; if ``request`` is provided, this
                should not be set.
            custom_class (google.cloud.speech_v1.types.CustomClass):
                Required. The custom class to create.
                This corresponds to the ``custom_class`` field
                on the ``request`` instance; if ``request`` is provided, this
                should not be set.
            custom_class_id (str):
                Required. The ID to use for the
                custom class, which will become the
                final component of the custom class'
                resource name.

                This value should restrict to letters,
                numbers, and hyphens, with the first
                character a letter, the last a letter or
                a number, and be 4-63 characters.

                This corresponds to the ``custom_class_id`` 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, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.

        Returns:
            google.cloud.speech_v1.types.CustomClass:
                A set of words or phrases that
                represents a common concept likely to
                appear in your audio, for example a list
                of passenger ship names. CustomClass
                items can be substituted into
                placeholders that you set in PhraseSet
                phrases.

        c                 S   r   r2   r/   r   r/   r/   r0   r     r   z8AdaptationClient.create_custom_class.<locals>.<listcomp>r   Nr   r   r   )r   rM   r   r   CreateCustomClassRequestr   r_   r  rY   r   create_custom_classr   r   r   r   r   )r[   r   r   r_   r  r   r   r   r   r   r   r  r/   r/   r0   r  i  s6   
h
z$AdaptationClient.create_custom_classc          
      C   r  )a
  Get a custom class.

        .. code-block:: python

            # This snippet has been automatically generated and should be regarded as a
            # code template only.
            # It will require modifications to work:
            # - It may require correct/in-range values for request initialization.
            # - It may require specifying regional endpoints when creating the service
            #   client as shown in:
            #   https://googleapis.dev/python/google-api-core/latest/client_options.html
            from google.cloud import speech_v1

            def sample_get_custom_class():
                # Create a client
                client = speech_v1.AdaptationClient()

                # Initialize request argument(s)
                request = speech_v1.GetCustomClassRequest(
                    name="name_value",
                )

                # Make the request
                response = client.get_custom_class(request=request)

                # Handle the response
                print(response)

        Args:
            request (Union[google.cloud.speech_v1.types.GetCustomClassRequest, dict]):
                The request object. Message sent by the client for the ``GetCustomClass``
                method.
            name (str):
                Required. The name of the custom class to retrieve.
                Format:

                ``projects/{project}/locations/{location}/customClasses/{custom_class}``

                This corresponds to the ``name`` 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, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.

        Returns:
            google.cloud.speech_v1.types.CustomClass:
                A set of words or phrases that
                represents a common concept likely to
                appear in your audio, for example a list
                of passenger ship names. CustomClass
                items can be substituted into
                placeholders that you set in PhraseSet
                phrases.

        c                 S   r   r2   r/   r   r/   r/   r0   r   L  r   z5AdaptationClient.get_custom_class.<locals>.<listcomp>r   Nr   rA   r   )r   rM   r   r   GetCustomClassRequestrA   rY   r   get_custom_classr   r   r   r   r   r  r/   r/   r0   r     s.   J
z!AdaptationClient.get_custom_classc          
      C   r  )	a  List custom classes.

        .. code-block:: python

            # This snippet has been automatically generated and should be regarded as a
            # code template only.
            # It will require modifications to work:
            # - It may require correct/in-range values for request initialization.
            # - It may require specifying regional endpoints when creating the service
            #   client as shown in:
            #   https://googleapis.dev/python/google-api-core/latest/client_options.html
            from google.cloud import speech_v1

            def sample_list_custom_classes():
                # Create a client
                client = speech_v1.AdaptationClient()

                # Initialize request argument(s)
                request = speech_v1.ListCustomClassesRequest(
                    parent="parent_value",
                )

                # Make the request
                page_result = client.list_custom_classes(request=request)

                # Handle the response
                for response in page_result:
                    print(response)

        Args:
            request (Union[google.cloud.speech_v1.types.ListCustomClassesRequest, dict]):
                The request object. Message sent by the client for the ``ListCustomClasses``
                method.
            parent (str):
                Required. The parent, which owns this collection of
                custom classes. Format:

                ``projects/{project}/locations/{location}/customClasses``

                Speech-to-Text supports three locations: ``global``,
                ``us`` (US North America), and ``eu`` (Europe). If you
                are calling the ``speech.googleapis.com`` endpoint, use
                the ``global`` location. To specify a region, use a
                `regional
                endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
                with matching ``us`` or ``eu`` location value.

                This corresponds to the ``parent`` 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, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.

        Returns:
            google.cloud.speech_v1.services.adaptation.pagers.ListCustomClassesPager:
                Message returned to the client by the ListCustomClasses
                method.

                Iterating over this object will yield results and
                resolve additional pages automatically.

        c                 S   r   r2   r/   r   r/   r/   r0   r     r   z8AdaptationClient.list_custom_classes.<locals>.<listcomp>r   Nr   r   r   r  )r   rM   r   r   ListCustomClassesRequestr   rY   r   list_custom_classesr   r   r   r   r   r   ListCustomClassesPagerr  r/   r/   r0   r  u  r  z$AdaptationClient.list_custom_classes)r_   r  r   r   r   c                C   r  )ah  Update a custom class.

        .. code-block:: python

            # This snippet has been automatically generated and should be regarded as a
            # code template only.
            # It will require modifications to work:
            # - It may require correct/in-range values for request initialization.
            # - It may require specifying regional endpoints when creating the service
            #   client as shown in:
            #   https://googleapis.dev/python/google-api-core/latest/client_options.html
            from google.cloud import speech_v1

            def sample_update_custom_class():
                # Create a client
                client = speech_v1.AdaptationClient()

                # Initialize request argument(s)
                request = speech_v1.UpdateCustomClassRequest(
                )

                # Make the request
                response = client.update_custom_class(request=request)

                # Handle the response
                print(response)

        Args:
            request (Union[google.cloud.speech_v1.types.UpdateCustomClassRequest, dict]):
                The request object. Message sent by the client for the ``UpdateCustomClass``
                method.
            custom_class (google.cloud.speech_v1.types.CustomClass):
                Required. The custom class to update.

                The custom class's ``name`` field is used to identify
                the custom class to be updated. Format:

                ``projects/{project}/locations/{location}/customClasses/{custom_class}``

                Speech-to-Text supports three locations: ``global``,
                ``us`` (US North America), and ``eu`` (Europe). If you
                are calling the ``speech.googleapis.com`` endpoint, use
                the ``global`` location. To specify a region, use a
                `regional
                endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
                with matching ``us`` or ``eu`` location value.

                This corresponds to the ``custom_class`` field
                on the ``request`` instance; if ``request`` is provided, this
                should not be set.
            update_mask (google.protobuf.field_mask_pb2.FieldMask):
                The list of fields to be updated.
                This corresponds to the ``update_mask`` 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, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.

        Returns:
            google.cloud.speech_v1.types.CustomClass:
                A set of words or phrases that
                represents a common concept likely to
                appear in your audio, for example a list
                of passenger ship names. CustomClass
                items can be substituted into
                placeholders that you set in PhraseSet
                phrases.

        c                 S   r   r2   r/   r   r/   r/   r0   r   W  r   z8AdaptationClient.update_custom_class.<locals>.<listcomp>r   Nr   zcustom_class.namer   )r   rM   r   r   UpdateCustomClassRequestr_   r  rY   r   update_custom_classr   r   r   r   rA   r   )r[   r   r_   r  r   r   r   r   r   r   r  r/   r/   r0   r    s6   Y
z$AdaptationClient.update_custom_classc          	      C   r  )a	  Delete a custom class.

        .. code-block:: python

            # This snippet has been automatically generated and should be regarded as a
            # code template only.
            # It will require modifications to work:
            # - It may require correct/in-range values for request initialization.
            # - It may require specifying regional endpoints when creating the service
            #   client as shown in:
            #   https://googleapis.dev/python/google-api-core/latest/client_options.html
            from google.cloud import speech_v1

            def sample_delete_custom_class():
                # Create a client
                client = speech_v1.AdaptationClient()

                # Initialize request argument(s)
                request = speech_v1.DeleteCustomClassRequest(
                    name="name_value",
                )

                # Make the request
                client.delete_custom_class(request=request)

        Args:
            request (Union[google.cloud.speech_v1.types.DeleteCustomClassRequest, dict]):
                The request object. Message sent by the client for the ``DeleteCustomClass``
                method.
            name (str):
                Required. The name of the custom class to delete.
                Format:

                ``projects/{project}/locations/{location}/customClasses/{custom_class}``

                Speech-to-Text supports three locations: ``global``,
                ``us`` (US North America), and ``eu`` (Europe). If you
                are calling the ``speech.googleapis.com`` endpoint, use
                the ``global`` location. To specify a region, use a
                `regional
                endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
                with matching ``us`` or ``eu`` location value.

                This corresponds to the ``name`` 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, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.
        c                 S   r   r2   r/   r   r/   r/   r0   r     r   z8AdaptationClient.delete_custom_class.<locals>.<listcomp>r   Nr   rA   r   )r   rM   r   r   DeleteCustomClassRequestrA   rY   r   delete_custom_classr   r   r   r   r   r  r/   r/   r0   r!    s,   D

z$AdaptationClient.delete_custom_classc                 C   s   | S r2   r/   rZ   r/   r/   r0   	__enter__  s   zAdaptationClient.__enter__c                 C   s   | j   dS )a  Releases underlying transport's resources.

        .. warning::
            ONLY use as a context manager if the transport is NOT shared
            with other clients! Exiting the with block will CLOSE the transport
            and may cause errors in other clients!
        N)r\   close)r[   r   value	tracebackr/   r/   r0   __exit__  s   zAdaptationClient.__exit__r   c             
   C      t |trtjdi |}| jj| jj }t|tj	
d|jfff }|   z|||||d}|W S  tjyG } z| | |d}~ww )a  Lists operations that match the specified filter in the request.

        Args:
            request (:class:`~.operations_pb2.ListOperationsRequest`):
                The request object. Request message for
                `ListOperations` method.
            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, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.
        Returns:
            ~.operations_pb2.ListOperationsResponse:
                Response message for ``ListOperations`` method.
        rA   r   Nr/   )r   r   r   ListOperationsRequestrY   r   list_operationsr   r   r   r   rA   r   core_exceptionsGoogleAPICallErrorr   r[   r   r   r   r   r   r  er/   r/   r0   r)    (   

z AdaptationClient.list_operationsc             
   C   r'  )aS  Gets the latest state of a long-running operation.

        Args:
            request (:class:`~.operations_pb2.GetOperationRequest`):
                The request object. Request message for
                `GetOperation` method.
            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, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.
        Returns:
            ~.operations_pb2.Operation:
                An ``Operation`` object.
        rA   r   Nr/   )r   r   r   GetOperationRequestrY   r   get_operationr   r   r   r   rA   r   r*  r+  r   r,  r/   r/   r0   r0  8  r.  zAdaptationClient.get_operationr2   )r)   r8   )ir3   r4   r5   r6   staticmethodrD   r   __func__r   r   r   rO   classmethodr   rS   r7   rW   from_service_account_jsonpropertyr    r\   rd   r   rk   ro   rp   rt   rv   rz   r{   r~   r   r   r   r   r   r	   r   r   r   r   r   r   r   r   r*  r+  r   r>   r   r   ga_credentialsrR   r   r   r   r   
ClientInfor   r  DEFAULTr   r   r   	PhraseSetOptionalRetryfloatobjectr
   r   bytesr   r  r  r	  r   r  r
  r  field_mask_pb2	FieldMaskr  r  r  r  CustomClassr  r  r  r  r  r  r  r  r   r!  r"  r&  r   r(  ListOperationsResponser)  r/  	Operationr0  r/   r/   r/   r0   r8   o   s    

	
C


!

	
 1	


 
	

}
	

 
	

 	
	

g	


 
	

y
	

 
	

 
	


l

=
r8   )	metaclassprotobuf_runtime_version)r8   )Vr   loggingr   rJ   r9   r   collectionsr   httpr   typingr   r   r   r   r   r	   r
   r   r   r   r   google.protobufr   google.api_corer   r   r   r*  r   r   retriesgoogle.authr   r6  google.auth.exceptionsr   google.auth.transportr   google.auth.transport.grpcr   google.oauth2r   google.cloud.speech_v1r   package_versionRetryr  _MethodDefaultr:  AttributeErrorr<  r   r   ImportError	getLoggerr3   r   google.protobuf.field_mask_pb2protobufr>  google.longrunningr   *google.cloud.speech_v1.services.adaptationr   google.cloud.speech_v1.typesr   r   transports.baser   r    transports.grpcr!   transports.grpc_asyncior"   transports.restr#   r   r$   r8   r   r7  __version__rI   rD  __all__r/   r/   r/   r0   <module>   s~   4
#                
