
    j                        S SK Jr  S SKJrJrJr  S SKJr  S SKJ	r	  S SK
Jr  S SKJr  S SKJrJr  S SKJr  S S	KJr  S S
KJrJr  S SKJr  S SKJr  S SKJr  S SKJr   S SK!J"r"  S\#4S jr$ " S S\\5      r% " S S\\5      r&g)    )Future)OptionalMappingUnion)uuid4)ClientOptions)Credentials)BatchSettings)make_publishermake_async_publisher)MultiplexedAsyncPublisherClient)MultiplexedPublisherClient)PublisherClientInterfaceAsyncPublisherClientInterface)ConstructableFromServiceAccount)PublisherClientId)RequireStarted)DEFAULT_BATCHING_SETTINGS)	TopicPathenable_idempotencec                 N    U (       a  [        [        5       R                  5      $ S $ N)r   r   bytes)r   s    Glib/third_party/google/cloud/pubsublite/cloudpubsub/publisher_client.py_get_client_idr   0   s    /AUW]]+KtK    c                       \ rS rSr% Sr\\S'   \\S'   \r	 SSSSSS.S	\
\   S
\
\   S\S\
\   S\4
S jjr SS\\\4   S\S\S\\\4   SS4
S jjrS rS rSrg)PublisherClient4   z
A PublisherClient publishes messages similar to Google Pub/Sub.
Any publish failures are unlikely to succeed if retried.

Must be used in a `with` block or have __enter__() called before use.
_impl_require_startedNgrpc_asyncioFper_partition_batching_settingscredentials	transportclient_optionsr   r$   r%   r&   r'   r   c                r   ^^^^^ [        U5      m[        UUUUU4S j5      U l        [        5       U l        g)a0  
Create a new PublisherClient.

Args:
    per_partition_batching_settings: The settings for publish batching. Apply on a per-partition basis.
    credentials: If provided, the credentials to use when connecting.
    transport: The transport to use. Must correspond to an asyncio transport.
    client_options: The client options to use when connecting. If used, must explicitly set `api_endpoint`.
    enable_idempotence: Whether idempotence is enabled, where the server will ensure that unique messages within a single publisher session are stored only once.
c           	          > [        U TTTTTS9$ N)topicr$   r%   r'   r&   	client_id)r   r+   r,   r'   r%   r$   r&   s    r   <lambda>*PublisherClient.__init__.<locals>.<lambda>Y   s    .0O'-##r   N)r   r   r    r   r!   selfr$   r%   r&   r'   r   r,   s    ```` @r   __init__PublisherClient.__init__D   s3    & ##56	/ 	

 !/ 0r   r+   dataordering_keyattrsreturnzFuture[str]c                 t    U R                   R                  5         U R                  R                  " SXUS.UD6$ N)r+   r4   r5    r!   require_startedr    publishr1   r+   r4   r5   r6   s        r   r=   PublisherClient.publishd   s?     	--/zz!! 

AF
 	
r   c                 n    U R                   R                  5         U R                  R                  5         U $ r   )r!   	__enter__r    r1   s    r   rA   PublisherClient.__enter__p   s)    '')

r   c                 t    U R                   R                  XU5        U R                  R                  XU5        g r   )r    __exit__r!   r1   exc_type	exc_value	tracebacks       r   rE   PublisherClient.__exit__u   s,    

H;&&xIFr   r    r!    )__name__
__module____qualname____firstlineno____doc__r   __annotations__r   WIRE_DEFAULT_BATCHINGr   r   r
   r	   strr   boolr2   r   r   r   r   r=   rA   rE   __static_attributes__r:   r   r   r   r   4   s     $#$$ 5 DH-1'26#(1 *2-)@1 k*	1
 1 !/1 !1H 	

Y^$

 

 	


 c"

 



Gr   r   c                       \ rS rSr% Sr\\S'   \\S'   \r	 SSSSSS.S	\
\   S
\
\   S\S\
\   S\4
S jjr SS\\\4   S\S\S\\\4   S\4
S jjrS rS rSrg)AsyncPublisherClientz   z
An AsyncPublisherClient publishes messages similar to Google Pub/Sub, but must be used in an
async context. Any publish failures are unlikely to succeed if retried.

Must be used in an `async with` block or have __aenter__() awaited before use.
r    r!   Nr"   Fr#   r$   r%   r&   r'   r   c                r   ^^^^^ [        U5      m[        UUUUU4S j5      U l        [        5       U l        g)a5  
Create a new AsyncPublisherClient.

Args:
    per_partition_batching_settings: The settings for publish batching. Apply on a per-partition basis.
    credentials: If provided, the credentials to use when connecting.
    transport: The transport to use. Must correspond to an asyncio transport.
    client_options: The client options to use when connecting. If used, must explicitly set `api_endpoint`.
    enable_idempotence: Whether idempotence is enabled, where the server will ensure that unique messages within a single publisher session are stored only once.
c           	          > [        U TTTTTS9$ r*   )r   r-   s    r   r.   /AsyncPublisherClient.__init__.<locals>.<lambda>   s    .0O'-##r   N)r   r   r    r   r!   r0   s    ```` @r   r2   AsyncPublisherClient.__init__   s3    & ##56	4 	

 !/ 0r   r+   r4   r5   r6   r7   c                    #    U R                   R                  5         U R                  R                  " SXUS.UD6I S h  vN $  N7fr9   r;   r>   s        r   r=   AsyncPublisherClient.publish   sL      	--/ZZ'' 

AF
 
 	
 
s   =AA Ac                    #    U R                   R                  5         U R                  R                  5       I S h  vN   U $  N7fr   )r!   rA   r    
__aenter__rB   s    r   rb   AsyncPublisherClient.__aenter__   s7     '')jj##%%% 	&s   8AAAc                    #    U R                   R                  XU5      I S h  vN   U R                  R                  XU5        g  N!7fr   )r    	__aexit__r!   rE   rF   s       r   re   AsyncPublisherClient.__aexit__   s;     jj""8	BBB&&xIF 	Cs    AA"ArK   rL   )rN   rO   rP   rQ   rR   r   rS   r   rT   r   r   r
   r	   rU   r   rV   r2   r   r   r   r   r=   rb   re   rW   r:   r   r   rY   rY   z   s     )($$ 5 DH-1'26#(1 *2-)@1 k*	1
 1 !/1 !1H 	

Y^$

 

 	


 c"

 



Gr   rY   N)'concurrent.futuresr   typingr   r   r   uuidr   google.api_core.client_optionsr   google.auth.credentialsr	   google.cloud.pubsub_v1.typesr
   ;google.cloud.pubsublite.cloudpubsub.internal.make_publisherr   r   Ogoogle.cloud.pubsublite.cloudpubsub.internal.multiplexed_async_publisher_clientr   Igoogle.cloud.pubsublite.cloudpubsub.internal.multiplexed_publisher_clientr   >google.cloud.pubsublite.cloudpubsub.publisher_client_interfacer   r   Cgoogle.cloud.pubsublite.internal.constructable_from_service_accountr   4google.cloud.pubsublite.internal.publisher_client_idr   0google.cloud.pubsublite.internal.require_startedr   4google.cloud.pubsublite.internal.wire.make_publisherr   rT   google.cloud.pubsublite.typesr   rV   r   r   rY   r:   r   r   <module>rv      s    & + +  8 / 6 S K 4Lt LCG.0O CGLEG!#BEGr   