o
    i8                     @   s   d dl mZmZmZmZmZmZmZmZ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e	ejejjdf ZW n eyW   e	ejedf Ze	ejedf ZY nw d dlmZmZ G dd dZG d	d
 d
ZG dd dZG dd dZdS )    )	AnyAsyncIterator	AwaitableCallableIteratorOptionalSequenceTupleUnion)gapic_v1)retry)retry_asyncN)cloud_speech_adaptationresourcec                   @      e Zd ZdZejjejjdddedej	f dej
dej	ded	eeef d
eeeeeef f  fddZdedefddZedeej	 fddZdeej fddZdefddZdS )ListPhraseSetPagera  A pager for iterating through ``list_phrase_set`` requests.

    This class thinly wraps an initial
    :class:`google.cloud.speech_v1.types.ListPhraseSetResponse` object, and
    provides an ``__iter__`` method to iterate through its
    ``phrase_sets`` field.

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

    All the usual :class:`google.cloud.speech_v1.types.ListPhraseSetResponse`
    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   timeoutmetadatamethod.requestresponser   r   r   c                C   .   || _ t|| _|| _|| _|| _|| _dS )a  Instantiate the pager.

        Args:
            method (Callable): The method that was originally called, and
                which instantiated this pager.
            request (google.cloud.speech_v1.types.ListPhraseSetRequest):
                The initial request object.
            response (google.cloud.speech_v1.types.ListPhraseSetResponse):
                The initial response object.
            retry (google.api_core.retry.Retry): Designation of what errors,
                if any, should be retried.
            timeout (float): The timeout for this request.
            metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.
        N_methodr   ListPhraseSetRequest_request	_response_retry_timeout	_metadataselfr   r   r   r   r   r   r   r   e/home/ubuntu/.local/lib/python3.10/site-packages/google/cloud/speech_v1/services/adaptation/pagers.py__init__>      
zListPhraseSetPager.__init__namereturnc                 C      t | j|S Ngetattrr   r#   r'   r   r   r$   __getattr__`      zListPhraseSetPager.__getattr__c                 c   R    | j V  | j jr'| j j| j_| j| j| j| j| jd| _ | j V  | j js	d S d S Nr   r   next_page_tokenr   
page_tokenr   r   r    r!   r#   r   r   r$   pagesc      zListPhraseSetPager.pagesc                 c       | j D ]}|jE d H  qd S r*   r6   phrase_setsr#   pager   r   r$   __iter__p      
zListPhraseSetPager.__iter__c                 C      d | jj| jS Nz
{0}<{1!r}>format	__class____name__r   r5   r   r   r$   __repr__t      zListPhraseSetPager.__repr__N)rD   
__module____qualname____doc__r   r   DEFAULTr   r   ListPhraseSetResponser   OptionalRetryr
   floatobjectr   r	   strbytesr%   r   r.   propertyr   r6   r   	PhraseSetr=   rE   r   r   r   r$   r   ,   .    

"r   c                   @      e Zd ZdZejjejjdddedee	j
 f de	jde	j
ded	eeef d
eeeeeef f  fddZdedefddZedee	j
 fddZdeej fddZdefddZdS )ListPhraseSetAsyncPagera  A pager for iterating through ``list_phrase_set`` requests.

    This class thinly wraps an initial
    :class:`google.cloud.speech_v1.types.ListPhraseSetResponse` object, and
    provides an ``__aiter__`` method to iterate through its
    ``phrase_sets`` field.

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

    All the usual :class:`google.cloud.speech_v1.types.ListPhraseSetResponse`
    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   r   r   c                C   r   )a  Instantiates the pager.

        Args:
            method (Callable): The method that was originally called, and
                which instantiated this pager.
            request (google.cloud.speech_v1.types.ListPhraseSetRequest):
                The initial request object.
            response (google.cloud.speech_v1.types.ListPhraseSetResponse):
                The initial response object.
            retry (google.api_core.retry.AsyncRetry): Designation of what errors,
                if any, should be retried.
            timeout (float): The timeout for this request.
            metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.
        Nr   r"   r   r   r$   r%      r&   z ListPhraseSetAsyncPager.__init__r'   r(   c                 C   r)   r*   r+   r-   r   r   r$   r.      r/   z#ListPhraseSetAsyncPager.__getattr__c                 C  X   | j V  | j jr*| j j| j_| j| j| j| j| jdI d H | _ | j V  | j js	d S d S r1   r2   r5   r   r   r$   r6         zListPhraseSetAsyncPager.pagesc                        fdd}| S )Nc                    .    j 2 z3 d H W } | jD ]}|V  qq6 d S r*   r9   r<   r   r5   r   r$   async_generator      
z:ListPhraseSetAsyncPager.__aiter__.<locals>.async_generatorr   r#   r[   r   r5   r$   	__aiter__      z!ListPhraseSetAsyncPager.__aiter__c                 C   r?   r@   rA   r5   r   r   r$   rE      rF   z ListPhraseSetAsyncPager.__repr__N)rD   rG   rH   rI   r   r   rJ   r   r   r   rK   r   OptionalAsyncRetryr
   rM   rN   r   r	   rO   rP   r%   r   r.   rQ   r   r6   r   rR   r^   rE   r   r   r   r$   rU   x   s2    

"rU   c                   @   r   )ListCustomClassesPagera  A pager for iterating through ``list_custom_classes`` requests.

    This class thinly wraps an initial
    :class:`google.cloud.speech_v1.types.ListCustomClassesResponse` object, and
    provides an ``__iter__`` method to iterate through its
    ``custom_classes`` field.

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

    All the usual :class:`google.cloud.speech_v1.types.ListCustomClassesResponse`
    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   r   r   c                C   r   )a  Instantiate the pager.

        Args:
            method (Callable): The method that was originally called, and
                which instantiated this pager.
            request (google.cloud.speech_v1.types.ListCustomClassesRequest):
                The initial request object.
            response (google.cloud.speech_v1.types.ListCustomClassesResponse):
                The initial response object.
            retry (google.api_core.retry.Retry): Designation of what errors,
                if any, should be retried.
            timeout (float): The timeout for this request.
            metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.
        Nr   r   ListCustomClassesRequestr   r   r   r    r!   r"   r   r   r$   r%      r&   zListCustomClassesPager.__init__r'   r(   c                 C   r)   r*   r+   r-   r   r   r$   r.      r/   z"ListCustomClassesPager.__getattr__c                 c   r0   r1   r2   r5   r   r   r$   r6     r7   zListCustomClassesPager.pagesc                 c   r8   r*   r6   custom_classesr;   r   r   r$   r=     r>   zListCustomClassesPager.__iter__c                 C   r?   r@   rA   r5   r   r   r$   rE     rF   zListCustomClassesPager.__repr__N)rD   rG   rH   rI   r   r   rJ   r   r   ListCustomClassesResponserc   rL   r
   rM   rN   r   r	   rO   rP   r%   r   r.   rQ   r   r6   r   CustomClassr=   rE   r   r   r   r$   ra      rS   ra   c                   @   rT   )ListCustomClassesAsyncPagera  A pager for iterating through ``list_custom_classes`` requests.

    This class thinly wraps an initial
    :class:`google.cloud.speech_v1.types.ListCustomClassesResponse` object, and
    provides an ``__aiter__`` method to iterate through its
    ``custom_classes`` field.

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

    All the usual :class:`google.cloud.speech_v1.types.ListCustomClassesResponse`
    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   r   r   c                C   r   )a  Instantiates the pager.

        Args:
            method (Callable): The method that was originally called, and
                which instantiated this pager.
            request (google.cloud.speech_v1.types.ListCustomClassesRequest):
                The initial request object.
            response (google.cloud.speech_v1.types.ListCustomClassesResponse):
                The initial response object.
            retry (google.api_core.retry.AsyncRetry): Designation of what errors,
                if any, should be retried.
            timeout (float): The timeout for this request.
            metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
                sent along with the request as metadata. Normally, each value must be of type `str`,
                but for metadata keys ending with the suffix `-bin`, the corresponding values must
                be of type `bytes`.
        Nrb   r"   r   r   r$   r%   (  s   
z$ListCustomClassesAsyncPager.__init__r'   r(   c                 C   r)   r*   r+   r-   r   r   r$   r.   L  r/   z'ListCustomClassesAsyncPager.__getattr__c                 C  rV   r1   r2   r5   r   r   r$   r6   O  rW   z!ListCustomClassesAsyncPager.pagesc                    rX   )Nc                    rY   r*   rd   rZ   r5   r   r$   r[   _  r\   z>ListCustomClassesAsyncPager.__aiter__.<locals>.async_generatorr   r]   r   r5   r$   r^   ^  r_   z%ListCustomClassesAsyncPager.__aiter__c                 C   r?   r@   rA   r5   r   r   r$   rE   f  rF   z$ListCustomClassesAsyncPager.__repr__N)rD   rG   rH   rI   r   r   rJ   r   r   r   rf   rc   r`   r
   rM   rN   r   r	   rO   rP   r%   r   r.   rQ   r   r6   r   rg   r^   rE   r   r   r   r$   rh     s6    
	

$rh   )typingr   r   r   r   r   r   r   r	   r
   google.api_corer   r   retriesr   retries_asyncRetryr   _MethodDefaultrL   
AsyncRetryr`   AttributeErrorrN   google.cloud.speech_v1.typesr   r   r   rU   ra   rh   r   r   r   r$   <module>   s$   ,LRL