
    l)                         d dl mZmZmZmZmZmZmZmZ d dl	m
Z
  G d d      Z G d d      Z G d d      Z G d	 d
      Zy)    )AnyAsyncIterator	AwaitableCallableSequenceTupleOptionalIterator)pubsubc                       e Zd ZdZdddedej                  f   dej                  dej                  dee	e
e
f      fd	Zd
e
defdZedeej                     fd       Zdeej"                     fdZde
fdZy)ListSubscriptionsPagera  A pager for iterating through ``list_subscriptions`` requests.

    This class thinly wraps an initial
    :class:`google.pubsub_v1.types.ListSubscriptionsResponse` object, and
    provides an ``__iter__`` method to iterate through its
    ``subscriptions`` field.

    If there are more pages, the ``__iter__`` method will make additional
    ``ListSubscriptions`` requests and continue to iterate
    through the ``subscriptions`` field on the
    corresponding responses.

    All the usual :class:`google.pubsub_v1.types.ListSubscriptionsResponse`
    attributes are available on the pager. If multiple requests are made, only
    the most recent response is retained, and thus used for attribute lookup.
     metadatamethod.requestresponser   c                b    || _         t        j                  |      | _        || _        || _        y)a  Instantiate the pager.

        Args:
            method (Callable): The method that was originally called, and
                which instantiated this pager.
            request (google.pubsub_v1.types.ListSubscriptionsRequest):
                The initial request object.
            response (google.pubsub_v1.types.ListSubscriptionsResponse):
                The initial response object.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.
        N_methodr   ListSubscriptionsRequest_request	_response	_metadataselfr   r   r   r   s        >lib/third_party/google/pubsub_v1/services/subscriber/pagers.py__init__zListSubscriptionsPager.__init__0   +    ( 77@!!    namereturnc                 .    t        | j                  |      S Ngetattrr   r   r!   s     r   __getattr__z"ListSubscriptionsPager.__getattr__I       t~~t,,r    c              #   B  K   | j                    | j                   j                  rw| j                   j                  | j                  _        | j	                  | j                  | j
                        | _         | j                    | j                   j                  rvy y wNr   r   next_page_tokenr   
page_tokenr   r   r   s    r   pageszListSubscriptionsPager.pagesL   h     nnnn,,'+~~'E'EDMM$!\\$--$..\QDN..  nn,,   BBBc              #   Z   K   | j                   D ]  }|j                  E d {     y 7 wr$   r0   subscriptionsr   pages     r   __iter__zListSubscriptionsPager.__iter__T   s&     JJD)))) )   +)+c                 b    dj                  | j                  j                  | j                        S Nz
{0}<{1!r}>format	__class____name__r   r/   s    r   __repr__zListSubscriptionsPager.__repr__X   #    ""4>>#:#:DNNKKr    N)r?   
__module____qualname____doc__r   r   ListSubscriptionsResponser   r   r   strr   r   r(   propertyr
   r0   Subscriptionr8   r@   r   r    r   r   r      s    . /1"f>>>?" 00" 22	" 5c?+"2- - - !x @ @A ! !*(6#6#67 *L# Lr    r   c                       e Zd ZdZdddedeej                     f   dej                  dej                  de	e
eef      fd	Zd
edefdZedeej                     fd       Zdeej$                     fdZdefdZy)ListSubscriptionsAsyncPagera  A pager for iterating through ``list_subscriptions`` requests.

    This class thinly wraps an initial
    :class:`google.pubsub_v1.types.ListSubscriptionsResponse` object, and
    provides an ``__aiter__`` method to iterate through its
    ``subscriptions`` field.

    If there are more pages, the ``__aiter__`` method will make additional
    ``ListSubscriptions`` requests and continue to iterate
    through the ``subscriptions`` field on the
    corresponding responses.

    All the usual :class:`google.pubsub_v1.types.ListSubscriptionsResponse`
    attributes are available on the pager. If multiple requests are made, only
    the most recent response is retained, and thus used for attribute lookup.
    r   r   r   .r   r   r   c                b    || _         t        j                  |      | _        || _        || _        y)a  Instantiates the pager.

        Args:
            method (Callable): The method that was originally called, and
                which instantiated this pager.
            request (google.pubsub_v1.types.ListSubscriptionsRequest):
                The initial request object.
            response (google.pubsub_v1.types.ListSubscriptionsResponse):
                The initial response object.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.
        Nr   r   s        r   r   z$ListSubscriptionsAsyncPager.__init__n   r   r    r!   r"   c                 .    t        | j                  |      S r$   r%   r'   s     r   r(   z'ListSubscriptionsAsyncPager.__getattr__   r)   r    c                Z  K   | j                    | j                   j                  r| j                   j                  | j                  _        | j	                  | j                  | j
                         d {   | _         | j                    | j                   j                  ry y 7 1wr+   r,   r/   s    r   r0   z!ListSubscriptionsAsyncPager.pages   n     nnnn,,'+~~'E'EDMM$#'<<<#WWDN..  nn,,W   A5B+7B)8.B+'B+c                       fd} |       S )Nc                 l   K   j                   2 3 d {   } | j                  D ]  }| 	  7 6 y wr$   r4   r7   r   r   s     r   async_generatorz>ListSubscriptionsAsyncPager.__aiter__.<locals>.async_generator   s2     "jj #d $ 2 2H"N !3#j   4202424r   r   rS   s   ` r   	__aiter__z%ListSubscriptionsAsyncPager.__aiter__       	#
   r    c                 b    dj                  | j                  j                  | j                        S r;   r<   r/   s    r   r@   z$ListSubscriptionsAsyncPager.__repr__   rA   r    N)r?   rB   rC   rD   r   r   r   rE   r   r   r   rF   r   r   r(   rG   r   r0   rH   rV   r@   r   r    r   rJ   rJ   \   s    . /1"i(H(HIIJ" 00" 22	" 5c?+"2- - - !]6+K+KL ! !!=)<)<= !L# Lr    rJ   c                       e Zd ZdZdddedej                  f   dej                  dej                  dee	e
e
f      fd	Zd
e
defdZedeej                     fd       Zdeej"                     fdZde
fdZy)ListSnapshotsPagera  A pager for iterating through ``list_snapshots`` requests.

    This class thinly wraps an initial
    :class:`google.pubsub_v1.types.ListSnapshotsResponse` object, and
    provides an ``__iter__`` method to iterate through its
    ``snapshots`` field.

    If there are more pages, the ``__iter__`` method will make additional
    ``ListSnapshots`` requests and continue to iterate
    through the ``snapshots`` field on the
    corresponding responses.

    All the usual :class:`google.pubsub_v1.types.ListSnapshotsResponse`
    attributes are available on the pager. If multiple requests are made, only
    the most recent response is retained, and thus used for attribute lookup.
    r   r   r   .r   r   r   c                b    || _         t        j                  |      | _        || _        || _        y)a  Instantiate the pager.

        Args:
            method (Callable): The method that was originally called, and
                which instantiated this pager.
            request (google.pubsub_v1.types.ListSnapshotsRequest):
                The initial request object.
            response (google.pubsub_v1.types.ListSnapshotsResponse):
                The initial response object.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.
        Nr   r   ListSnapshotsRequestr   r   r   r   s        r   r   zListSnapshotsPager.__init__   +    ( 33G<!!r    r!   r"   c                 .    t        | j                  |      S r$   r%   r'   s     r   r(   zListSnapshotsPager.__getattr__   r)   r    c              #   B  K   | j                    | j                   j                  rw| j                   j                  | j                  _        | j	                  | j                  | j
                        | _         | j                    | j                   j                  rvy y wr+   r,   r/   s    r   r0   zListSnapshotsPager.pages   r1   r2   c              #   Z   K   | j                   D ]  }|j                  E d {     y 7 wr$   r0   	snapshotsr6   s     r   r8   zListSnapshotsPager.__iter__   s$     JJD~~%% %r9   c                 b    dj                  | j                  j                  | j                        S r;   r<   r/   s    r   r@   zListSnapshotsPager.__repr__   rA   r    N)r?   rB   rC   rD   r   r   ListSnapshotsResponser]   r   r   rF   r   r   r(   rG   r
   r0   Snapshotr8   r@   r   r    r   rZ   rZ      s    . /1"f:::;" ,," ..	" 5c?+"2- - - !x < <= ! !&(6??3 &L# Lr    rZ   c                       e Zd ZdZdddedeej                     f   dej                  dej                  de	e
eef      fd	Zd
edefdZedeej                     fd       Zdeej$                     fdZdefdZy)ListSnapshotsAsyncPagera  A pager for iterating through ``list_snapshots`` requests.

    This class thinly wraps an initial
    :class:`google.pubsub_v1.types.ListSnapshotsResponse` object, and
    provides an ``__aiter__`` method to iterate through its
    ``snapshots`` field.

    If there are more pages, the ``__aiter__`` method will make additional
    ``ListSnapshots`` requests and continue to iterate
    through the ``snapshots`` field on the
    corresponding responses.

    All the usual :class:`google.pubsub_v1.types.ListSnapshotsResponse`
    attributes are available on the pager. If multiple requests are made, only
    the most recent response is retained, and thus used for attribute lookup.
    r   r   r   .r   r   r   c                b    || _         t        j                  |      | _        || _        || _        y)a  Instantiates the pager.

        Args:
            method (Callable): The method that was originally called, and
                which instantiated this pager.
            request (google.pubsub_v1.types.ListSnapshotsRequest):
                The initial request object.
            response (google.pubsub_v1.types.ListSnapshotsResponse):
                The initial response object.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.
        Nr\   r   s        r   r   z ListSnapshotsAsyncPager.__init__   r^   r    r!   r"   c                 .    t        | j                  |      S r$   r%   r'   s     r   r(   z#ListSnapshotsAsyncPager.__getattr__  r)   r    c                Z  K   | j                    | j                   j                  r| j                   j                  | j                  _        | j	                  | j                  | j
                         d {   | _         | j                    | j                   j                  ry y 7 1wr+   r,   r/   s    r   r0   zListSnapshotsAsyncPager.pages
  rN   rO   c                       fd} |       S )Nc                 l   K   j                   2 3 d {   } | j                  D ]  }| 	  7 6 y wr$   rb   rR   s     r   rS   z:ListSnapshotsAsyncPager.__aiter__.<locals>.async_generator  s0     "jj #d $H"N !/#jrT   r   rU   s   ` r   rV   z!ListSnapshotsAsyncPager.__aiter__  rW   r    c                 b    dj                  | j                  j                  | j                        S r;   r<   r/   s    r   r@   z ListSnapshotsAsyncPager.__repr__  rA   r    N)r?   rB   rC   rD   r   r   r   re   r]   r   r   rF   r   r   r(   rG   r   r0   rf   rV   r@   r   r    r   rh   rh      s    . /1"i(D(DEEF" ,," ..	" 5c?+"2- - - !]6+G+GH ! !!=9 !L# Lr    rh   N)typingr   r   r   r   r   r   r	   r
   google.pubsub_v1.typesr   r   rJ   rZ   rh   r   r    r   <module>rq      sL    	 	 	 *;L ;L|?L ?LD;L ;L|?L ?Lr    