
    OYhfN                    r   U d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dlZd dlmZ d dlmZ d dlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ d dlm Z m!Z!m"Z" d dl#Z#d dl$Z$d dl%Z%d dl&Z&d dl$m'Z'm(Z( d dl&m)Z) d	d
l*m+Z+ d	dl,m-Z- d	dl.m/Z/m0Z0 d	dl1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZB d	dlCmDZDmEZEmFZFmGZGmHZH d	dlImJZJmKZK d	dlLmMZMmNZNmOZOmPZP d	dlQmRZRmSZSmTZTmUZU d	dlVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z] d	dl^m_Z_m`Z`maZambZb d	dl+mcZcmdZdmeZemfZf d	dlgmhZh  ej                  ej      Zkdeld<    edd      Zm edd      Zn ed      Zo edd       Zp ed!e_e         Zq ed"eae         Zrerd d#lsmtZu n	 d d#lsmtZu  G d% d&      Zw G d' d(eMeeo         Zx G d) d*exeo   eeo         Zy G d+ d,eeoenf         Zz G d- d.exeo   eeo         Z{ ed/ee$j                  e$j                  f         Z~ ed0ee_e   eae   f         Z G d1 d2ee~ef         Z G d3 d4e$j                        Zere$j                  ZneZ G d5 d6e      Z G d7 d8ee$j                  e_e   f         Z G d9 d:e$j                        Zere$j                  ZneZ G d; d<e      Z G d= d>ee$j                  eae   f         Zddddde2e2d?	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dNd@Z G dA dB      Zeee dC   f   ZdOdDZ eGdE      dPdF       Z G dG dH      Zeee dI   f   ZdQdJZdQdKZdRdLZ	 	 	 	 	 	 dSdMZy# ev$ r  e7d$      ZuY w xY w)T    )annotationsN)TracebackType)random)TYPE_CHECKINGAnyDictTypeUnionGenericMappingTypeVarIterableIteratorOptional	GeneratorAsyncIteratorcastoverload)Literaloverride
get_origin)URLLimits)PrivateAttr   )_exceptionsQuerystring)to_httpx_filesasync_to_httpx_files)	NOT_GIVENBodyOmitQueryHeadersTimeoutNotGiven	ResponseT	Transport
AnyMapping
PostParserProxiesTypesRequestFilesHttpxSendArgsAsyncTransportRequestOptionsModelBuilderProtocol)is_dictis_listis_given	lru_cache
is_mapping)
model_copy
model_dump)GenericModelFinalRequestOptionsvalidate_typeconstruct_type)APIResponseBaseAPIResponseAsyncAPIResponseextract_response_type)DEFAULT_TIMEOUTMAX_RETRY_DELAYDEFAULT_MAX_RETRIESINITIAL_RETRY_DELAYRAW_RESPONSE_HEADEROVERRIDE_CAST_TO_HEADERDEFAULT_CONNECTION_LIMITS)Stream
SSEDecoderAsyncStreamSSEBytesDecoder)APIStatusErrorAPITimeoutErrorAPIConnectionErrorAPIResponseValidationError)LegacyAPIResponsezlogging.Loggerlog	SyncPageTzBaseSyncPage[Any])bound
AsyncPageTzBaseAsyncPage[Any]_T_T_coT)	covariant_StreamT_AsyncStreamT)DEFAULT_TIMEOUT_CONFIGg      @c                  t    e Zd ZU dZded<   ded<   e	 	 	 	 dd       Ze	 	 	 	 dd       Zeed	 	 	 	 	 dd	Zy
)PageInfozStores the necessary information to build the request to retrieve the next page.

    Either `url` or `params` must be set.
    URL | NotGivenurlQuery | NotGivenparamsc                    y N selfr^   s     R/var/www/feuerwehr-webapp/venv/lib/python3.12/site-packages/openai/_base_client.py__init__zPageInfo.__init__z        	    c                    y rb   rc   )re   r`   s     rf   rg   zPageInfo.__init__   rh   ri   r^   r`   c                    || _         || _        y rb   rk   )re   r^   r`   s      rf   rg   zPageInfo.__init__   s     ri   N)r^   r   returnNone)r`   r$   rm   rn   )r^   r]   r`   r_   rm   rn   )__name__
__module____qualname____doc____annotations__r   rg   r!   rc   ri   rf   r\   r\   q   s    
 
  
	    
	  (#,	  !	
 
ri   r\   c                  j    e Zd ZU dZ e       Zded<    e       Zded<   ddZddZ	ddZ
dd	Zdd
Zy)BasePagea<  
    Defines the core interface for pagination.

    Type Args:
        ModelT: The pydantic model that represents an item in the response.

    Methods:
        has_next_page(): Check if there is another page available
        next_page_info(): Get the necessary information to make a request for the next page
    r:   _optionsType[_T]_modelc                L    | j                         }|sy| j                         d uS )NF)_get_page_itemsnext_page_info)re   itemss     rf   has_next_pagezBasePage.has_next_page   s*    $$&""$D00ri   c                     y rb   rc   re   s    rf   r{   zBasePage.next_page_info       ri   c                     y rb   rc   r   s    rf   rz   zBasePage._get_page_items   r   ri   c                    t        j                  t        t        | j                  j
                              j                  |j
                        S rb   )httpxQueryParamsr   r   rv   r`   mergerd   s     rf   _params_from_urlzBasePage._params_from_url   s3      c4==+?+?!@AGG

SSri   c                   t        | j                        }|j                          t        |j                  t
              s!i |j                  |j                  |_        |S t        |j                  t
              sc| j                  |j                        }|j                  j                  |      }t        |j                        |_        t        |      |_        |S t        d      )N)r`   zUnexpected PageInfo state)r7   rv   _strip_raw_response_header
isinstancer`   r'   r^   r   	copy_withdictstr
ValueError)re   infooptionsr`   r^   s        rf   _info_to_optionszBasePage._info_to_options   s    T]]+**,$++x0>>$++>GNN$((H-**4884F(($$F$3C!#**-GNc(GKN455ri   Nrm   bool)rm   zOptional[PageInfo])rm   zIterable[_T])r^   r   rm   zhttpx.QueryParams)r   r\   rm   r:   )ro   rp   rq   rr   r   rv   rs   rx   r}   r{   rz   r   r   rc   ri   rf   ru   ru      s<    	 %0MH!1"}FH$1T6ri   ru   c                  j    e Zd ZU  ej                         Zded<   	 	 	 	 	 	 	 	 ddZd	dZd
dZ	ddZ
y)BaseSyncPageSyncAPIClient_clientc                .    || _         || _        || _        y rb   rx   r   rv   )re   clientmodelr   s       rf   _set_private_attributesz$BaseSyncPage._set_private_attributes        ri   c              #  h   K   | j                         D ]  }|j                         D ]  }|   y wrb   
iter_pagesrz   re   pageitems      rf   __iter__zBaseSyncPage.__iter__   s9     OO% 	D,,. 
	s   02c              #  ^   K   | }	 | |j                         r|j                         }ny 'wrb   r}   get_next_pagere   r   s     rf   r   zBaseSyncPage.iter_pages   s5     J!!#))+ s   +-c                    | j                         }|st        d      | j                  |      }| j                  j	                  | j
                  | j                  |      S NzYNo next page expected; please check `.has_next_page()` before calling `.get_next_page()`.)r   r   r{   RuntimeErrorr   r   _request_api_listrx   	__class__re   r   r   s      rf   r   zBaseSyncPage.get_next_page   sZ    ""$k  ''-||--dkkX_-``ri   N)r   r   r   rw   r   r:   rm   rn   )rm   zIterator[_T])re   rR   rm   zIterator[SyncPageT])re   rR   rm   rR   )ro   rp   rq   pydanticr   r   rs   r   r   r   r   rc   ri   rf   r   r      sR    1X113G]3     %	 
 
 $
ari   r   c                  @    e Zd Z	 	 	 	 	 	 	 	 	 	 ddZddZddZd	dZy)
AsyncPaginatorc                <    || _         || _        || _        || _        y rb   )rx   r   rv   	_page_cls)re   r   r   page_clsr   s        rf   rg   zAsyncPaginator.__init__   s      !ri   c                >    | j                         j                         S rb   )	_get_page	__await__r   s    rf   r   zAsyncPaginator.__await__   s    ~~))++ri   c                    K   d fd}| j                   _         j                  j                   j                   j                          d {   S 7 w)Nc                l    | j                  j                  j                  j                         | S )N)r   r   r   )r   rx   rv   r   )respre   s    rf   _parserz)AsyncPaginator._get_page.<locals>._parser  s2    ((kk|| ) 
 Kri   )r   rT   rm   rT   )rv   post_parserr   requestr   )re   r   s   ` rf   r   zAsyncPaginator._get_page  s?     	 %,!\\))$..$--HHHHs   AAAAc               h   K   t        t        |  d {         }|2 3 d {   }| 7 7 6 y wrb   )r   rT   r   s      rf   	__aiter__zAsyncPaginator.__aiter__  s<     J
  	 	$J 	$s$   2,

20.0202N)
r   AsyncAPIClientr   r:   r   Type[AsyncPageT]r   rw   rm   rn   )rm   z Generator[Any, None, AsyncPageT])rm   rT   rm   zAsyncIterator[_T])ro   rp   rq   rg   r   r   r   rc   ri   rf   r   r      sG    
"
" %
" #	
"
 
" 

",Iri   r   c                  j    e Zd ZU  ej                         Zded<   	 	 	 	 	 	 	 	 ddZd	dZd
dZ	ddZ
y)BaseAsyncPager   r   c                .    || _         || _        || _        y rb   r   )re   r   r   r   s       rf   r   z%BaseAsyncPage._set_private_attributes  r   ri   c               z   K   | j                         2 3 d {   }|j                         D ]  }| 	 $7 6 y wrb   r   r   s      rf   r   zBaseAsyncPage.__aiter__'  sB     //+ 	 	$,,. 
	+s   ;979;9;c               t   K   | }	 | |j                         r|j                          d {   }ny 07 wrb   r   r   s     rf   r   zBaseAsyncPage.iter_pages,  s=     J!!#!//11  2s   ,868c                   K   | j                         }|st        d      | j                  |      }| j                  j	                  | j
                  | j                  |       d {   S 7 wr   r   r   s      rf   r   zBaseAsyncPage.get_next_page5  sd     ""$k  ''-\\33DKKdnn^e3ffffs   A$A-&A+'A-N)r   rw   r   r   r   r:   rm   rn   r   )re   rT   rm   zAsyncIterator[AsyncPageT])re   rT   rm   rT   )ro   rp   rq   r   r   r   rs   r   r   r   r   rc   ri   rf   r   r     sR    2h224G^4     %	 
 
 
gri   r   _HttpxClientT_DefaultStreamTc                  <   e Zd ZU ded<   ded<   ded<   ded<   d	ed
<   ded<   ded<   ded<   ded<   ded<   dZded<   eeddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d3dZd4dZ	 	 	 	 d5dZ		 	 	 	 	 	 	 	 d6dZ
	 	 	 	 	 	 d7dZd8dZd9dZd:d Z	 	 	 	 d;d!Zd<d"Zd=d#Zd>d$Z	 	 	 	 	 	 	 	 d?d%Zed@d&       ZedAd'       ZedBd(       ZedCd)       Z	 	 	 	 	 	 dDd*ZedEd+       ZedFd,       Zej8                  dGd-       ZdHd.ZdIdJd/Z	 dI	 	 	 	 	 	 	 dKd0ZdLd1Z dEd2Z!y)M
BaseClientr   r   r   _versionr   	_base_urlintmax_retrieszUnion[float, Timeout, None]timeouthttpx.Limits_limitsProxiesTypes | None_proxies!Transport | AsyncTransport | None
_transportr   _strict_response_validation
str | None_idempotency_headerNztype[_DefaultStreamT] | None_default_stream_cls)r   r   custom_headerscustom_queryc       
            || _         | j                  t        |            | _        || _        || _        || _        || _        || _        |	xs i | _	        |
xs i | _
        || _        d | _        |t        d      y )Nzmax_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `openai.DEFAULT_MAX_RETRIES`)r   _enforce_trailing_slashr   r   r   r   r   r   r   _custom_headers_custom_queryr   r   	TypeError)re   versionbase_urlr   r   r   limits	transportproxiesr   r   s              rf   rg   zBaseClient.__init__Q  s      55c(mD&#-3)/R+F(#'  b  ri   c                z    |j                   j                  d      r|S |j                  |j                   dz         S )N   /raw_path)r   endswithr   rd   s     rf   r   z"BaseClient._enforce_trailing_slashp  s3    <<  &J}}cllT&9}::ri   c                J   |j                   r|j                  sd }d|j                   }nD|j                  j	                         }|}	 t        j                  |      }d|j                   d| }| j                  |||      S # t        $ r |xs d|j                   }Y 2w xY w)NzError code: z - )bodyresponse)		is_closedis_stream_consumedstatus_codetextstripjsonloads	Exception_make_status_error)re   r   r   err_msgerr_texts        rf    _make_status_error_from_responsez+BaseClient._make_status_error_from_responseu  s     h&A&A D$X%9%9$:;G}}**,HDLzz(+()=)=(>c$H &&wTH&MM  L"KX5I5I4J&KLs   'B B"!B"c                   t               rb   )NotImplementedError)re   r   r   r   s       rf   r   zBaseClient._make_status_error  s     "##ri   c                @    ||S |j                  | j                        S rb   )get_max_retriesr   )re   remaining_retriesr   s      rf   _remaining_retrieszBaseClient._remaining_retries  s'    
 %6$A pwG^G^_c_o_oGppri   c                @   |j                   xs i }t        | j                  |      }| j                  ||       t	        j
                  |      }| j                  }|rB|j                  j                         dk7  r%||vr!|j                  xs | j                         ||<   |S )Nget)headers_merge_mappingsdefault_headers_validate_headersr   r%   r   methodloweridempotency_key_idempotency_key)re   r   r   headers_dictr  idempotency_headers         rf   _build_headerszBaseClient._build_headers  s     .B&t';';^L|^< ---!55'.."6"6"8E"AFX`gFg*1*A*A*\TEZEZE\G&'ri   c                    t        |      }|j                  rN| j                  j                  |j                  j	                  d      z   }| j                  j                  |      S |S )z
        Merge a URL argument together with any 'base_url' on the client,
        to create the URL used for the outgoing request.
        r   r   )r   is_relative_urlr   r   lstripr   )re   r^   	merge_urlmerge_raw_paths       rf   _prepare_urlzBaseClient._prepare_url  sZ     H	$$!]]33i6H6H6O6OPT6UUN==**N*CCri   c                    t               S rb   )rI   r   s    rf   _make_sse_decoderzBaseClient._make_sse_decoder  s
    |ri   c                $   t         j                  t        j                        r!t         j	                  dt        |d             i }|j                  }|j                  W|t        t        |j                        }n:t        |      rt        ||j                        }nt        dt        |       d      | j                  |      }t        | j                  |j                         }|j#                  d      }|_|j%                  d      rNd|vr|j'                  d       |r7t)        |      st+        d	t        |       d
      | j-                  |      |d<    | j.                  j0                  d|t3        |j4                  t6              r| j4                  n|j4                  |j8                  | j;                  |j<                        |r6| j>                  jA                  t        tB        tD        tF        f   |            nd ||jH                  d|S )NzRequest options: %sT)exclude_unsetzUnexpected JSON data type, z , cannot merge with `extra_body`Content-Typezmultipart/form-databoundaryzGExpected query input to be a dictionary for multipart requests but got z	 instead.data)r  r   r  r^   r`   r   filesrc   )%rQ   isEnabledForloggingDEBUGdebugr8   	json_data
extra_jsonr   r"   r6   r  r   typer  r   r`   r  
startswithpopr2   r   _serialize_multipartformr   build_requestr   r   r'   r  r  r^   qs	stringifyr   r   r   r  )re   r   kwargsr!  r  r`   content_types          rf   _build_requestzBaseClient._build_request  s    GMM*II+Zt-TU!#%%	)  w'9'9:	I&+Iw7I7IJ	"%@i@QQq#rss%%g. !3!3W^^D{{>2 #(?(?@U(V- N+ y)#abfgpbqarr{|  "&!>!>y!Iv *t||)) 
$.w$IDLLw>>!!'++.
 JP477$$T'#s(*;V%DEUY--
 
 	
ri   c                    | j                   j                  |d      }i }|D ]B  \  }}|j                  |      }|s|||<   t        |      r|j	                  |       <||g||<   D |S )Nbrackets)array_format)r(  stringify_itemsr  r3   append)re   r  r|   
serializedkeyvalueexistings          rf   r&  z#BaseClient._serialize_multipartform  s    '' #	 ( 
 )+
 	4JC!~~c*H"'
3 x &#+U"3
3%	4( ri   c                    t        |j                        s|S t        |j                        }|j                  t        t
              }t        |      r||_        t        t        t           |      S |S rb   )	r4   r  r   r%  rF   r!   r   r	   r(   )re   cast_tor   r  override_cast_tos        rf   _maybe_override_cast_toz"BaseClient._maybe_override_cast_to  s^    (N w'
 #;;'>	J$%%GOY)9::ri   c                F    |j                   j                  t              dk(  S )Nstream)r  r  rE   re   r   s     rf   _should_stream_response_bodyz'BaseClient._should_stream_response_body"  s    ""#678CCri   c                  |t        t        d       S |t        u rt        t        |      S 	 t        j                  |      r1t        |t              r!t        t        |j                  ||            S | j                  rt        t        t        ||            S t        t        t        ||            S # t        j                  $ r}t        ||      |d }~ww xY w)N)r   r  )type_r4  )r   r   )r   r(   objectinspectisclass
issubclassr1   buildr   r;   r<   r   ValidationErrorrO   )re   r  r7  r   errs        rf   _process_response_dataz!BaseClient._process_response_data%  s     <	4((f	4((		Tw'Jw@T,UIw}}hT}'RSS//I}7$'OPP	>t#LMM'' 	T,hTJPSS	Ts$   AB4 2&B4 B4 4CCCc                    t               S rb   r   r   s    rf   r(  zBaseClient.qs=  s
    }ri   c                     y rb   rc   r   s    rf   custom_authzBaseClient.custom_authA  s    ri   c                    i S rb   rc   r   s    rf   auth_headerszBaseClient.auth_headersE  s    	ri   c                r    dd| j                   d| j                         | j                  | j                  S )Nzapplication/json)Acceptr  z
User-Agent)
user_agentplatform_headersrL  r   r   s    rf   r  zBaseClient.default_headersI  sN     ).//
 ##%	

 
 ""
 	
ri   c                     y)zaValidate the given default headers and custom headers.

        Does nothing by default.
        Nrc   )re   r  r   s      rf   r  zBaseClient._validate_headersT  s     	ri   c                L    | j                   j                   d| j                   S )Nz/Python )r   ro   r   r   s    rf   rO  zBaseClient.user_agent_  s"    ..))*(4==/BBri   c                    | j                   S rb   )r   r   s    rf   r   zBaseClient.base_urlc  s    ~~ri   c                z    | j                  t        |t              r|      | _        y t        |            | _        y rb   )r   r   r   r   rd   s     rf   r   zBaseClient.base_urlg  s-    55ZS=Qc`WZ[^W_`ri   c                ,    t        | j                        S rb   )rP  r   r   s    rf   rP  zBaseClient.platform_headersk  s    ..ri   c                   |y	 |j                  dd      }t        |      dz  S # t        t        f$ r Y nw xY w|j                  d      }	 t        |      S # t        t        f$ r Y nw xY wt        j
                  j                  |      }|yt        j
                  j                  |      }t        |t        j                         z
        S )a@  Returns a float of the number of seconds (not milliseconds) to wait after retrying, or None if unspecified.

        About the Retry-After header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
        See also  https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#syntax
        Nzretry-after-msi  zretry-after)	r  floatr   r   emailutilsparsedate_tz	mktime_tztime)re   response_headersretry_ms_headerretry_headerretry_date_tuple
retry_dates         rf   _parse_retry_after_headerz$BaseClient._parse_retry_after_headern  s     #	.223CTJO)D00:& 		 (++M:	 &&:& 		 !;;33LA#[[**+;<
Z$))+-..s   % 77
A A)(A)c                   |j                  | j                        }| j                  |      }|d|cxk  rdk  r|S  ||z
  }t        t        t        d|      z  t              }ddt               z  z
  }||z  }	|	dk\  r|	S dS )Nr   <   g       @r   g      ?)r   r   rb  minrD   powrB   r   )
re   r   r   r]  r   retry_after
nb_retriessleep_secondsjitterr   s
             rf   _calculate_retry_timeoutz#BaseClient._calculate_retry_timeout  s     --d.>.>? 445EF"q;'<"'< (= !#44
 /#c:2FFX TFH_$&(!Q,w-A-ri   c                P   |j                   j                  d      }|dk(  rt        j                  d       y|dk(  rt        j                  d       y|j                  dk(  r!t        j                  d	|j                         y|j                  d
k(  r!t        j                  d	|j                         y|j                  dk(  r!t        j                  d	|j                         y|j                  dk\  r!t        j                  d	|j                         yt        j                  d       y)Nzx-should-retrytruez4Retrying as header `x-should-retry` is set to `true`Tfalsez9Not retrying as header `x-should-retry` is set to `false`Fi  zRetrying due to status code %ii  i  i  zNot retrying)r  r  rQ   r   r   )re   r   should_retry_headers      rf   _should_retryzBaseClient._should_retry  s    &..223CD &(IILM')IIQR 3&II68L8LM 3&II68L8LM 3&II68L8LM 3&II68L8LM		.!ri   c                0    dt        j                          S )Nzstainless-python-retry-)uuiduuid4r   s    rf   r  zBaseClient._idempotency_key  s    (77ri   )r   r   r   	str | URLr   r   r   r   r   zfloat | Timeout | Noner   r   r   r   r   r   r   Mapping[str, str] | Noner   Mapping[str, object] | Nonerm   rn   )r^   r   rm   r   )r   httpx.Responserm   rL   )r   r   r   r@  r   rw  rm   z_exceptions.APIStatusError)r   Optional[int]r   r:   rm   r   )r   r:   rm   zhttpx.Headers)r^   r   rm   r   )rm   zSSEDecoder | SSEBytesDecoder)r   r:   rm   httpx.Request)r  zMapping[object, object]rm   zdict[str, object])r7  type[ResponseT]r   r:   rm   rz  )r   ry  rm   r   )r  r@  r7  rz  r   rw  rm   r(   )rm   r   )rm   zhttpx.Auth | None)rm   zdict[str, str])rm   zdict[str, str | Omit])r  r%   r   r%   rm   rn   rm   r   )rm   r   )r^   z	URL | strrm   rn   )rm   Dict[str, str]rb   )r]  Optional[httpx.Headers]rm   zfloat | None)r   r   r   r:   r]  r}  rm   rW  )r   rw  rm   r   )"ro   rp   rq   rs   r   rC   rA   rg   r   r   r   r  r  r  r  r,  r&  r9  r=  rG  propertyr(  rJ  rL  r  r  rO  r   setterrP  rb  rk  rp  r  rc   ri   rf   r   r   D  s   MN((!!11!%%##8<5< /*9 4848  	
 &*  (  5 % 1 2 
>;
N N 
N,$$ 	$
 !$ 
$$q(q %q 
	q8
$8
 
8
t<"DT T !	T
 !T 
T0       
 
		  	 
		 C C   __a a/ /L 59	.. %. 2	.
 
..!F8ri   r   c                        e Zd Zd fdZ xZS )_DefaultHttpxClientc                    |j                  dt               |j                  dt               |j                  dd       t        |   di | y Nr   r   follow_redirectsTrc   
setdefaultrA   rG   superrg   re   r*  r   s     rf   rg   z_DefaultHttpxClient.__init__  E    )_5($=>,d3"6"ri   r*  r   rm   rn   ro   rp   rq   rg   __classcell__r   s   @rf   r  r        # #ri   r  c                      e Zd ZddZy)SyncHttpxClientWrapperc                D    	 | j                          y # t        $ r Y y w xY wrb   )closer   r   s    rf   __del__zSyncHttpxClientWrapper.__del__  s"    	JJL 		s    	Nrm   rn   ro   rp   rq   r  rc   ri   rf   r  r    s    ri   r  c            	      ,    e Zd ZU ded<   dZded<   eeddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d1 fdZd2dZd3d	Z	d4d
Z
	 	 	 	 	 	 	 	 d5dZ	 	 	 	 d6dZ	 	 	 	 d7dZe	 d8	 	 	 	 	 	 	 	 	 	 	 d9d       Ze	 d8dd	 	 	 	 	 	 	 	 	 d:d       Ze	 d8ddd	 	 	 	 	 	 	 	 	 	 	 d;d       Z	 d8ddd	 	 	 	 	 	 	 	 	 	 	 d<dZ	 	 	 	 	 	 	 	 	 	 	 	 d=dZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 d>dZ	 	 	 	 	 	 	 	 	 	 	 	 d?dZ	 	 	 	 	 	 	 	 d@dZei dd	 	 	 	 	 	 	 	 	 dAd       Zei d	 	 	 	 	 	 	 	 	 	 	 dBd       Zei dd	 	 	 	 	 	 	 	 	 	 	 dCd       Zi ddd	 	 	 	 	 	 	 	 	 	 	 dCd Zedi ddd!	 	 	 	 	 	 	 	 	 	 	 	 	 dDd"       Zedi dd#	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dEd$       Zedi ddd%	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dFd&       Zdi dddd'	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dFd(Zdi d)	 	 	 	 	 	 	 	 	 dGd*Zddi d+	 	 	 	 	 	 	 	 	 	 	 dHd,Zdi d)	 	 	 	 	 	 	 	 	 dGd-Zdi d.d/	 	 	 	 	 	 	 	 	 	 	 	 	 dId0Z xZS )Jr   zhttpx.Clientr   Nztype[Stream[Any]] | Noner   r   r   r   r   r   http_clientr   r   c               ~   |)t        j                  dt        d       |t        d      t        }|)t        j                  dt        d       |t        d      |)t        j                  dt        d       |t        d      t        |      s(|r |j                  t        k7  r|j                  }nt        }|1t        |t        j                        st        d	t        |             t        | =  ||t!        t"        |      |||||
|	|

       |xs t%        |t!        t"        |      |||d      | _        y )NhThe `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead   category
stacklevelNThe `http_client` argument is mutually exclusive with `connection_pool_limits`[The `transport` argument is deprecated. The `http_client` argument should be passed insteadAThe `http_client` argument is mutually exclusive with `transport`YThe `proxies` argument is deprecated. The `http_client` argument should be passed instead?The `http_client` argument is mutually exclusive with `proxies`zOInvalid `http_client` argument; Expected an instance of `httpx.Client` but got )
r   r   r   r   r   r   r   r   r   r   Tr   r   r   r   r   r  )warningswarnDeprecationWarningr   rG   r4   r   HTTPX_DEFAULT_TIMEOUTrA   r   r   Clientr   r#  r  rg   r   r&   r  r   )re   r   r   r   r   r   r   r   r  r   r   r   r   s               rf   rg   zSyncAPIClient.__init__  s\    MMz+
 & !qrr.F MMm+
 & !deeMMk+
 & !bcc  {226KK%--)":k5<<+Pabfgrbsatu  	'*#%)(C 	 	
 # 
&<'*!'
ri   c                .    | j                   j                  S rb   r   r   r   s    rf   r   zSyncAPIClient.is_closedC      ||%%%ri   c                R    t        | d      r| j                  j                          yy)`Close the underlying HTTPX client.

        The client will *not* be usable after this.
        r   N)hasattrr   r  r   s    rf   r  zSyncAPIClient.closeF  s#     4#LL  $ri   c                    | S rb   rc   r   s    rf   	__enter__zSyncAPIClient.__enter__P  s    ri   c                $    | j                          y rb   r  re   exc_typeexcexc_tbs       rf   __exit__zSyncAPIClient.__exit__S  s     	

ri   c                     yz#Hook for mutating the given optionsNrc   re   r   s     rf   _prepare_optionszSyncAPIClient._prepare_options[  s    
 ri   c                     ya  This method is used as a callback for mutating the `Request` object
        after it has been constructed.
        This is useful for cases where you want to add certain headers based off of
        the request properties, e.g. `url`, `method` etc.
        Nrc   r<  s     rf   _prepare_requestzSyncAPIClient._prepare_requestb  s     ri   c                    y rb   rc   re   r7  r   r   r;  
stream_clss         rf   r   zSyncAPIClient.requestm       	ri   Fr;  c                    y rb   rc   )re   r7  r   r   r;  s        rf   r   zSyncAPIClient.requesty       	ri   r;  r  c                    y rb   rc   r  s         rf   r   zSyncAPIClient.request  r  ri   c               .    | j                  |||||      S N)r7  r   r;  r  r   _requestr  s         rf   r   zSyncAPIClient.request  s)     }}!/  
 	
ri   c          	        | j                  ||      }| j                  |       | j                  ||      }| j                  |      }| j	                  |       i }| j
                  | j
                  |d<   t        j                  d|j                  |j                         	  | j                  j                  |fd|xs | j                  |      i|}	t        j                  d|j                  |j                  |	j&                  |	j(                  |	j*                         t        j                  d|	j*                  j-                  d             	 |	j/                          | j?                  |||	||      S # t        j                  $ r_}
t        j                  dd       |dkD  r| j                  |||||d 	      cY d }
~
S t        j                  d
       t!        |      |
d }
~
wt"        $ r_}
t        j                  dd       |dkD  r| j                  |||||d 	      cY d }
~
S t        j                  d       t%        |      |
d }
~
ww xY w# t        j0                  $ r}
t        j                  dd       |dkD  re| j3                  |
j4                        rJ|
j4                  j7                          | j                  ||||
j4                  j*                  ||      cY d }
~
S |
j4                  j8                  s|
j4                  j;                          t        j                  d       | j=                  |
j4                        d d }
~
ww xY w)NauthzSending HTTP Request: %s %sr;  r   "Encountered httpx.TimeoutExceptionTexc_infor   r;  r  r]  Raising timeout errorEncountered ExceptionRaising connection errorzHTTP Response: %s %s "%i %s" %szrequest_id: %szx-request-id!Encountered httpx.HTTPStatusErrorr  Re-raising status errorr7  r   r   r;  r  ) r9  r  r  r,  r  rJ  rQ   r   r  r^   r   sendr=  r   TimeoutException_retry_requestrM   r   rN   r   reason_phraser  r  raise_for_statusHTTPStatusErrorrp  r   r  r   readr   _process_response)re   r7  r   r   r;  r  retriesr   r*  r   rF  s              rf   r  zSyncAPIClient._request  s    ..w@g&))*;WE%%g.g& "'!--F6N		/M#	?(t||((S!B!B7!B!S HH 			-NNKK  ""	
 			"H$4$4$8$8$HI	P%%'. %%! & 
 	
C %% 	<II:TIJ{**!)%) +   II-.!'2; 	?II-I={**!)%) +   II01$W53>	?8 $$ 	PII9DII{t11#,,?""$**LL((!) +   <<))!!#II/077E4O)	Psb   !3E6 I 6I	2G#;I"G##I/2I	!I'"I		IM$A;MM%A!MMc               ,   |dz
  }|dk(  rt         j                  d       nt         j                  d|       | j                  |||      }t         j                  d|j                  |       t        j                  |       | j                  |||||      S Nr   z1 retry leftz%i retries leftz$Retrying request to %s in %f seconds)r   r7  r   r;  r  )rQ   r   rk  r   r^   r\  sleepr  	re   r   r7  r   r]  r;  r  	remainingr   s	            rf   r  zSyncAPIClient._retry_request  s     &)	>IIn%II'3//	7DTU7gN 	

7}}'!  
 	
ri   c                  |j                   j                  j                  t              dk(  rt	        t
        t        || ||||            S t        |      xs |}t        j                  |      rft        |t              rVt        |t              st        dt         d|       t	        d|      }t	        t
         ||| t        |      |||            S |t        j                   k(  rt	        t
        |      S t        || t	        d|      |||      }t#        |j                   j                  j                  t                    rt	        t
        |      S |j%                         S )Nrm  rawr   r7  r;  r  r   !API Response types must subclass ; Received type[BaseAPIResponse[Any]]rz  )r   r  r  rE   r   r(   rP   r   rA  rB  rC  r>   r=   r   r@   r   Responser   parse	re   r7  r   r   r;  r  originresponse_clsapi_responses	            rf   r  zSyncAPIClient._process_response%  sS    ##''(;<F! #!)#
 
 G$/??6"z&/'Jfk2"CK=P[\b[c dee <gFL 1,?!)#
 
 enn$	8,,"*G4!
   ((,,-@AB	<00!!##ri   c                N     d fd}|_          j                  |d      S )Nc                0    | j                         | S )N)r   r   r   )r   )r   r   r   re   s    rf   r   z0SyncAPIClient._request_api_list.<locals>._parserd  s&    (( ) 
 Kri   Fr  )r   rR   rm   rR   )r   r   )re   r   r   r   r   s   `` ` rf   r   zSyncAPIClient._request_api_list^  s'    	 &||D'%|88ri   r   r;  c                    y rb   rc   re   pathr7  r   r;  s        rf   r  zSyncAPIClient.getp  r  ri   r   c                    y rb   rc   re   r  r7  r   r;  r  s         rf   r  zSyncAPIClient.get{  r  ri   r   r  c                    y rb   rc   r  s         rf   r  zSyncAPIClient.get  r  ri   r   r;  r  c          	     x    t        j                  dd|d|}t        t        | j	                  ||||            S Nr  )r  r^   r  rc   )r:   	constructr   r(   r   re   r  r7  r   r;  r  optss          rf   r  zSyncAPIClient.get  s?     #,,OEtOwO It||GT&U_|`aari   )r   r   r  r;  c                    y rb   rc   )re   r  r7  r   r   r  r;  s          rf   postzSyncAPIClient.post  s     	ri   )r   r   r  c                    y rb   rc   re   r  r7  r   r   r  r;  r  s           rf   r  zSyncAPIClient.post       	ri   )r   r   r  r  c                    y rb   rc   r  s           rf   r  zSyncAPIClient.post  r	  ri   )r   r   r  r;  r  c          	         t        j                  dd||t        |      d|}t        t        | j                  ||||            S Nr  r  r^   r!  r  r  rc   )r:   r  r   r   r(   r   )	re   r  r7  r   r   r  r;  r  r  s	            rf   r  zSyncAPIClient.post  sP     #,, 
tt>%;P
T[
 It||GT&U_|`aari   r   r   c               X    t        j                  dd||d|}| j                  ||      S Npatchr  r^   r!  rc   r:   r  r   re   r  r7  r   r   r  s         rf   r  zSyncAPIClient.patch  s3     #,,aGQUaY`a||GT**ri   r   r  r   c          	     l    t        j                  dd||t        |      d|}| j                  ||      S Nputr  rc   )r:   r  r   r   re   r  r7  r   r  r   r  s          rf   r  zSyncAPIClient.put  sB     #,, 
dd.:O
SZ
 ||GT**ri   c               X    t        j                  dd||d|}| j                  ||      S Ndeleter  rc   r  r  s         rf   r  zSyncAPIClient.delete  s3     #,,bH$RVbZab||GT**ri   r  r   r   r  c               Z    t        j                  d|||d|}| j                  |||      S Nr  rc   r:   r  r   re   r  r   r   r   r   r  r  s           rf   get_api_listzSyncAPIClient.get_api_list  7     #,,`FPT`X_`%%eT488ri   )r   r   r   rt  r   r   r   !float | Timeout | None | NotGivenr   zTransport | Noner   r   r   Limits | Noner  zhttpx.Client | Noner   ru  r   rv  r   r   rm   rn   r   r  re   rU   rm   rU   r  ztype[BaseException] | Noner  zBaseException | Noner  zTracebackType | Nonerm   rn   r   r:   rm   rn   r   ry  rm   rn   rb   )r7  Type[ResponseT]r   r:   r   rx  r;  Literal[True]r  zType[_StreamT]rm   rX   )
r7  r*  r   r:   r   rx  r;  Literal[False]rm   r(   )r7  r*  r   r:   r   rx  r;  r   r  zType[_StreamT] | Nonerm   ResponseT | _StreamT)r7  r*  r   r:   r   rx  r;  r   r  type[_StreamT] | Nonerm   r-  )r7  r*  r   r:   r   
int | Noner;  r   r  r.  rm   r-  )r   r:   r7  r*  r   r   r]  httpx.Headers | Noner;  r   r  r.  rm   r-  r7  r*  r   r:   r   rw  r;  r   r  z1type[Stream[Any]] | type[AsyncStream[Any]] | Nonerm   r(   )r   Type[object]r   Type[SyncPageT]r   r:   rm   rR   
r  r   r7  r*  r   r0   r;  r,  rm   r(   )r  r   r7  r*  r   r0   r;  r+  r  type[_StreamT]rm   rX   )r  r   r7  r*  r   r0   r;  r   r  r.  rm   r-  )r  r   r7  r*  r   Body | Noner   r0   r  RequestFiles | Noner;  r,  rm   r(   )r  r   r7  r*  r   r6  r   r0   r  r7  r;  r+  r  r5  rm   rX   )r  r   r7  r*  r   r6  r   r0   r  r7  r;  r   r  r.  rm   r-  
r  r   r7  r*  r   r6  r   r0   rm   r(   r  r   r7  r*  r   r6  r  r7  r   r0   rm   r(   )r  r   r   r2  r   r3  r   r6  r   r0   r  r   rm   rR   )ro   rp   rq   rs   r   rC   r!   rg   r   r  r  r  r  r  r   r   r  r  r  r   r  r  r  r  r  r"  r  r  s   @rf   r   r     s   4818 /5>&*'+ $+/3748S
 S
 	S

 S
 3S
 $S
 %S
 S
 )S
 1S
 2S
 &*S
 
S
j&!, " %	
 
$ 
		 
	 
 ,0		 	 %	 )		 	 #	 
	 	 
 ,0	 "'  % )	  
  
 ,0		 ,0	 	 %	 )		 	 *	 
	 	 ,0	
 ,0
 
 %
 )	
 
 *
 

"c
 !c
 %	c

 &c
 c
 *c
 
c
J
$
 !
 	

 /
 
 *
 

>7$ !7$ %	7$
 !7$ 7$ F7$ 
7$r99 9 %	9
 
9$  #%!& !	
    
   #%		 !		
  	 	 #	 
	 	  #%,0		 !		
  	 	 *	 
	 	  #%,0bb !	b
  b b *b 
b  !"$%)!&

 !	

 
  
 #
 
 

 
  !"$%) !	
    #  # 
   !"$%),0 !	
    #  * 
 $ !"$%),0bb !	b
 b  b #b b *b 
b* !"$	+	+ !		+
 	+  	+ 
	+  !%)"$++ !	+
 + #+  + 
+& !"$	+	+ !		+
 	+  	+ 
	+" !"$99 	9
 9 9  9 9 
9ri   r   c                        e Zd Zd fdZ xZS )_DefaultAsyncHttpxClientc                    |j                  dt               |j                  dt               |j                  dd       t        |   di | y r  r  r  s     rf   rg   z!_DefaultAsyncHttpxClient.__init__  r  ri   r  r  r  s   @rf   r;  r;    r  ri   r;  c                      e Zd ZddZy)AsyncHttpxClientWrapperc                    	 t        j                         j                  | j                                y # t        $ r Y y w xY wrb   )asyncioget_running_loopcreate_taskacloser   r   s    rf   r  zAsyncHttpxClientWrapper.__del__!  s6    	$$&224;;=A 		s   14 	A A Nr  r  rc   ri   rf   r>  r>     s    ri   r>  c            	      &    e Zd ZU ded<   dZded<   eeddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d2 fdZd3dZd4d	Z	d5d
Z
	 	 	 	 	 	 	 	 d6dZ	 	 	 	 d7dZ	 	 	 	 d8dZeddd	 	 	 	 	 	 	 	 	 d9d       Zedd	 	 	 	 	 	 	 	 	 	 	 d:d       Zeddd	 	 	 	 	 	 	 	 	 	 	 d;d       Zdddd	 	 	 	 	 	 	 	 	 	 	 d;dZ	 	 	 	 	 	 	 	 	 	 	 	 d<dZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 d=dZ	 	 	 	 	 	 	 	 	 	 	 	 d>dZ	 	 	 	 	 	 	 	 d?dZei dd	 	 	 	 	 	 	 	 	 d@d       Zei d	 	 	 	 	 	 	 	 	 	 	 dAd       Zei dd	 	 	 	 	 	 	 	 	 	 	 dBd        Zi ddd!	 	 	 	 	 	 	 	 	 	 	 dBd"Zeddi dd#	 	 	 	 	 	 	 	 	 	 	 	 	 dCd$       Zeddi d%	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dDd&       Zeddi dd'	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dEd(       Zddi ddd)	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dEd*Zdi d+	 	 	 	 	 	 	 	 	 dFd,Zddi d%	 	 	 	 	 	 	 	 	 	 	 dGd-Zdi d+	 	 	 	 	 	 	 	 	 dFd.Zdi d/d0	 	 	 	 	 	 	 	 	 	 	 	 	 dHd1Z xZS )Ir   zhttpx.AsyncClientr   Nztype[AsyncStream[Any]] | Noner   r  c               ~   |)t        j                  dt        d       |	t        d      t        }|)t        j                  dt        d       |	t        d      |)t        j                  dt        d       |	t        d      t        |      s(|	r |	j                  t        k7  r|	j                  }nt        }|	1t        |	t        j                        st        d	t        |	             t        | =  |||t!        t"        |      |||||
|

       |	xs t%        |t!        t"        |      |||d      | _        y )Nr  r  r  r  r  r  r  r  zTInvalid `http_client` argument; Expected an instance of `httpx.AsyncClient` but got )
r   r   r   r   r   r   r   r   r   r   Tr  )r  r  r  r   rG   r4   r   r  rA   r   r   AsyncClientr   r#  r  rg   r   r&   r>  r   )re   r   r   r   r   r   r   r   r   r  r   r   r   s               rf   rg   zAsyncAPIClient.__init__-  s^    MMz+
 & !qrr.F MMm+
 & !deeMMk+
 & !bcc  {226KK%--)":k5CTCT+Ufgklwgxfyz  	'*#%)(C 	 	
 # 
&='*!'
ri   c                .    | j                   j                  S rb   r  r   s    rf   r   zAsyncAPIClient.is_closed  r  ri   c                T   K   | j                   j                          d{    y7 w)r  N)r   rC  r   s    rf   r  zAsyncAPIClient.close  s     
 ll!!###s   (&(c                   K   | S wrb   rc   r   s    rf   
__aenter__zAsyncAPIClient.__aenter__  s     s   c                @   K   | j                          d {    y 7 wrb   r  r  s       rf   	__aexit__zAsyncAPIClient.__aexit__  s      jjls   c                   K   ywr  rc   r  s     rf   r  zAsyncAPIClient._prepare_options  s     
    c                   K   ywr  rc   r<  s     rf   r  zAsyncAPIClient._prepare_request  s      rN  F)r;  r   c                  K   y wrb   rc   )re   r7  r   r;  r   s        rf   r   zAsyncAPIClient.request        	rN  )r   c                  K   y wrb   rc   re   r7  r   r;  r  r   s         rf   r   zAsyncAPIClient.request        	rN  )r  r   c                  K   y wrb   rc   rS  s         rf   r   zAsyncAPIClient.request  rT  rN  )r;  r  r   c               J   K   | j                  |||||       d {   S 7 wr  r  rS  s         rf   r   zAsyncAPIClient.request  s7      ]]!/ # 
 
 	
 
s   #!#c          	       K   | j                  ||      }| j                  |       d {    | j                  ||      }| j                  |      }| j	                  |       d {    i }| j
                  | j
                  |d<   	  | j                  j                  |fd|xs | j                  |      i| d {   }	t        j                  d|j"                  |j$                  |	j&                  |	j(                         	 |	j+                          | j=                  |||	||       d {   S 7 
7 7 y# t        j                  $ rh}
t        j                  dd       |dkD  r%| j                  |||||d        d {  7  cY d }
~
S t        j                  d	       t        |      |
d }
~
wt        $ rh}
t        j                  d
d       |dkD  r%| j                  |||||d        d {  7  cY d }
~
S t        j                  d       t!        |      |
d }
~
ww xY w# t        j,                  $ r}
t        j                  dd       |dkD  rw| j/                  |
j0                        r\|
j0                  j3                          d {  7   | j                  ||||
j0                  j4                  ||       d {  7  cY d }
~
S |
j0                  j6                  s#|
j0                  j9                          d {  7   t        j                  d       | j;                  |
j0                        d d }
~
ww xY w7 w)Nr  r;  r  r  Tr  r   r  r  r  r  zHTTP Request: %s %s "%i %s"r  r  r  r  )r9  r  r  r,  r  rJ  r   r  r=  r   r  rQ   r   r  rM   r   rN   r  r^   r   r  r  r  rp  r   rC  r  r   areadr   r  )re   r7  r   r;  r  r   r  r   r*  r   rF  s              rf   r  zAsyncAPIClient._request  s#     ..w@##G,,,))*;WE%%g.##G,,, "'!--F6N#	?.T\\..S!B!B7!B!S  HH 			)7>>7;;H\H\^f^t^t	
	P%%'. ++! , 
 
 	
W 	- 	-
 %% 	<II:TIJ{!00!)%) 1     II-.!'2; 	?II-I={!00!)%) 1     II01$W53>	?, $$ 	PII9DII{t11#,,?ll))+++!00LL((!) 1     <<))ll((***II/077E4O)	P,
s  'MD3;M%D6&!M6D: >D8?D: AMH' M.M /M6M8D: :H$6F0FF0H$	M"F00H$<6H2G53H7H$8M="HH$$M'L=;AL8J3L8KL8L=	M3L8L6L88L==Mc               \  K   |dz
  }|dk(  rt         j                  d       nt         j                  d|       | j                  |||      }t         j                  d|j                  |       t        j                  |       d {    | j                  |||||       d {   S 7 "7 wr  )rQ   r   rk  r   r^   anyior  r  r  s	            rf   r  zAsyncAPIClient._retry_request:  s      &)	>IIn%II'3//	7DTU7gNkk'"""]]'! # 
 
 	
 	#
s$   BB,B(B,#B*$B,*B,c                 K   |j                   j                  j                  t              dk(  rt	        t
        t        || ||||            S t        |      xs |}t        j                  |      rbt        |t              rRt        |t              st        dt         d|       t	        d|      }t	        d ||| t        |      |||            S |t        j                   k(  rt	        t
        |      S t        || t	        d|      |||      }t#        |j                   j                  j                  t                    rt	        t
        |      S |j%                          d {   S 7 w)Nrm  r  r  r  r  r(   rz  )r   r  r  rE   r   r(   rP   r   rA  rB  rC  r>   r?   r   r@   r   r  r   r  r  s	            rf   r  z AsyncAPIClient._process_responseW  s`     ##''(;<F! #!)#
 
 G$/??6"z&/'Jf&67"CDTCUU`ag`h ijj <gFL 1,?!)#
 
 enn$	8,,'*G4!
   ((,,-@AB	<00!''))))s   E%E.'E,(E.c                     t        | |||      S )N)r   r   r   r   )r   )re   r   r   r   s       rf   r   z AsyncAPIClient._request_api_list  s     T7TQVWWri   r  c                  K   y wrb   rc   r  s        rf   r  zAsyncAPIClient.get  rQ  rN  r  c                  K   y wrb   rc   r  s         rf   r  zAsyncAPIClient.get  rT  rN  r  c                  K   y wrb   rc   r  s         rf   r  zAsyncAPIClient.get  rT  rN  r  c               x   K   t        j                  dd|d|}| j                  ||||       d {   S 7 wr  r  r  s          rf   r  zAsyncAPIClient.get  s?      #,,OEtOwO\\'4:\VVVVs   1:8:)r   r  r   r;  c                  K   y wrb   rc   )re   r  r7  r   r  r   r;  s          rf   r  zAsyncAPIClient.post  s      	rN  r  c                  K   y wrb   rc   re   r  r7  r   r  r   r;  r  s           rf   r  zAsyncAPIClient.post        	rN  )r   r  r   r  c                  K   y wrb   rc   rc  s           rf   r  zAsyncAPIClient.post  rd  rN  )r   r  r   r;  r  c          	        K   t        j                  dd||t        |       d {   d|}| j                  ||||       d {   S 7 &7 wr  r:   r  r    r   )	re   r  r7  r   r  r   r;  r  r  s	            rf   r  zAsyncAPIClient.post  s^      #,, 
ttAUV[A\;\
`g
 \\'4:\VVV <]Vs!   "AA!AAAAr  c               t   K   t        j                  dd||d|}| j                  ||       d {   S 7 wr  r  r  s         rf   r  zAsyncAPIClient.patch   s=      #,,aGQUaY`a\\'40000   /868c          	        K   t        j                  dd||t        |       d {   d|}| j                  ||       d {   S 7 #7 wr  rg  r  s          rf   r  zAsyncAPIClient.put  sX      #,, 
dd@TUZ@[:[
_f
 \\'4000 ;\0s!   "AAAA
A
Ac               t   K   t        j                  dd||d|}| j                  ||       d {   S 7 wr  r  r  s         rf   r  zAsyncAPIClient.delete  s=      #,,bH$RVbZab\\'40000ri  r  r  c               Z    t        j                  d|||d|}| j                  |||      S r  r   r!  s           rf   r"  zAsyncAPIClient.get_api_list$  r#  ri   )r   r   r   rt  r   r   r   r   r   r$  r   zAsyncTransport | Noner   r   r   r%  r  zhttpx.AsyncClient | Noner   ru  r   rv  rm   rn   r   r  r&  r'  r(  r)  )
r7  r*  r   r:   r;  r,  r   rx  rm   r(   )r7  r*  r   r:   r;  r+  r  type[_AsyncStreamT]r   rx  rm   rY   )r7  r*  r   r:   r;  r   r  type[_AsyncStreamT] | Noner   rx  rm   ResponseT | _AsyncStreamT)r7  r*  r   r:   r;  r   r  rn  r   r/  rm   ro  )r   r:   r7  r*  r   r   r]  r0  r;  r   r  rn  rm   ro  r1  )r   rw   r   r   r   r:   rm   AsyncPaginator[_T, AsyncPageT]r4  )r  r   r7  r*  r   r0   r;  r+  r  rm  rm   rY   )r  r   r7  r*  r   r0   r;  r   r  rn  rm   ro  )r  r   r7  r*  r   r6  r  r7  r   r0   r;  r,  rm   r(   )r  r   r7  r*  r   r6  r  r7  r   r0   r;  r+  r  rm  rm   rY   )r  r   r7  r*  r   r6  r  r7  r   r0   r;  r   r  rn  rm   ro  r8  r9  )r  r   r   rw   r   r   r   r6  r   r0   r  r   rm   rp  )ro   rp   rq   rs   r   rC   r!   rg   r   r  rJ  rL  r  r  r   r   r  r  r  r   r  r  r  r  r  r"  r  r  s   @rf   r   r   )  sr   9=6= /5>+/'+ $043748S
 S
 	S

 &*S
 S
 3S
 )S
 %S
 S
 .S
 1S
 2S
 
S
j&$, " %	
 
$ 
		 
	  "'+/  %
  ) 
   ,0	 	 %	
 	 (	 )	 
	 	  26+/	 	 %	
 	 /	 )	 
#	 	  15+/
 
 %

 
 /
 )
 
#
"[
 [
 %[

 [
 /[
 &[
 
#[
z
$
 !
 	

 /
 
 /
 
#
:7* !7* %	7*
 !7* 7* F7* 
7*rXX X %	X
 
(X  #%!& !	
    
   #%		 !		
  	 	 (	 
	 	  #%15		 !		
  	 	 /	 
#	 	  #%15
W
W !	
W
  
W 
W /
W 
#
W  !%)"$!&

 !	

 
 #
  
 
 

 
  !%)"$ !	
  #    ( 
   !%)"$15 !	
  #    / 
# $ !%)"$15WW !	W
 W #W  W W /W 
#W* !"$	1	1 !		1
 	1  	1 
	1  !%)"$11 !	1
 1 #1  1 
1& !"$	1	1 !		1
 	1  	1 
	1" !"$99 	9
 9 9  9 9 
(9ri   r   )queryextra_headersextra_query
extra_bodyr
  r   r   c                    i }|||d<   |t        t        |      |d<   | | |d<   |i |j                  di       ||d<   t        |t              s||d<   |||d<   t        |      r||d<   |S )zECreate a dict of type RequestOptions without keys of NotGiven values.r  r"  r`   r   r
  r   )r   r*   r  r   r'   r4   )rq  rr  rs  rt  r
  r   r   r   s           rf   make_request_optionsrv  2  s     !G *	 $Z <!Hw{{8R8HKHgx($	"%4!"!,Nri   c                  &    e Zd ZddZedd       Zy)OtherPlatformc                    || _         y rb   namere   r{  s     rf   rg   zOtherPlatform.__init__X  	    	ri   c                     d| j                    S )NzOther:rz  r   s    rf   __str__zOtherPlatform.__str__[      		{##ri   Nr{  r   rm   rn   r{  ro   rp   rq   rg   r   r  rc   ri   rf   rx  rx  W       $ $ri   rx  )MacOSLinuxWindowsFreeBSDOpenBSDiOSAndroidUnknownc                 F   	 t        j                         j                         } t        j                          j                         }d|v sd|v ry| dk(  ry| dk(  ryd	|v ry
| dk(  r!t	        j
                         }|dk(  ry|dk(  ryy|rt        |      S y# t        $ r Y yw xY w)Nr  iphoneipadr  darwinr  windowsr  androidr  linuxfreebsdr  openbsdr  r  )platformsystemr	  r   distroidrx  )r  platform_name	distro_ids      rf   get_platformr  o  s    "((* ))+113 = Fm$;
 M! IIK		!	!]++G  s   AB 	B B )maxsizec                x    d| t        t                     t        t                     t               t	               dS )Npython)zX-Stainless-LangzX-Stainless-Package-VersionzX-Stainless-OSzX-Stainless-ArchzX-Stainless-RuntimezX-Stainless-Runtime-Version)r   r  get_architectureget_python_runtimeget_python_version)r   s    rf   rP  rP    s6     %'.ln- 0 2313'9'; ri   c                  &    e Zd ZddZedd       Zy)	OtherArchc                    || _         y rb   rz  r|  s     rf   rg   zOtherArch.__init__  r}  ri   c                     d| j                    S )Nzother:rz  r   s    rf   r  zOtherArch.__str__  r  ri   Nr  r{  r  rc   ri   rf   r  r    r  ri   r  )x32x64armarm64unknownc                 J    	 t        j                         S # t        $ r Y yw xY wNr  )r  python_implementationr   rc   ri   rf   r  r    s(    --//     	""c                 J    	 t        j                         S # t        $ r Y yw xY wr  )r  python_versionr   rc   ri   rf   r  r    s(    &&(( r  c                     	 t        j                         \  } }t        j                         j                         }|dv ry|dk(  ry|dk(  ry| dk(  ry|rt        |      S y# t        $ r Y yw xY w)	Nr  )r  aarch64r  r  x86_64r  32bitr  )r  architecturemachiner	  r   r  )python_bitness_r  s      rf   r  r    s    $113""$**, && %(  !!)  s   9A   	A,+A,c                    i | |}|j                         D ci c]  \  }}t        |t              r|| c}}S c c}}w )zMerge two mappings of the same type, removing any values that are instances of `Omit`.

    In cases with duplicate keys the second mapping takes precedence.
    )r|   r   r#   )obj1obj2mergedr3  r4  s        rf   r  r    s?     F)/W:3z%QU?VCJWWWs   <<)rq  Query | Nonerr  zHeaders | Noners  r  rt  r6  r
  r   r   z'float | httpx.Timeout | None | NotGivenr   zPostParser | NotGivenrm   r0   )rm   Platform)r   r   rm   r|  r{  )rm   Arch)r  Mapping[_T_co, Union[_T, Omit]]r  r  rm   zDict[_T_co, _T])
__future__r   r   r\  rr  rX  r@  rA  r  r  r  email.utilstypesr   r   typingr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   typing_extensionsr   r   r   rZ  r   r  r   r   r   r    r   _qsr   _filesr   r    _typesr!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   _utilsr2   r3   r4   r5   r6   _compatr7   r8   _modelsr9   r:   r;   r<   	_responser=   r>   r?   r@   
_constantsrA   rB   rC   rD   rE   rF   rG   
_streamingrH   rI   rJ   rK   rL   rM   rN   rO   _legacy_responserP   	getLoggerro   rQ   rs   rR   rT   rU   rV   rX   rY   httpx._configrZ   r  ImportErrorr\   ru   r   r   r   r  rF  r   r   r   r  DefaultHttpxClientr  r   r;  DefaultAsyncHttpxClientr>  r   rv  rx  r  r  rP  r  r  r  r  r  r  rc   ri   rf   <module>r     s   "                " < ;          8    & F E + U U    I H  0'g''1^ 1 K':;	\)=>
 T]4(:VC[1{3/?@M-Q   F.6|WR[ .6b+a8B< +a\$WR^, $N#gHRL'"+ #gL uU\\5CTCT5T/UV+5kRUFV9V3WXG878 G8T#%,, #  -/ _9Ju||VC[89 _9D#u00 # #// 75 F9Z 1 1;s3C CD F9V $( $""&7@)2"" "" 	"
 "  " 5" '" "J$ $ 		
'T 4 $ $ Y GHHI6	X
)	X
)	X 	X];  - '-s   ?L% %L65L6