
    c                         d dl mZ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 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 d dlmZ d dlmZm Z m!Z!m"Z"  G d dee      Z#y)    )OptionalListUnion)ClientOptions)	Operation)Credentials)	FieldMask)AdminClientInterface)ConstructableFromServiceAccount)regional_endpoint)AdminClientImpl)CloudRegionSubscriptionPathLocationPath	TopicPathBacklogLocationPublishTime	EventTime)ReservationPath)AdminServiceClientSubscriptionTopicReservationc            
          e Zd ZU dZeed<   	 	 	 d(dedee   dee	   dee
   fdZd	efd
Zded	efdZded	efdZded	efdZded	ee   fdZdeded	efdZdefdZded	ee   fdZej8                  dfdedeeee f   dee   d	efdZ!ded	efdZ"ded	ee   fdZ#deded	efdZ$dedeeee f   d	e%fdZ&defdZ'd e(d	e(fd!Z)d"e*d	e(fd#Z+ded	ee(   fd$Z,d e(ded	e(fd%Z-d"e*fd&Z.d"e*d	ee   fd'Z/y))AdminClientzM
    An admin client for Pub/Sub Lite. Only operates on a single region.
    _implNregioncredentials	transportclient_optionsc                 l    |t        t        |            }t        t        |||      |      | _        y)aP  
        Create a new AdminClient.

        Args:
            region: The cloud region to connect to.
            credentials: The credentials to use when connecting.
            transport: The transport to use.
            client_options: The client options to use when connecting. If used, must explicitly set `api_endpoint`.
        N)api_endpoint)r    r   r   )r   r   r   r   r   )selfr   r   r   r    s        7lib/third_party/google/cloud/pubsublite/admin_client.py__init__zAdminClient.__init__5   s<      !*8I&8QRN$-#'
 

    returnc                 6    | j                   j                         S N)r   r   )r#   s    r$   r   zAdminClient.regionP   s    zz  ""r&   topicc                 8    | j                   j                  |      S r)   )r   create_topic)r#   r*   s     r$   r,   zAdminClient.create_topicS   s    zz&&u--r&   
topic_pathc                 8    | j                   j                  |      S r)   )r   	get_topicr#   r-   s     r$   r/   zAdminClient.get_topicV   s    zz##J//r&   c                 8    | j                   j                  |      S r)   )r   get_topic_partition_countr0   s     r$   r2   z%AdminClient.get_topic_partition_countY   s    zz33J??r&   location_pathc                 8    | j                   j                  |      S r)   )r   list_topicsr#   r3   s     r$   r5   zAdminClient.list_topics\   s    zz%%m44r&   update_maskc                 :    | j                   j                  ||      S r)   )r   update_topic)r#   r*   r7   s      r$   r9   zAdminClient.update_topic_   s    zz&&uk::r&   c                 8    | j                   j                  |      S r)   )r   delete_topicr0   s     r$   r;   zAdminClient.delete_topicb   s    zz&&z22r&   c                 8    | j                   j                  |      S r)   )r   list_topic_subscriptionsr0   s     r$   r=   z$AdminClient.list_topic_subscriptionse   s    zz22:>>r&   subscriptiontargetstarting_offsetc                 <    | j                   j                  |||      S r)   )r   create_subscription)r#   r>   r?   r@   s       r$   rB   zAdminClient.create_subscriptionh   s     zz--lFOTTr&   subscription_pathc                 8    | j                   j                  |      S r)   )r   get_subscriptionr#   rC   s     r$   rE   zAdminClient.get_subscriptionp   s    zz**+<==r&   c                 8    | j                   j                  |      S r)   )r   list_subscriptionsr6   s     r$   rH   zAdminClient.list_subscriptionss   s    zz,,];;r&   c                 :    | j                   j                  ||      S r)   )r   update_subscription)r#   r>   r7   s      r$   rJ   zAdminClient.update_subscriptionv   s     zz--lKHHr&   c                 :    | j                   j                  ||      S r)   )r   seek_subscription)r#   rC   r?   s      r$   rL   zAdminClient.seek_subscription{   s    
 zz++,=vFFr&   c                 8    | j                   j                  |      S r)   )r   delete_subscriptionrF   s     r$   rN   zAdminClient.delete_subscription   s    zz--.?@@r&   reservationc                 8    | j                   j                  |      S r)   )r   create_reservation)r#   rO   s     r$   rQ   zAdminClient.create_reservation   s    zz,,[99r&   reservation_pathc                 8    | j                   j                  |      S r)   )r   get_reservationr#   rR   s     r$   rT   zAdminClient.get_reservation   s    zz))*:;;r&   c                 8    | j                   j                  |      S r)   )r   list_reservationsr6   s     r$   rW   zAdminClient.list_reservations   s    zz++M::r&   c                 :    | j                   j                  ||      S r)   )r   update_reservation)r#   rO   r7   s      r$   rY   zAdminClient.update_reservation   s     zz,,[+FFr&   c                 8    | j                   j                  |      S r)   )r   delete_reservationrU   s     r$   r[   zAdminClient.delete_reservation   s    zz,,-=>>r&   c                 8    | j                   j                  |      S r)   )r   list_reservation_topicsrU   s     r$   r]   z#AdminClient.list_reservation_topics   s     zz112BCCr&   )NNN)0__name__
__module____qualname____doc__r
   __annotations__r   r   r   strr   r%   r   r   r,   r   r/   intr2   r   r   r5   r	   r9   r;   r   r=   r   ENDr   r   r   r   rB   rE   rH   rJ   r   rL   rN   r   rQ   r   rT   rW   rY   r[   r]    r&   r$   r   r   .   sV     
 .2#'26

 k*
 C=	

 !/
6# #.% .E .0I 0% 0@I @# @5 5$u+ 5;% ;i ;E ;3y 3?9 ?FVAW ? BQATAT59	U"U o{I=>U "/2	U
 
U>2B >| >< <lAS <I(I7@I	I
G+G o{I=>G 
	GA5E A:k :k :< <K <;| ;[@Q ;G&G5>G	G
?? ?D /D	iDr&   r   N)$typingr   r   r   google.api_core.client_optionsr   google.api_core.operationr   google.auth.credentialsr   'cloudsdk.google.protobuf.field_mask_pb2r	   .google.cloud.pubsublite.admin_client_interfacer
   Cgoogle.cloud.pubsublite.internal.constructable_from_service_accountr   *google.cloud.pubsublite.internal.endpointsr   7google.cloud.pubsublite.internal.wire.admin_client_implr   google.cloud.pubsublite.typesr   r   r   r   r   r   r   #google.cloud.pubsublite.types.pathsr   google.cloud.pubsublite_v1r   r   r   r   r   rf   r&   r$   <module>rs      s]    ) ( 8 / / = O I S   @ kD&(G kDr&   