
    :Qg                     |    d Z ddlZddlmZ ddlmZmZmZm	Z	 ddl
mZ ddlmZmZmZmZ ddlmZmZ  G d	 d
      Zy)zACode generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.    N   )SDKConfiguration)AnyDictListOptional)utils)AfterErrorContextAfterSuccessContextBeforeRequestContextHookContext)errors
operationsc                       e Zd ZU eed<   deddfdZd	dej                  dee	j                     dej                  fdZy)
Generalsdk_configuration
sdk_configreturnNc                     || _         y N)r   )selfr   s     X/var/www/html/answerous/venv/lib/python3.12/site-packages/unstructured_client/general.py__init__zGeneral.__init__   s
    !+    requestretriesc           	      
    t        dg  j                  j                        t        j                   j                  j                          }|dz   t         j                  j                        r1t        j                   j                  j                               \  n,t        j                   j                  j                        \  i t        j                  |      t        j                  |t        j                  dddd      \  }|	|dvr|d	<   t        d
      dd<    j                  j                  d<    j                  j                   j                  j                  }|}|2|r|}n-t        j                   dt        j"                  dddd      d      }d f	d}t        j$                  |t        j&                  |g d            }t        j(                  |j*                  |j,                  j/                  d      xs d|      }	|j*                  dk(  rt        j0                  |j,                  j/                  d      xs dd      rHt        j2                  |j4                  t6        t8        t:        t<        t>        f               }
|
|	_         |	S |j,                  j/                  d      }tC        jD                  d| |j*                  |j4                  |      |j*                  dk(  rt        j0                  |j,                  j/                  d      xs dd      r0t        j2                  |j4                  tB        jF                        }
|
|j,                  j/                  d      }tC        jD                  d| |j*                  |j4                  |      |j*                  dk\  r;|j*                  dk  r,tC        jD                  d|j*                  |j4                  |      |j*                  dk\  r|j*                  dk  rt        j0                  |j,                  j/                  d      xs dd      r0t        j2                  |j4                  tB        jH                        }
|
|j,                  j/                  d      }tC        jD                  d| |j*                  |j4                  |      tC        jD                  d |j*                  |j4                  |      )!z$Summary
        Description
        	partition)operation_idoauth2_scopessecurity_sourcez/general/v0/generalpartition_parametersF	multipartN)zmultipart/form-datazmultipart/mixedzcontent-typezrequest body is requiredzapplication/jsonAcceptz
user-agentbackoffi  i
 gGz?i@w Tc            
        	 	 j                  t        j                  d
            j                  j	                         j                  t        	            j                        } t        j                  g d| j                        rYj                  j	                         j                  t        	      | d       \  }}||||} | S t        j                  dddd       j                  j	                         j!                  t#        	      |       } | S # t        $ rC}j                  j	                         j                  t        	      d |      \  }}||||d }~ww xY w)NPOST)paramsdatafilesheaders)4224XX5XXzUnexpected error occurred )prepare_requestrequests_httpRequestr   	get_hooksbefore_requestr   send	Exceptionafter_errorr
   r	   match_status_codesstatus_coder   SDKErrorafter_successr   )http_rese_errresultclientr)   formr+   hook_ctxquery_paramsreqr   urls        r   
do_requestz%General.partition.<locals>.do_request3   sq   ,,]-B-B63Wcjnvz  EL  .M  N,,668GGH\]eHfhkl!;;s+ ''(;X=Q=QR 22<<>JJK\]eKfhprvw	=G%%H O	 !//*Er2tTT11;;=KKL_`hLikstO#  //99;GGHYZbHceiklm3?1$	s   A.D! !	E-*>E((E-)502503504zContent-Typer0   )r:   content_typeraw_response   zunknown content-type received: i  i  i  zAPI error occurrediX  zunknown status code received)%r   r   securityr	   template_urlget_server_detailscallableget_securityget_headersserialize_request_bodyr   PartitionRequestr7   
user_agentrB   retry_configRetryConfigBackoffStrategyretryRetriesPartitionResponser:   r+   getmatch_content_typeunmarshal_jsontextr   r   r   strr   elementsr   r;   HTTPValidationErrorServerError)r   r   r   base_urlreq_content_typeglobal_retry_configrX   rH   r=   resoutrL   rB   r)   rC   r+   rD   rE   rF   rG   s   `           @@@@@@@@r   r   zGeneral.partition   s    Kr[_[q[q[z[z{%%t'='='P'P'RS..D**334$)$6$6t7M7M7V7V7X$Y!G\$)$6$6t7M7M7V7V$W!G\=e''0=G=','C'CGZMhMh  kA  CH  JO  Q\  (]$$',<Dn,n&6GN#<DL677. $ 6 6 A A''.."44AA"2$00E<Q<QRVX^`dfm<nptu	 	2 ;;z5== H
 ,  **x7K7KZbZjZjZnZno}Z~  [E  CE  T\  ]3&''(8(8(<(<^(L(RPRTfg**8==(4SRUXCW:XY"2 
/  (//33NCoo(G~&VX`XlXlnvn{n{  ~F  G  G!!S(''(8(8(<(<^(L(RPRTfg**8==&:T:TU	'//33NCoo(G~&VX`XlXlnvn{n{  ~F  G  G!!S(X-A-AC-G//"68L8Lhmm]eff!!S(X-A-AC-G''(8(8(<(<^(L(RPRTfg**8==&:L:LM	'//33NCoo(G~&VX`XlXlnvn{n{  ~F  G  G//"@(BVBVX`XeXegoppr   r   )__name__
__module____qualname__r   __annotations__r   r   rV   r   r	   rY   r]   r    r   r   r   r   
   s[    '',#3 , ,
`!<!< `xPUPaPaGb `nx  oK  oK `r   r   )__doc__requestsr2   sdkconfigurationr   typingr   r   r   r   unstructured_clientr	   unstructured_client._hooksr
   r   r   r   unstructured_client.modelsr   r   r   ro   r   r   <module>rw      s,    G   . , , % p p 9h hr   