§
    $Âiö  ã                   óô   — d Z ddlZ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  e
d¦  «        Ze	d         Z G d	„ d
ee         ¦  «        Z G d„ dee         ¦  «        Z G d„ dee         ¦  «        ZdS )zPagers for the GenAI List APIs.é    N)	ÚAnyÚAsyncIteratorÚ	AwaitableÚCallableÚGenericÚIteratorÚLiteralÚTypeVarÚUnioné   )Ú_common)ÚtypesÚT)Ú
batch_jobsÚmodelsÚtuning_jobsÚfilesÚcached_contentsÚfile_search_storesÚ	documentsc            
       óN  — e Zd ZdZdededef         dededdf
d	„Zdededef         dedefd
„Ze	de
e         fd„¦   «         Ze	defd„¦   «         Ze	defd„¦   «         Ze	deej        df         fd„¦   «         Ze	dej        fd„¦   «         Zdefd„Zdedefd„Zdeddfd„ZdS )Ú
_BasePagerz9Base pager class for iterating through paginated results.ÚnameÚrequest.ÚresponseÚconfigÚreturnNc                 óž  — || _         || _        t          || j         ¦  «        pg | _        d| _        t          |dd ¦  «        | _        |si }n9t          |t          ¦  «        rt          j	        |¦  «        }nt          |¦  «        }t          |d¦  «        |d<   || _
        |                     dt          | j        ¦  «        ¦  «        | _        d S )Nr   Úsdk_http_responseÚnext_page_tokenÚ
page_tokenÚ	page_size)Ú_nameÚ_requestÚgetattrÚ_pageÚ_idxÚ_sdk_http_responseÚ
isinstanceÚdictÚcopyÚdeepcopyÚ_configÚgetÚlenÚ
_page_size)Úselfr   r   r   r   Úrequest_configs         ú]/var/www/html/jarvis.com/web/backend/venv/lib/python3.11/site-packages/google/genai/pagers.pyÚ
_init_pagez_BasePager._init_page)   sÂ   € ð €D„JØ€D„Må˜ 4¤:Ñ.Ô.Ð4°"€D„JØ€D„Iå% hÐ0CÀTÑJÔJ€DÔàð $Ø€n€nÝ	�F�DÑ	!Ô	!ð $Ý”} VÑ,Ô,€n€nå˜F‘|”|€nÝ#*¨8Ð5FÑ#GÔ#G€N�<Ñ Ø!€D„Là)×-Ò-¨k½3¸t¼z¹?¼?ÑKÔK€D„O€O€Oó    c                 ó6   — |                       ||||¦  «         d S ©N)r4   )r1   r   r   r   r   s        r3   Ú__init__z_BasePager.__init__C   s"   € ð 	‡O‚O�D˜' 8¨VÑ4Ô4Ð4Ð4Ð4r5   c                 ó   — | j         S )a_  Returns a subset of the entire list of items.

    For the number of items returned, see `pageSize()`.

    Usage:

    .. code-block:: python

      batch_jobs_pager = client.batches.list(config={'page_size': 5})
      print(f"first page: {batch_jobs_pager.page}")
      # first page: [BatchJob(name='projects/./locations/./batchPredictionJobs/1
    )r&   ©r1   s    r3   Úpagez_BasePager.pageL   s   € ð Œ:Ðr5   c                 ó   — | j         S )zøReturns the type of paged item (for example, ``batch_jobs``).

    Usage:

    .. code-block:: python

      batch_jobs_pager = client.batches.list(config={'page_size': 5})
      print(f"name: {batch_jobs_pager.name}")
      # name: batch_jobs
    )r#   r:   s    r3   r   z_BasePager.name]   s   € ð Œ:Ðr5   c                 ó   — | j         S )a  Returns the maximum number of items fetched by the pager at one time.

    Usage:

    .. code-block:: python

      batch_jobs_pager = client.batches.list(config={'page_size': 5})
      print(f"page_size: {batch_jobs_pager.page_size}")
      # page_size: 5
    )r0   r:   s    r3   r"   z_BasePager.page_sizel   s   € ð Œ?Ðr5   c                 ó   — | j         S )z.Returns the http response of the API response.)r(   r:   s    r3   r   z_BasePager.sdk_http_response{   s   € ð Ô"Ð"r5   c                 ó   — | j         S )a  Returns the configuration when making the API request for the next page.

    A configuration is a set of optional parameters and arguments that can be
    used to customize the API request. For example, the ``page_token`` parameter
    contains the token to request the next page.

    Usage:

    .. code-block:: python

      batch_jobs_pager = client.batches.list(config={'page_size': 5})
      print(f"config: {batch_jobs_pager.config}")
      # config: {'page_size': 5, 'page_token': 'AMEw9yO5jnsGnZJLHSKDFHJJu'}
    )r-   r:   s    r3   r   z_BasePager.config�   s   € ð" Œ<Ðr5   c                 ó*   — t          | j        ¦  «        S )z6Returns the total number of items in the current page.)r/   r;   r:   s    r3   Ú__len__z_BasePager.__len__”   s   € åˆtŒy‰>Œ>Ðr5   Úindexc                 ó   — | j         |         S )z$Returns the item at the given index.)r;   )r1   rB   s     r3   Ú__getitem__z_BasePager.__getitem__˜   s   € àŒ9�UÔÐr5   c                 óT   — |                       | j        | j        || j        ¦  «         dS )zÜInitializes the next page from the response.

    This is an internal method that should be called by subclasses after
    fetching the next page.

    Args:
      response: The response object from the API request.
    N)r4   r   r$   r   ©r1   r   s     r3   Ú_init_next_pagez_BasePager._init_next_pageœ   s(   € ð 	‡O‚O�D”I˜tœ}¨h¸¼ÑDÔDÐDÐDÐDr5   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	PagedItemr   r   r4   r8   ÚpropertyÚlistr   r;   r   Úintr"   r   r   ÚHttpResponser   r   Ú
StringDictr   rA   rD   rG   © r5   r3   r   r   &   sñ  € € € € € ØAÐAðLàðLð ˜˜S˜Ô!ðLð ð	Lð
 ðLð ðLð Lð Lð Lð45àð5ð ˜˜S˜Ô!ð5ð ð	5ð
 ð5ð 5ð 5ð 5ð ð�D˜”Gð ð ð ñ „8ðð  ð�Ið ð ð ñ „8ðð ð˜ð ð ð ñ „8ðð ð#  uÔ'9¸4Ð'?Ô!@ð #ð #ð #ñ „8ð#ð
 ð�gÔ(ð ð ð ñ „8ðð$�sð ð ð ð ð˜sð  qð ð ð ð ð	E cð 	E¨dð 	Eð 	Eð 	Eð 	Eð 	Eð 	Er5   r   c                   óN   — e Zd ZdZdefd„Zdee         fd„Zdee         fd„Z	dS )ÚPagerz4Pager class for iterating through paginated results.r   c                 óÐ   — | j         t          | ¦  «        k    r+	 |                      ¦   «          n# t          $ r t          ‚w xY w| j        | j                  }| xj         dz  c_         |S )zReturns the next item.r   )r'   r/   Ú	next_pageÚ
IndexErrorÚStopIterationr;   ©r1   Úitems     r3   Ú__next__zPager.__next__«   sr   € à„y•C˜‘I”IÒÐðØ�ŠÑÔÐÐøÝð ð ð ÝÐðøøøð Œ9�T”YÔ€DØ€I„I��N€I„IØ€Ks	   š/ ¯Ac                 ó   — d| _         | S )z#Returns an iterator over the items.r   ©r'   r:   s    r3   Ú__iter__zPager.__iter__·   ó   € à€D„IØ€Kr5   c                 óÂ   — | j                              d¦  «        st          d¦  «        ‚|                      | j         ¬¦  «        }|                      |¦  «         | j        S )aÌ  Fetches the next page of items. This makes a new API request.

    Usage:

    .. code-block:: python

      batch_jobs_pager = client.batches.list(config={'page_size': 5})
      print(f"current page: {batch_jobs_pager.page}")
      batch_jobs_pager.next_page()
      print(f"next page: {batch_jobs_pager.page}")
      # current page: [BatchJob(name='projects/.../batchPredictionJobs/1
      # next page: [BatchJob(name='projects/.../batchPredictionJobs/6
    r!   úNo more pages to fetch.©r   ©r   r.   rW   r$   rG   r;   rF   s     r3   rV   zPager.next_page¼   sZ   € ð Œ;�?Š?˜<Ñ(Ô(ð 2ÝÐ0Ñ1Ô1Ð1à�}Š} D¤Kˆ}Ñ0Ô0€HØ×Ò˜Ñ"Ô"Ð"ØŒ9Ðr5   N)
rH   rI   rJ   rK   r   r[   r   r^   rN   rV   rR   r5   r3   rT   rT   ¨   ss   € € € € € Ø<Ð<ð
˜ð 
ð 
ð 
ð 
ð˜ œð ð ð ð ð
˜˜aœð ð ð ð ð ð r5   rT   c                   óŒ   ‡ — e Zd ZdZdededee         f         dedefˆ fd„Zde	e
         fd	„Zde
fd
„Zdee
         fd„Zˆ xZS )Ú
AsyncPagerz9AsyncPager class for iterating through paginated results.r   r   .r   r   c                 óP   •— t          ¦   «                              ||||¦  «         d S r7   )Úsuperr8   )r1   r   r   r   r   Ú	__class__s        €r3   r8   zAsyncPager.__init__Ö   s)   ø€ õ 
�G„G×Ò�T˜7 H¨fÑ5Ô5Ð5Ð5Ð5r5   r   c                 ó   — d| _         | S )z)Returns an async iterator over the items.r   r]   r:   s    r3   Ú	__aiter__zAsyncPager.__aiter__ß   r_   r5   c              ƒ   óà   K  — | j         t          | ¦  «        k    r1	 |                      ¦   «         ƒ d{V —† n# t          $ r t          ‚w xY w| j        | j                  }| xj         dz  c_         |S )z%Returns the next item asynchronously.Nr   )r'   r/   rV   rW   ÚStopAsyncIterationr;   rY   s     r3   Ú	__anext__zAsyncPager.__anext__ä   sˆ   è è € à„y•C˜‘I”IÒÐð!Ø�nŠnÑÔÐÐÐÐÐÐÐÐøÝð !ð !ð !Ý Ð ð!øøøð Œ9�T”YÔ€DØ€I„I��N€I„IØ€Ks	   œ7 ·A	c              ƒ   óÒ   K  — | j                              d¦  «        st          d¦  «        ‚|                      | j         ¬¦  «        ƒ d{V —†}|                      |¦  «         | j        S )aS  Fetches the next page of items asynchronously.

    This makes a new API request.

    Returns:
      The next page of items.

    Raises:
      IndexError: No more pages to fetch.

    Usage:

    .. code-block:: python

      batch_jobs_pager = await client.aio.batches.list(config={'page_size': 5})
      print(f"current page: {batch_jobs_pager.page}")
      await batch_jobs_pager.next_page()
      print(f"next page: {batch_jobs_pager.page}")
      # current page: [BatchJob(name='projects/.../batchPredictionJobs/1
      # next page: [BatchJob(name='projects/.../batchPredictionJobs/6
    r!   ra   rb   Nrc   rF   s     r3   rV   zAsyncPager.next_pageð   sp   è è € ð. Œ;�?Š?˜<Ñ(Ô(ð 2ÝÐ0Ñ1Ô1Ð1à—]’]¨$¬+�]Ñ6Ô6Ð6Ð6Ð6Ð6Ð6Ð6€HØ×Ò˜Ñ"Ô"Ð"ØŒ9Ðr5   )rH   rI   rJ   rK   rL   r   r   r   r8   r   r   rj   rm   rN   rV   Ú__classcell__)rh   s   @r3   re   re   Ó   sÑ   ø€ € € € € ØAÐAð6àð6ð ˜˜Y sœ^Ð+Ô,ð6ð ð	6ð
 ð6ð 6ð 6ð 6ð 6ð 6ð˜ qÔ)ð ð ð ð ð

˜qð 
ð 
ð 
ð 
ð˜t Aœwð ð ð ð ð ð ð ð r5   re   )rK   r+   Útypingr   r   r   r   r   r   r	   r
   r   Ú r   r   r   rL   r   rT   re   rR   r5   r3   ú<module>rr      s@  ðð  &Ð %ð €€€Ø fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fØ Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à€GˆC�L„L€àðô€	ðEð Eð Eð Eð E�˜”ñ Eô Eð EðD(ð (ð (ð (ð (ˆJ�qŒMñ (ô (ð (ðV9ð 9ð 9ð 9ð 9�˜A”ñ 9ô 9ð 9ð 9ð 9r5   