a
    !fmA                    @   s  d dl mZ d dlZd dlZd dlZd dl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& d dl'm(Z( zeej)ej*j+df Z,W n$ e-y   eej)e.df Z,Y n0 d dl/m0Z0 d dl/m1Z1 d dl2m3Z3 d dl2m4Z4 d dl5m6Z6 d dl7m8Z8 d dl7m9Z9 d dl:Z:ddl;m<Z<m=Z= ddl>m?Z? ddl@mAZA ddlBmCZC G dd deDZEG dd deEdZFejGjHejId Z=d!ZJdS )"    )OrderedDictN)
DictMappingMutableMappingMutableSequenceOptionalSequenceTupleTypeUnioncast)gapic_versionclient_options)
exceptions)gapic_v1)retry)timeout)credentials)mtls)SslCredentials)MutualTLSChannelError)service_account)iam_policy_pb2)
policy_pb2)duration_pb2)field_mask_pb2)pagers)pubsub)TimeoutType   )PublisherTransportDEFAULT_CLIENT_INFO)PublisherGrpcTransport)PublisherGrpcAsyncIOTransport)PublisherRestTransportc                   @   sH   e Zd ZdZe Zeed< eed< eed< d	e	e
 ee dddZdS )
PublisherClientMetazMetaclass for the Publisher client.

    This provides class-level methods for building and retrieving
    support objects (e.g. transport) without polluting the client instance
    objects.
    grpcZ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)    r0   k/var/www/html/python-backend/venv/lib/python3.9/site-packages/google/pubsub_v1/services/publisher/client.pyget_transport_classP   s    
z'PublisherClientMeta.get_transport_class)N)__name__
__module____qualname____doc__r   r+   r#   r$   r%   r   strr
   r!   r2   r0   r0   r0   r1   r&   C   s    r&   c                   @   sz  e Zd ZdZedd ZdZdZdZe	eZ
dZdZeed	d
dZeedddZeZeedddZeeeedddZeeeeef dddZeeeedddZeeeeef dddZeeeedddZeeeeef dd d!Zeeed"d#d$Zeeeeef dd%d&Zeeed'd(d)Zeeeeef dd*d+Z eeed,d-d.Z!eeeeef dd/d0Z"eeed1d2d3Z#eeeeef dd4d5Z$eeeed6d7d8Z%eeeeef dd9d:Z&ed~e'e(j) d<d=d>Z*ed?d@ Z+edAdB Z,edCdD Z-ee'e e'e edEdFdGZ.eee/j0e1dHdIdJZ2dKdL Z3edMdN Z4eeddOdPZ5d;d;d;e6dQe'e/j0 e'e7eef  e'e7e(j)ef  e8j9j:d;dRdSdTZ;dd;e8j<j=e8j<j=dUdVe'e7e>j?ef  e'e e@eAeBeCeef  e>j?dWdXdYZDdd;d;e8j<j=e8j<j=dUdZe'e7e>jEef  e'e>j? e'eFjG e@eAeBeCeef  e>j?d[d\d]ZHdd;d;e8j<j=e8j<j=dUd^e'e7e>jIef  e'e e'eJe>jK  e@eAeBeCeef  e>jLd_d`daZMdd;e8j<j=e8j<j=dUdbe'e7e>jNef  e'e e@eAeBeCeef  e>j?dcdddeZOdd;e8j<j=e8j<j=dUdfe'e7e>jPef  e'e e@eAeBeCeef  eQjRdgdhdiZSdd;e8j<j=e8j<j=dUdbe'e7e>jTef  e'e e@eAeBeCeef  eQjUdcdjdkZVdd;e8j<j=e8j<j=dUdbe'e7e>jWef  e'e e@eAeBeCeef  eQjXdcdldmZYdd;e8j<j=e8j<j=dUdbe'e7e>jZef  e'e e@eAeBeCeef  d;dcdndoZ[de8j<j=e8j<j=dUdpe'e7e>j\ef  e@eAeBeCeef  e>j]dqdrdsZ^d ddtduZ_dvdw Z`de8j<j=e8j<j=dUdpe'eajb e@eAeBeCeef  ecjddqdxdyZede8j<j=e8j<j=dUdpe'eajf e@eAeBeCeef  ecjddqdzd{Zgde8j<j=e8j<j=dUdpe'eajh e@eAeBeCeef  eajidqd|d}Zjd;S )PublisherClientzdThe service that an application uses to manipulate topics,
    and to send messages to a topic.
    c                 C   sT   | s| S t d}|| }| \}}}}|s4|s8| S |rH| 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_endpointZmtls_endpoint_remnamer   ZsandboxZgoogledomainr0   r0   r1   _get_default_mtls_endpointk   s    
z*PublisherClient._get_default_mtls_endpoint)z.https://www.googleapis.com/auth/cloud-platformz&https://www.googleapis.com/auth/pubsubzpubsub.googleapis.com:443zpubsub.googleapis.comzpubsub.{UNIVERSE_DOMAIN}zgoogleapis.com)infoc                 O   s"   t j|}||d< | |i |S )ay  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:
            PublisherClient: The constructed client.
        r   )r   Credentialsfrom_service_account_info)r/   rB   argskwargsr   r0   r0   r1   rD      s    z)PublisherClient.from_service_account_info)filenamec                 O   s"   t j|}||d< | |i |S )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:
            PublisherClient: The constructed client.
        r   )r   rC   from_service_account_file)r/   rG   rE   rF   r   r0   r0   r1   rH      s    z)PublisherClient.from_service_account_file)r*   c                 C   s   | j S )zReturns the transport used by the client instance.

        Returns:
            PublisherTransport: The transport used by the client
                instance.
        )
_transportselfr0   r0   r1   	transport   s    zPublisherClient.transport)projectschemar*   c                 C   s   dj | |dS )z(Returns a fully-qualified schema string.z#projects/{project}/schemas/{schema}rM   rN   formatrO   r0   r0   r1   schema_path   s    zPublisherClient.schema_path)pathr*   c                 C   s   t d| }|r| S i S )z1Parses a schema path into its component segments.z3^projects/(?P<project>.+?)/schemas/(?P<schema>.+?)$r9   r;   	groupdictrS   r?   r0   r0   r1   parse_schema_path   s    z!PublisherClient.parse_schema_path)rM   subscriptionr*   c                 C   s   dj | |dS )z.Returns a fully-qualified subscription string.z/projects/{project}/subscriptions/{subscription}rM   rX   rP   rY   r0   r0   r1   subscription_path   s    z!PublisherClient.subscription_pathc                 C   s   t d| }|r| S i S )z7Parses a subscription path into its component segments.z?^projects/(?P<project>.+?)/subscriptions/(?P<subscription>.+?)$rT   rV   r0   r0   r1   parse_subscription_path   s    z'PublisherClient.parse_subscription_path)rM   topicr*   c                 C   s   dj | |dS )z'Returns a fully-qualified topic string.z!projects/{project}/topics/{topic}rM   r\   rP   r]   r0   r0   r1   
topic_path   s    zPublisherClient.topic_pathc                 C   s   t d| }|r| S i S )z0Parses a topic path into its component segments.z1^projects/(?P<project>.+?)/topics/(?P<topic>.+?)$rT   rV   r0   r0   r1   parse_topic_path   s    z PublisherClient.parse_topic_path)billing_accountr*   c                 C   s   dj | dS )z1Returns a fully-qualified billing_account string.z!billingAccounts/{billing_account}r`   rP   ra   r0   r0   r1   common_billing_account_path  s    z+PublisherClient.common_billing_account_pathc                 C   s   t d| }|r| S i S )z9Parse a billing_account path into its component segments.z*^billingAccounts/(?P<billing_account>.+?)$rT   rV   r0   r0   r1   !parse_common_billing_account_path
  s    z1PublisherClient.parse_common_billing_account_path)folderr*   c                 C   s   dj | dS )z(Returns a fully-qualified folder string.zfolders/{folder}rd   rP   re   r0   r0   r1   common_folder_path  s    z"PublisherClient.common_folder_pathc                 C   s   t d| }|r| S i S )z0Parse a folder path into its component segments.z^folders/(?P<folder>.+?)$rT   rV   r0   r0   r1   parse_common_folder_path  s    z(PublisherClient.parse_common_folder_path)organizationr*   c                 C   s   dj | dS )z.Returns a fully-qualified organization string.zorganizations/{organization}rh   rP   ri   r0   r0   r1   common_organization_path  s    z(PublisherClient.common_organization_pathc                 C   s   t d| }|r| S i S )z6Parse a organization path into its component segments.z%^organizations/(?P<organization>.+?)$rT   rV   r0   r0   r1   parse_common_organization_path(  s    z.PublisherClient.parse_common_organization_path)rM   r*   c                 C   s   dj | dS )z)Returns a fully-qualified project string.zprojects/{project}rM   rP   rl   r0   r0   r1   common_project_path.  s    z#PublisherClient.common_project_pathc                 C   s   t d| }|r| S i S )z1Parse a project path into its component segments.z^projects/(?P<project>.+?)$rT   rV   r0   r0   r1   parse_common_project_path7  s    z)PublisherClient.parse_common_project_path)rM   locationr*   c                 C   s   dj | |dS )z*Returns a fully-qualified location string.z'projects/{project}/locations/{location}rM   ro   rP   rp   r0   r0   r1   common_location_path=  s    z$PublisherClient.common_location_pathc                 C   s   t d| }|r| S i S )z2Parse a location path into its component segments.z7^projects/(?P<project>.+?)/locations/(?P<location>.+?)$rT   rV   r0   r0   r1   parse_common_location_pathH  s    z*PublisherClient.parse_common_location_pathNr   c                 C   s   t dt |du rt }tdd}tdd}|dvrDtd|d	vrTtd
d}|dkr~|j	rn|j	}nt
 r~t
 }|jdur|j}n"|dks|dkr|r| j}n| 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_CLIENT_CERTIFICATEfalseGOOGLE_API_USE_MTLS_ENDPOINTautotruert   YEnvironment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`rv   neveralwaysWEnvironment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`rx   r|   )warningswarnDeprecationWarningclient_options_libClientOptionsosgetenv
ValueErrorr   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>   r0   r0   r1   !get_mtls_endpoint_and_cert_sourceN  s@    #
z1PublisherClient.get_mtls_endpoint_and_cert_sourcec                  C   sX   t dd } t dd }t d}| dvr:td|dvrJtd	| d
k||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"].
        rs   rt   ru   rv   ZGOOGLE_CLOUD_UNIVERSE_DOMAINrw   ry   rz   r}   rx   )r   r   lowerr   r   )r   r   universe_domain_envr0   r0   r1   _read_environment_variables  s    
z+PublisherClient._read_environment_variablesc                 C   s&   d}|r"| r| }n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   )Zprovided_cert_sourceZuse_cert_flagr   r0   r0   r1   _get_client_cert_source  s    z'PublisherClient._get_client_cert_sourcec                 C   sZ   | dur| }nH|dks"|dkrH|rHt j}||kr@td| dt j}n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|   rv   z1mTLS is not supported in any universe other than .)ZUNIVERSE_DOMAIN)r8   _DEFAULT_UNIVERSEr   r   _DEFAULT_ENDPOINT_TEMPLATErQ   )Zapi_overrider   universe_domainr   r>   Z_default_universer0   r0   r1   _get_api_endpoint  s"    
z!PublisherClient._get_api_endpoint)client_universe_domainr   r*   c                 C   s<   t j}| dur| }n|dur |}t| dkr8t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stripr   )r   r   r   r0   r0   r1   _get_universe_domain  s    z$PublisherClient._get_universe_domain)client_universer   r*   c                 C   s:   t j}t|d|}| |kr6td|  d| d| ddS )a  Returns True iff the universe domains used by the client and credentials match.

        Args:
            client_universe (str): The universe domain configured via the client options.
            credentials (ga_credentials.Credentials): The credentials being used in the client.

        Returns:
            bool: True iff client_universe matches the universe in credentials.

        Raises:
            ValueError: when client_universe does not match the universe in credentials.
        r   z The configured universe domain (z?) does not match the universe domain found in the credentials (z>). If you haven't configured the universe domain explicitly, `z` is the default.T)r8   r   getattrr   )r   r   Zdefault_universeZcredentials_universer0   r0   r1   _compare_universes  s    z"PublisherClient._compare_universesc                 C   s    | j pt| j| jj| _ | j 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.
        )_is_universe_domain_validr8   r   r   rL   Z_credentialsrJ   r0   r0   r1   _validate_universe_domain  s    

z)PublisherClient._validate_universe_domainc                 C   s   | j S )zReturn the API endpoint used by the client instance.

        Returns:
            str: The API endpoint used by the client instance.
        )_api_endpointrJ   r0   r0   r1   r>   0  s    zPublisherClient.api_endpointc                 C   s   | j S )zReturn the universe domain used by the client instance.

        Returns:
            str: The universe domain used by the client instance.
        )_universe_domainrJ   r0   r0   r1   r   9  s    zPublisherClient.universe_domain)r   rL   r   client_info)r   rL   r   r   r*   c                C   s  || _ t| j tr t| j | _ | j du r4t | _ ttj| j | _ t| j dd}t	 \| _
| _| _t| j j| j
| _t|| j| _d| _d| _t| j dd}|r|rtdt|t}|r|s| j js|rtd| j jrtdtt|| _| jj| _| jp"t| j j| j| j| j| _|sddl}|rXt|jjd	rX|jj |}t!| "tt#|}	t$j%&d
}
|
rt'|	t!| j(d rt)j*|
d}nt)j+j*|
d}t,j-|	|d}	|	|| j j| j| j j| j| j j.|d| j j/d	| _dS )an
  Instantiates the publisher 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 (Union[str, PublisherTransport]): The
                transport to use. 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   FZ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_credentialsZPUBSUB_EMULATOR_HOSTr'   )target)channelT)	r   credentials_filehostscopesZclient_cert_source_for_mtlsquota_project_idr   Zalways_use_jwt_accessapi_audience)0Z_client_options
isinstancedictr   	from_dictr   r   r   r8   r   Z_use_client_certZ_use_mtls_endpointZ_universe_domain_envr   r   Z_client_cert_sourcer   r   r   r   r   r!   r   r   rI   r   r   r>   Zgoogle.auth._defaulthasattrauth_defaultr   typer2   r7   r   environget
issubclassr+   r'   Zinsecure_channelZaio	functoolspartialr   r   )rK   r   rL   r   r   Zuniverse_domain_optZapi_key_valueZtransport_providedZgoogle	TransportZemulator_hostr   r0   r0   r1   __init__B  s    7




zPublisherClient.__init__r0   )r@   r   r   metadata)requestr@   r   r   r   r*   c          	      C   s   t |g}|dur|rtdt|tjsBt|}|durB||_| jj| jj }t	|t
jd|jfff }|   |||||d}|S )a	  Creates the given topic with the given name. See the [resource
        name rules]
        (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).

        .. 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 import pubsub_v1

            def sample_create_topic():
                # Create a client
                client = pubsub_v1.PublisherClient()

                # Initialize request argument(s)
                request = pubsub_v1.Topic(
                    name="name_value",
                )

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

                # Handle the response
                print(response)

        Args:
            request (Union[google.pubsub_v1.types.Topic, dict]):
                The request object. A topic resource.
            name (str):
                Required. The name of the topic. It must have the format
                ``"projects/{project}/topics/{topic}"``. ``{topic}``
                must start with a letter, and contain only letters
                (``[A-Za-z]``), numbers (``[0-9]``), dashes (``-``),
                underscores (``_``), periods (``.``), tildes (``~``),
                plus (``+``) or percent signs (``%``). It must be
                between 3 and 255 characters in length, and it must not
                start with ``"goog"``.

                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 (TimeoutType):
                The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            google.pubsub_v1.types.Topic:
                A topic resource.
        N\If the `request` argument is set, then none of the individual field arguments should be set.r@   r   r   r   )anyr   r   r   Topicr@   rI   _wrapped_methodscreate_topictupler   routing_headerto_grpc_metadatar   )	rK   r   r@   r   r   r   has_flattened_paramsrpcresponser0   r0   r1   r     s*    E
	
zPublisherClient.create_topic)r\   update_maskr   r   r   )r   r\   r   r   r   r   r*   c          
      C   s   t ||g}|dur |r tdt|tjsRt|}|durD||_|durR||_| jj| jj	 }t
|tjd|jjfff }|   |||||d}	|	S )a
  Updates an existing topic by updating the fields
        specified in the update mask. Note that certain
        properties of a topic are not modifiable.

        .. 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 import pubsub_v1

            def sample_update_topic():
                # Create a client
                client = pubsub_v1.PublisherClient()

                # Initialize request argument(s)
                topic = pubsub_v1.Topic()
                topic.name = "name_value"

                request = pubsub_v1.UpdateTopicRequest(
                    topic=topic,
                )

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

                # Handle the response
                print(response)

        Args:
            request (Union[google.pubsub_v1.types.UpdateTopicRequest, dict]):
                The request object. Request for the UpdateTopic method.
            topic (google.pubsub_v1.types.Topic):
                Required. The updated topic object.
                This corresponds to the ``topic`` field
                on the ``request`` instance; if ``request`` is provided, this
                should not be set.
            update_mask (google.protobuf.field_mask_pb2.FieldMask):
                Required. Indicates which fields in the provided topic
                to update. Must be specified and non-empty. Note that if
                ``update_mask`` contains "message_storage_policy" but
                the ``message_storage_policy`` is not set in the
                ``topic`` provided above, then the updated value is
                determined by the policy configured at the project or
                organization level.

                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 (TimeoutType):
                The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            google.pubsub_v1.types.Topic:
                A topic resource.
        Nr   z
topic.namer   )r   r   r   r   UpdateTopicRequestr\   r   rI   r   update_topicr   r   r   r   r@   r   )
rK   r   r\   r   r   r   r   r   r   r   r0   r0   r1   r   C  s2    M	
zPublisherClient.update_topic)r\   messagesr   r   r   )r   r\   r   r   r   r   r*   c          
      C   s   t ||g}|dur |r tdt|tjsRt|}|durD||_|durR||_| jj| jj	 }t
|tjd|jfff }|   |||||d}	|	S )aD	  Adds one or more messages to the topic. Returns ``NOT_FOUND`` if
        the topic does not exist.

        .. 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 import pubsub_v1

            def sample_publish():
                # Create a client
                client = pubsub_v1.PublisherClient()

                # Initialize request argument(s)
                request = pubsub_v1.PublishRequest(
                    topic="topic_value",
                )

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

                # Handle the response
                print(response)

        Args:
            request (Union[google.pubsub_v1.types.PublishRequest, dict]):
                The request object. Request for the Publish method.
            topic (str):
                Required. The messages in the request will be published
                on this topic. Format is
                ``projects/{project}/topics/{topic}``.

                This corresponds to the ``topic`` field
                on the ``request`` instance; if ``request`` is provided, this
                should not be set.
            messages (MutableSequence[google.pubsub_v1.types.PubsubMessage]):
                Required. The messages to publish.
                This corresponds to the ``messages`` 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 (TimeoutType):
                The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            google.pubsub_v1.types.PublishResponse:
                Response for the Publish method.
        Nr   r\   r   )r   r   r   r   PublishRequestr\   r   rI   r   publishr   r   r   r   r   )
rK   r   r\   r   r   r   r   r   r   r   r0   r0   r1   r     s.    E	
zPublisherClient.publish)r\   r   r   r   )r   r\   r   r   r   r*   c          	      C   s   t |g}|dur|rtdt|tjsBt|}|durB||_| jj| jj }t	|t
jd|jfff }|   |||||d}|S )a  Gets the configuration of a topic.

        .. 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 import pubsub_v1

            def sample_get_topic():
                # Create a client
                client = pubsub_v1.PublisherClient()

                # Initialize request argument(s)
                request = pubsub_v1.GetTopicRequest(
                    topic="topic_value",
                )

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

                # Handle the response
                print(response)

        Args:
            request (Union[google.pubsub_v1.types.GetTopicRequest, dict]):
                The request object. Request for the GetTopic method.
            topic (str):
                Required. The name of the topic to get. Format is
                ``projects/{project}/topics/{topic}``.

                This corresponds to the ``topic`` 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 (TimeoutType):
                The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            google.pubsub_v1.types.Topic:
                A topic resource.
        Nr   r\   r   )r   r   r   r   GetTopicRequestr\   rI   r   	get_topicr   r   r   r   r   	rK   r   r\   r   r   r   r   r   r   r0   r0   r1   r   /  s*    =
	
zPublisherClient.get_topic)rM   r   r   r   )r   rM   r   r   r   r*   c          	      C   s   t |g}|dur|rtdt|tjsBt|}|durB||_| jj| jj }t	|t
jd|jfff }|   |||||d}tj||||d}|S )a  Lists matching topics.

        .. 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 import pubsub_v1

            def sample_list_topics():
                # Create a client
                client = pubsub_v1.PublisherClient()

                # Initialize request argument(s)
                request = pubsub_v1.ListTopicsRequest(
                    project="project_value",
                )

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

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

        Args:
            request (Union[google.pubsub_v1.types.ListTopicsRequest, dict]):
                The request object. Request for the ``ListTopics`` method.
            project (str):
                Required. The name of the project in which to list
                topics. Format is ``projects/{project-id}``.

                This corresponds to the ``project`` 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 (TimeoutType):
                The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            google.pubsub_v1.services.publisher.pagers.ListTopicsPager:
                Response for the ListTopics method.

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

        Nr   rM   r   methodr   r   r   )r   r   r   r   ListTopicsRequestrM   rI   r   list_topicsr   r   r   r   r   r   ListTopicsPager)	rK   r   rM   r   r   r   r   r   r   r0   r0   r1   r     s6    B
	
	zPublisherClient.list_topicsc          	      C   s   t |g}|dur|rtdt|tjsBt|}|durB||_| jj| jj }t	|t
jd|jfff }|   |||||d}tj||||d}|S )a(	  Lists the names of the attached subscriptions on this
        topic.

        .. 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 import pubsub_v1

            def sample_list_topic_subscriptions():
                # Create a client
                client = pubsub_v1.PublisherClient()

                # Initialize request argument(s)
                request = pubsub_v1.ListTopicSubscriptionsRequest(
                    topic="topic_value",
                )

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

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

        Args:
            request (Union[google.pubsub_v1.types.ListTopicSubscriptionsRequest, dict]):
                The request object. Request for the ``ListTopicSubscriptions`` method.
            topic (str):
                Required. The name of the topic that subscriptions are
                attached to. Format is
                ``projects/{project}/topics/{topic}``.

                This corresponds to the ``topic`` 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 (TimeoutType):
                The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            google.pubsub_v1.services.publisher.pagers.ListTopicSubscriptionsPager:
                Response for the ListTopicSubscriptions method.

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

        Nr   r\   r   r   )r   r   r   r   ListTopicSubscriptionsRequestr\   rI   r   list_topic_subscriptionsr   r   r   r   r   r   ListTopicSubscriptionsPagerr   r0   r0   r1   r     s6    D
	
	z(PublisherClient.list_topic_subscriptionsc          	      C   s   t |g}|dur|rtdt|tjsBt|}|durB||_| jj| jj }t	|t
jd|jfff }|   |||||d}tj||||d}|S )a3
  Lists the names of the snapshots on this topic. Snapshots are
        used in
        `Seek <https://cloud.google.com/pubsub/docs/replay-overview>`__
        operations, which allow you to manage message acknowledgments in
        bulk. That is, you can set the acknowledgment state of messages
        in an existing subscription to the state captured by a snapshot.

        .. 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 import pubsub_v1

            def sample_list_topic_snapshots():
                # Create a client
                client = pubsub_v1.PublisherClient()

                # Initialize request argument(s)
                request = pubsub_v1.ListTopicSnapshotsRequest(
                    topic="topic_value",
                )

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

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

        Args:
            request (Union[google.pubsub_v1.types.ListTopicSnapshotsRequest, dict]):
                The request object. Request for the ``ListTopicSnapshots`` method.
            topic (str):
                Required. The name of the topic that snapshots are
                attached to. Format is
                ``projects/{project}/topics/{topic}``.

                This corresponds to the ``topic`` 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 (TimeoutType):
                The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            google.pubsub_v1.services.publisher.pagers.ListTopicSnapshotsPager:
                Response for the ListTopicSnapshots method.

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

        Nr   r\   r   r   )r   r   r   r   ListTopicSnapshotsRequestr\   rI   r   list_topic_snapshotsr   r   r   r   r   r   ListTopicSnapshotsPagerr   r0   r0   r1   r     s6    H
	
	z$PublisherClient.list_topic_snapshotsc                C   s   t |g}|dur|rtdt|tjsBt|}|durB||_| jj| jj }t	|t
jd|jfff }|   |||||d dS )ab  Deletes the topic with the given name. Returns ``NOT_FOUND`` if
        the topic does not exist. After a topic is deleted, a new topic
        may be created with the same name; this is an entirely new topic
        with none of the old configuration or subscriptions. Existing
        subscriptions to this topic are not deleted, but their ``topic``
        field is set to ``_deleted-topic_``.

        .. 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 import pubsub_v1

            def sample_delete_topic():
                # Create a client
                client = pubsub_v1.PublisherClient()

                # Initialize request argument(s)
                request = pubsub_v1.DeleteTopicRequest(
                    topic="topic_value",
                )

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

        Args:
            request (Union[google.pubsub_v1.types.DeleteTopicRequest, dict]):
                The request object. Request for the ``DeleteTopic`` method.
            topic (str):
                Required. Name of the topic to delete. Format is
                ``projects/{project}/topics/{topic}``.

                This corresponds to the ``topic`` 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 (TimeoutType):
                The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.
        Nr   r\   r   )r   r   r   r   DeleteTopicRequestr\   rI   r   delete_topicr   r   r   r   r   )rK   r   r\   r   r   r   r   r   r0   r0   r1   r     s(    ;
	
zPublisherClient.delete_topicr   )r   r   r   r   r*   c                C   s`   t |tjst|}| jj| jj }t|tj	d|j
fff }|   |||||d}|S )a  Detaches a subscription from this topic. All messages retained
        in the subscription are dropped. Subsequent ``Pull`` and
        ``StreamingPull`` requests will return FAILED_PRECONDITION. If
        the subscription is a push subscription, pushes to the endpoint
        will stop.

        .. 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 import pubsub_v1

            def sample_detach_subscription():
                # Create a client
                client = pubsub_v1.PublisherClient()

                # Initialize request argument(s)
                request = pubsub_v1.DetachSubscriptionRequest(
                    subscription="subscription_value",
                )

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

                # Handle the response
                print(response)

        Args:
            request (Union[google.pubsub_v1.types.DetachSubscriptionRequest, dict]):
                The request object. Request for the DetachSubscription
                method.
            retry (google.api_core.retry.Retry): Designation of what errors, if any,
                should be retried.
            timeout (TimeoutType):
                The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            google.pubsub_v1.types.DetachSubscriptionResponse:
                Response for the DetachSubscription
                method. Reserved for future use.

        rX   r   )r   r   DetachSubscriptionRequestrI   r   detach_subscriptionr   r   r   r   rX   r   rK   r   r   r   r   r   r   r0   r0   r1   r   _  s     >

z#PublisherClient.detach_subscriptionc                 C   s   | S )Nr0   rJ   r0   r0   r1   	__enter__  s    zPublisherClient.__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)rL   close)rK   r   value	tracebackr0   r0   r1   __exit__  s    zPublisherClient.__exit__c                C   sj   t |trtjf i |}tjj| jjdt	d}t
|tjd|jfff }|   |||||d}|S )a  Sets the IAM access control policy on the specified function.

        Replaces any existing policy.

        Args:
            request (:class:`~.iam_policy_pb2.SetIamPolicyRequest`):
                The request object. Request message for `SetIamPolicy`
                method.
            retry (google.api_core.retry.Retry): Designation of what errors, if any,
                should be retried.
            timeout (TimeoutType):
                The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.
        Returns:
            ~.policy_pb2.Policy:
                Defines an Identity and Access Management (IAM) policy.
                It is used to specify access control policies for Cloud
                Platform resources.
                A ``Policy`` is a collection of ``bindings``. A
                ``binding`` binds one or more ``members`` to a single
                ``role``. Members can be user accounts, service
                accounts, Google groups, and domains (such as G Suite).
                A ``role`` is a named list of permissions (defined by
                IAM or configured by users). A ``binding`` can
                optionally specify a ``condition``, which is a logic
                expression that further constrains the role binding
                based on attributes about the request and/or target
                resource.

                **JSON Example**

                ::

                    {
                      "bindings": [
                        {
                          "role": "roles/resourcemanager.organizationAdmin",
                          "members": [
                            "user:mike@example.com",
                            "group:admins@example.com",
                            "domain:google.com",
                            "serviceAccount:my-project-id@appspot.gserviceaccount.com"
                          ]
                        },
                        {
                          "role": "roles/resourcemanager.organizationViewer",
                          "members": ["user:eve@example.com"],
                          "condition": {
                            "title": "expirable access",
                            "description": "Does not grant access after Sep 2020",
                            "expression": "request.time <
                            timestamp('2020-10-01T00:00:00.000Z')",
                          }
                        }
                      ]
                    }

                **YAML Example**

                ::

                    bindings:
                    - members:
                      - user:mike@example.com
                      - group:admins@example.com
                      - domain:google.com
                      - serviceAccount:my-project-id@appspot.gserviceaccount.com
                      role: roles/resourcemanager.organizationAdmin
                    - members:
                      - user:eve@example.com
                      role: roles/resourcemanager.organizationViewer
                      condition:
                        title: expirable access
                        description: Does not grant access after Sep 2020
                        expression: request.time < timestamp('2020-10-01T00:00:00.000Z')

                For a description of IAM and its features, see the `IAM
                developer's
                guide <https://cloud.google.com/iam/docs>`__.
        NZdefault_timeoutr   resourcer   )r   r   r   SetIamPolicyRequestr   r   wrap_methodrI   set_iam_policyr"   r   r   r   r   r   r   r0   r0   r1   r     s$    ]
zPublisherClient.set_iam_policyc                C   sj   t |trtjf i |}tjj| jjdt	d}t
|tjd|jfff }|   |||||d}|S )a  Gets the IAM access control policy for a function.

        Returns an empty policy if the function exists and does not have a
        policy set.

        Args:
            request (:class:`~.iam_policy_pb2.GetIamPolicyRequest`):
                The request object. Request message for `GetIamPolicy`
                method.
            retry (google.api_core.retry.Retry): Designation of what errors, if
                any, should be retried.
            timeout (TimeoutType):
                The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.
        Returns:
            ~.policy_pb2.Policy:
                Defines an Identity and Access Management (IAM) policy.
                It is used to specify access control policies for Cloud
                Platform resources.
                A ``Policy`` is a collection of ``bindings``. A
                ``binding`` binds one or more ``members`` to a single
                ``role``. Members can be user accounts, service
                accounts, Google groups, and domains (such as G Suite).
                A ``role`` is a named list of permissions (defined by
                IAM or configured by users). A ``binding`` can
                optionally specify a ``condition``, which is a logic
                expression that further constrains the role binding
                based on attributes about the request and/or target
                resource.

                **JSON Example**

                ::

                    {
                      "bindings": [
                        {
                          "role": "roles/resourcemanager.organizationAdmin",
                          "members": [
                            "user:mike@example.com",
                            "group:admins@example.com",
                            "domain:google.com",
                            "serviceAccount:my-project-id@appspot.gserviceaccount.com"
                          ]
                        },
                        {
                          "role": "roles/resourcemanager.organizationViewer",
                          "members": ["user:eve@example.com"],
                          "condition": {
                            "title": "expirable access",
                            "description": "Does not grant access after Sep 2020",
                            "expression": "request.time <
                            timestamp('2020-10-01T00:00:00.000Z')",
                          }
                        }
                      ]
                    }

                **YAML Example**

                ::

                    bindings:
                    - members:
                      - user:mike@example.com
                      - group:admins@example.com
                      - domain:google.com
                      - serviceAccount:my-project-id@appspot.gserviceaccount.com
                      role: roles/resourcemanager.organizationAdmin
                    - members:
                      - user:eve@example.com
                      role: roles/resourcemanager.organizationViewer
                      condition:
                        title: expirable access
                        description: Does not grant access after Sep 2020
                        expression: request.time < timestamp('2020-10-01T00:00:00.000Z')

                For a description of IAM and its features, see the `IAM
                developer's
                guide <https://cloud.google.com/iam/docs>`__.
        Nr   r   r   )r   r   r   GetIamPolicyRequestr   r   r   rI   get_iam_policyr"   r   r   r   r   r   r   r0   r0   r1   r   C  s$    ^
zPublisherClient.get_iam_policyc                C   sj   t |trtjf i |}tjj| jjdt	d}t
|tjd|jfff }|   |||||d}|S )a~  Tests the specified IAM permissions against the IAM access control
            policy for a function.

        If the function does not exist, this will return an empty set
        of permissions, not a NOT_FOUND error.

        Args:
            request (:class:`~.iam_policy_pb2.TestIamPermissionsRequest`):
                The request object. Request message for
                `TestIamPermissions` method.
            retry (google.api_core.retry.Retry): Designation of what errors,
                 if any, should be retried.
            timeout (TimeoutType):
                The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.
        Returns:
            ~.iam_policy_pb2.TestIamPermissionsResponse:
                Response message for ``TestIamPermissions`` method.
        Nr   r   r   )r   r   r   TestIamPermissionsRequestr   r   r   rI   test_iam_permissionsr"   r   r   r   r   r   r   r0   r0   r1   r     s$     
z$PublisherClient.test_iam_permissions)N)N)N)N)N)N)N)N)N)N)N)N)N)kr3   r4   r5   r6   staticmethodrA   Z_DEFAULT_SCOPESZSERVICE_ADDRESSr   __func__r   r   r   classmethodr   rD   r7   rH   Zfrom_service_account_jsonpropertyr!   rL   rR   r   rW   rZ   r[   r^   r_   rb   rc   rf   rg   rj   rk   rm   rn   rq   rr   r   r   r   r   r   r   r   r   ga_credentialsrC   boolr   r   r>   r   r"   r   r   r   
ClientInfor   r   DEFAULTr   r   OptionalRetryr   r   r	   r   r   r   Z	FieldMaskr   r   r   ZPubsubMessageZPublishResponser   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ZDetachSubscriptionResponser   r   r   r   r   r   Policyr   r   r   r   ZTestIamPermissionsResponser   r0   r0   r0   r1   r8   f   s   
!	



 G


!
  q } s i w y } d [ ~  r8   )	metaclass)Zclient_library_version)r8   )Kcollectionsr   r   r   r9   typingr   r   r   r   r   r   r	   r
   r   r   r~   Zgoogle.pubsub_v1r   Zpackage_versionZgoogle.api_corer   r   r   Zcore_exceptionsr   r   retriesr   ZtimeoutsZgoogle.authr   r   Zgoogle.auth.transportr   Zgoogle.auth.transport.grpcr   Zgoogle.auth.exceptionsr   Zgoogle.oauth2r   Retryr   Z_MethodDefaultr   AttributeErrorobjectZgoogle.iam.v1r   r   Zgoogle.protobufr   r   Z#google.pubsub_v1.services.publisherr   Zgoogle.pubsub_v1.typesr   r   r'   Ztransports.baser!   r"   Ztransports.grpcr#   Ztransports.grpc_asyncior$   Ztransports.restr%   r   r&   r8   r   r   __version____all__r0   r0   r0   r1   <module>   sj   0#               )