
                         \   d dl mZ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mZ d dlmZ d d	lmZmZ d d
lmZ d dlmZ d dlmZ eZ	 	 	 	 	 ddededee   dee   dee   deeeef      dee   defdZ	 	 	 	 	 ddededee   dee   dee   deeeef      dee   defdZy)    )OptionalMapping)ClientOptions)Credentials)BatchSettings)AsyncSinglePublisherImpl)SinglePublisherImpl)AsyncSinglePublisherSinglePublisher)PublisherClientId)make_publisherDEFAULT_BATCHING_SETTINGS)merge_metadata)pubsub_context)	TopicPathNtopic	transportper_partition_batching_settingscredentialsclient_optionsmetadata	client_idreturnc                 h     t        t        d             fd}t        |      S )a  
    Make a new publisher for the given topic.

    Args:
      topic: The topic to publish to.
      transport: The transport type to use.
      per_partition_batching_settings: Settings for batching messages on each partition. The default is reasonable for most cases.
      credentials: The credentials to use to connect. GOOGLE_DEFAULT_CREDENTIALS is used if None.
      client_options: Other options to pass to the client. Note that if you pass any you must set api_endpoint.
      metadata: Additional metadata to send with the RPC.
      client_id: 128-bit unique client id. If set, enables publish idempotency for the session.

    Returns:
      A new AsyncPublisher.

    Throws:
      GoogleApiCallException on any error determining topic structure.
    CLOUD_PUBSUB_SHIM)	frameworkc            	      (    t               S )Nr   r   r   r   r   r   r   )make_wire_publisher)r   r   r   r   r   r   r   s   Nlib/third_party/google/cloud/pubsublite/cloudpubsub/internal/make_publisher.pyunderlying_factoryz0make_async_publisher.<locals>.underlying_factoryI   s%    ",K#)
 	
    )r   r   r   )r   r   r   r   r   r   r   r!   s   ``````` r    make_async_publisherr#   ,   s/    6 n7JKXVH	
 	
 $$677r"   c                 8    t        t        | ||||||            S )a  
    Make a new publisher for the given topic.

    Args:
      topic: The topic to publish to.
      transport: The transport type to use.
      per_partition_batching_settings: Settings for batching messages on each partition. The default is reasonable for most cases.
      credentials: The credentials to use to connect. GOOGLE_DEFAULT_CREDENTIALS is used if None.
      client_options: Other options to pass to the client. Note that if you pass any you must set api_endpoint.
      metadata: Additional metadata to send with the RPC.
      client_id: 128-bit unique client id. If set, enables publish idempotency for the session.

    Returns:
      A new Publisher.

    Throws:
      GoogleApiCallException on any error determining topic structure.
    r   )r	   r#   r   s          r    r   r   W   s.    6 ,K#)	

 
r"   )NNNNN)typingr   r   google.api_core.client_optionsr   google.auth.credentialsr   google.cloud.pubsub_v1.typesr   Agoogle.cloud.pubsublite.cloudpubsub.internal.async_publisher_implr   ;google.cloud.pubsublite.cloudpubsub.internal.publisher_implr	   =google.cloud.pubsublite.cloudpubsub.internal.single_publisherr
   r   4google.cloud.pubsublite.internal.publisher_client_idr   4google.cloud.pubsublite.internal.wire.make_publisherr   r   r   WIRE_DEFAULT_BATCHING4google.cloud.pubsublite.internal.wire.merge_metadatar   4google.cloud.pubsublite.internal.wire.pubsub_contextr   google.cloud.pubsublite.typesr   strr#    r"   r    <module>r4      sP   % 8 / 6 S P O 3 2  @D)-.2,0-1(8(8(8 &.m%<(8 +&	(8
 ]+(8 wsCx()(8 )*(8 (8\ @D)-.2,0-1%%% &.m%<% +&	%
 ]+% wsCx()% )*% %r"   