
    _j                         d dl mZm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 d dlmZ d dlZd dlmZmZ d dlmZ  ed	e
          Z G d deee                   ZdS )    )SelfUnpack)	GenericListTypeVarcastAnyMappingIteratorAsyncIteratorOptional)_APIRequestor)StripeObject)_utilN)RequestOptionsextract_options_from_dict)AnyIteratorT)boundc                       e Zd ZU dZee         ed<   eed<   eed<   de	ee
f         defdZdefdZ ej        d	          de	ee
f         defd
            Zde	ee
f         defdZ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dee         fdZdee         fdZedee         defd            Ze defd            Z!dede	ee
f         fdZ"dede#e         fdZ$dee         defdZ%dee         defdZ& xZ'S )SearchResultObjectsearch_resultdatahas_more	next_pageparamsreturnc                     t          j                    5  t          j        dt                      | j        di |cd d d            S # 1 swxY w Y   d S )Nignore )warningscatch_warningssimplefilterDeprecationWarningsearchselfr   s     `/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/stripe/_search_result_object.py_searchzSearchResultObject._search!   s    $&& 	 	!(,>???4;   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   'AAAc                 x    |                      d          }t          |t                    st          d          |S )NurlzBCannot call .list on a list object without a string "url" property)get
isinstancestr
ValueError)r'   r+   s     r(   _get_url_for_searchz&SearchResultObject._get_url_for_search(   s?    hhuoo#s## 	T   
    zThis will be removed in a future version of stripe-python. Please call the `search` method on the corresponding resource directly, instead of the generic search on SearchResultObject.c           	      ~    t          t          |                     d|                                 |d                    S Nr,   api)r   base_address)r   r   _requestr0   r&   s     r(   r%   zSearchResultObject.search0   sG     MM((**"	   
 
 	
r1   c           	         K   t          t          |                     d|                                 |d           d {V           S r3   )r   r   _request_asyncr0   r&   s     r(   _search_asyncz SearchResultObject._search_async>   si      %%((**"	 &        
 
 	
r1   kc                     t          |t                    r(t          t          |                               |          S t          dt          |          dt          |          d          )NzYou tried to access the z index, but SearchResultObject types only support string keys. (HINT: Search calls return an object with  a 'data' (which is the data array). You likely want to call .data[z]))r-   r.   superr   __getitem__KeyErrorrepr)r'   r:   	__class__s     r(   r=   zSearchResultObject.__getitem__I   sh    a 	+T22>>qAAA( &*!WWWWd1gggg7  r1   c                 H    t          | dg                                           S Nr   )getattr__iter__r'   s    r(   rD   zSearchResultObject.__iter__W   s     tVR((11333r1   c                 H    t          | dg                                           S rB   )rC   __len__rE   s    r(   rG   zSearchResultObject.__len__Z   s     tVR((00222r1   c              #   Z   K   | }	 |D ]}|V  |                                 }|j        rd S 'N)next_search_result_pageis_emptyr'   pageitems      r(   _auto_paging_iterz$SearchResultObject._auto_paging_iter]   sO      	  



//11D} 	r1   c                 j    t          |                                 |                                           S rI   )r   rO   _auto_paging_iter_asyncrE   s    r(   auto_paging_iterz#SearchResultObject.auto_paging_iterh   s1    ""$$d&B&B&D&D
 
 	
r1   c                h   K   | }	 |D ]}|W V  |                                  d {V }|j        rd S .rI   )next_search_result_page_asyncrK   rL   s      r(   rQ   z*SearchResultObject._auto_paging_iter_asyncm   sc      	  




;;========D} 	r1   c           	      Z    |                      g dd dd t          j        di |d          S )NF)r   r   r   V1)valueslast_response	requestorapi_moder    )_construct_fromr   _global_with_options)clsr   s     r(   _empty_search_resultz'SearchResultObject._empty_search_resultx   sS    
 ""EEE#8     # 
 
 	
r1   c                     | j          S rI   )r   rE   s    r(   rK   zSearchResultObject.is_empty   s    9}r1   c                     t          | j                  }|                    d| j        i           |                    |           |S )NrM   )dict_retrieve_paramsupdater   )r'   r   params_with_filterss      r(   _get_filters_for_next_pagez-SearchResultObject._get_filters_for_next_page   sJ     #4#899""FDN#;<<<""6***""r1   c                     | j         sct          |          \  }}|                     |                    d          |                    d          |                    d                    S d S )Napi_keystripe_versionstripe_account)rg   rh   ri   )r   r   r^   r,   )r'   r   options_s       r(   _maybe_empty_resultz&SearchResultObject._maybe_empty_result   sp    } 	26::JGQ,,I..&{{+;<<&{{+;<< -   
 tr1   c                 t    |                      |          }||n | j        di |                     |          S Nr    )rl   r)   re   r'   r   emptys      r(   rJ   z*SearchResultObject.next_search_result_page   sW     ((00   E  11&99 	
r1   c                    K   |                      |          }||n% | j        di |                     |           d {V S rn   )rl   r9   re   ro   s      r(   rT   z0SearchResultObject.next_search_result_page_async   sz       ((00   E)t)  11&99       	
r1   )(__name__
__module____qualname__OBJECT_NAMEr   r   __annotations__boolr.   r
   r	   r   r)   r0   r   
deprecatedr%   r9   r=   r   rD   intrG   rO   r   rR   r   rQ   classmethodr   r   r^   propertyrK   re   r   rl   rJ   rT   __classcell__)r@   s   @r(   r   r      s        !K
q'MMMNNNNNNS 1 d    S     U 	B 	
wsCx0 	
T 	
 	
 	
 	
	
GCH,= 	
$ 	
 	
 	
 	
	S 	Q 	 	 	 	 	 	4(1+ 4 4 4 43 3 3 3 3	8A; 	 	 	 	
+a. 
 
 
 

	}Q/? 	 	 	 	 
(
 

 
 
 [
 $    X#$#	c	# # # #. Xd^    

~.

	

 

 

 



~.

	

 

 

 

 

 

 

 

r1   r   )typing_extensionsr   r   typingr   r   r   r   r	   r
   r   r   r   stripe._api_requestorr   stripe._stripe_objectr   striper   r!   stripe._request_optionsr   r   stripe._any_iteratorr   r   r   r    r1   r(   <module>r      sZ   * * * * * * * *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
      / . . . . .        M M M M M M M M , , , , , ,GC|$$$W
 W
 W
 W
 W
wqz W
 W
 W
 W
 W
r1   