o
    iP                     @   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 G dd dZG d	d
 d
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_speechc                   @      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 )ListRecognizersPagera  A pager for iterating through ``list_recognizers`` requests.

    This class thinly wraps an initial
    :class:`google.cloud.speech_v2.types.ListRecognizersResponse` object, and
    provides an ``__iter__`` method to iterate through its
    ``recognizers`` field.

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

    All the usual :class:`google.cloud.speech_v2.types.ListRecognizersResponse`
    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_v2.types.ListRecognizersRequest):
                The initial request object.
            response (google.cloud.speech_v2.types.ListRecognizersResponse):
                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   ListRecognizersRequest_request	_response_retry_timeout	_metadataselfr   r   r   r   r   r   r   r   a/home/ubuntu/.local/lib/python3.10/site-packages/google/cloud/speech_v2/services/speech/pagers.py__init__>      
zListRecognizersPager.__init__namereturnc                 C      t | j|S Ngetattrr   r"   r&   r   r   r#   __getattr__`      z ListRecognizersPager.__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ListRecognizersPager.pagesc                 c       | j D ]}|jE d H  qd S r)   r5   recognizersr"   pager   r   r#   __iter__p      
zListRecognizersPager.__iter__c                 C      d | jj| jS Nz
{0}<{1!r}>format	__class____name__r   r4   r   r   r#   __repr__t      zListRecognizersPager.__repr__N)rC   
__module____qualname____doc__r   r   DEFAULTr   r   ListRecognizersResponser   OptionalRetryr
   floatobjectr   r	   strbytesr$   r   r-   propertyr   r5   
Recognizerr<   rD   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 )ListRecognizersAsyncPagera  A pager for iterating through ``list_recognizers`` requests.

    This class thinly wraps an initial
    :class:`google.cloud.speech_v2.types.ListRecognizersResponse` object, and
    provides an ``__aiter__`` method to iterate through its
    ``recognizers`` field.

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

    All the usual :class:`google.cloud.speech_v2.types.ListRecognizersResponse`
    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_v2.types.ListRecognizersRequest):
                The initial request object.
            response (google.cloud.speech_v2.types.ListRecognizersResponse):
                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"ListRecognizersAsyncPager.__init__r&   r'   c                 C   r(   r)   r*   r,   r   r   r#   r-      r.   z%ListRecognizersAsyncPager.__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 r0   r1   r4   r   r   r#   r5         zListRecognizersAsyncPager.pagesc                        fdd}| S )Nc                    .    j 2 z3 d H W } | jD ]}|V  qq6 d S r)   r8   r;   r   r4   r   r#   async_generator      
z<ListRecognizersAsyncPager.__aiter__.<locals>.async_generatorr   r"   rZ   r   r4   r#   	__aiter__      z#ListRecognizersAsyncPager.__aiter__c                 C   r>   r?   r@   r4   r   r   r#   rD      rE   z"ListRecognizersAsyncPager.__repr__N)rC   rF   rG   rH   r   r   rI   r   r   r   rJ   r   OptionalAsyncRetryr
   rL   rM   r   r	   rN   rO   r$   r   r-   rP   r   r5   rQ   r]   rD   r   r   r   r#   rT   x   .    

"rT   c                   @   r   )ListCustomClassesPagera  A pager for iterating through ``list_custom_classes`` requests.

    This class thinly wraps an initial
    :class:`google.cloud.speech_v2.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_v2.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_v2.types.ListCustomClassesRequest):
                The initial request object.
            response (google.cloud.speech_v2.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   r/   r0   r1   r4   r   r   r#   r5      r6   zListCustomClassesPager.pagesc                 c   r7   r)   r5   custom_classesr:   r   r   r#   r<     r=   zListCustomClassesPager.__iter__c                 C   r>   r?   r@   r4   r   r   r#   rD     rE   zListCustomClassesPager.__repr__N)rC   rF   rG   rH   r   r   rI   r   r   ListCustomClassesResponserc   rK   r
   rL   rM   r   r	   rN   rO   r$   r   r-   rP   r   r5   CustomClassr<   rD   r   r   r   r#   ra      rR   ra   c                   @   rS   )ListCustomClassesAsyncPagera  A pager for iterating through ``list_custom_classes`` requests.

    This class thinly wraps an initial
    :class:`google.cloud.speech_v2.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_v2.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_v2.types.ListCustomClassesRequest):
                The initial request object.
            response (google.cloud.speech_v2.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$   &  r%   z$ListCustomClassesAsyncPager.__init__r&   r'   c                 C   r(   r)   r*   r,   r   r   r#   r-   H  r.   z'ListCustomClassesAsyncPager.__getattr__c                 C  rU   r0   r1   r4   r   r   r#   r5   K  rV   z!ListCustomClassesAsyncPager.pagesc                    rW   )Nc                    rX   r)   rd   rY   r4   r   r#   rZ   Y  r[   z>ListCustomClassesAsyncPager.__aiter__.<locals>.async_generatorr   r\   r   r4   r#   r]   X  r^   z%ListCustomClassesAsyncPager.__aiter__c                 C   r>   r?   r@   r4   r   r   r#   rD   `  rE   z$ListCustomClassesAsyncPager.__repr__N)rC   rF   rG   rH   r   r   rI   r   r   r   rf   rc   r_   r
   rL   rM   r   r	   rN   rO   r$   r   r-   rP   r   r5   rg   r]   rD   r   r   r   r#   rh     r`   rh   c                   @   r   )ListPhraseSetsPagera  A pager for iterating through ``list_phrase_sets`` requests.

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

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

    All the usual :class:`google.cloud.speech_v2.types.ListPhraseSetsResponse`
    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_v2.types.ListPhraseSetsRequest):
                The initial request object.
            response (google.cloud.speech_v2.types.ListPhraseSetsResponse):
                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   ListPhraseSetsRequestr   r   r   r   r    r!   r   r   r#   r$   v  r%   zListPhraseSetsPager.__init__r&   r'   c                 C   r(   r)   r*   r,   r   r   r#   r-     r.   zListPhraseSetsPager.__getattr__c                 c   r/   r0   r1   r4   r   r   r#   r5     r6   zListPhraseSetsPager.pagesc                 c   r7   r)   r5   phrase_setsr:   r   r   r#   r<     r=   zListPhraseSetsPager.__iter__c                 C   r>   r?   r@   r4   r   r   r#   rD     rE   zListPhraseSetsPager.__repr__N)rC   rF   rG   rH   r   r   rI   r   r   ListPhraseSetsResponserk   rK   r
   rL   rM   r   r	   rN   rO   r$   r   r-   rP   r   r5   	PhraseSetr<   rD   r   r   r   r#   ri   d  rR   ri   c                   @   rS   )ListPhraseSetsAsyncPagera  A pager for iterating through ``list_phrase_sets`` requests.

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

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

    All the usual :class:`google.cloud.speech_v2.types.ListPhraseSetsResponse`
    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_v2.types.ListPhraseSetsRequest):
                The initial request object.
            response (google.cloud.speech_v2.types.ListPhraseSetsResponse):
                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`.
        Nrj   r!   r   r   r#   r$     r%   z!ListPhraseSetsAsyncPager.__init__r&   r'   c                 C   r(   r)   r*   r,   r   r   r#   r-     r.   z$ListPhraseSetsAsyncPager.__getattr__c                 C  rU   r0   r1   r4   r   r   r#   r5     rV   zListPhraseSetsAsyncPager.pagesc                    rW   )Nc                    rX   r)   rl   rY   r4   r   r#   rZ     r[   z;ListPhraseSetsAsyncPager.__aiter__.<locals>.async_generatorr   r\   r   r4   r#   r]     r^   z"ListPhraseSetsAsyncPager.__aiter__c                 C   r>   r?   r@   r4   r   r   r#   rD     rE   z!ListPhraseSetsAsyncPager.__repr__N)rC   rF   rG   rH   r   r   rI   r   r   r   rn   rk   r_   r
   rL   rM   r   r	   rN   rO   r$   r   r-   rP   r   r5   ro   r]   rD   r   r   r   r#   rp     r`   rp   ) typingr   r   r   r   r   r   r   r	   r
   google.api_corer   r   retriesr   retries_asyncRetryr   _MethodDefaultrK   
AsyncRetryr_   AttributeErrorrM   google.cloud.speech_v2.typesr   r   rT   ra   rh   ri   rp   r   r   r   r#   <module>   s(   ,LPLPL