
    jF#                         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
 d dlmZ d dlmZ d dlmZmZ dd	lmZmZ d
dlmZmZ d
dlmZmZ erd dlmZ  G d de      Z G d de      Zy)    )deepcopy)Any	AwaitableTYPE_CHECKINGUnion)Self)AsyncPipelineClient)AzureKeyCredential)policies)AsyncHttpResponseHttpRequest   )Deserializer
Serializer   )5DocumentIntelligenceAdministrationClientConfiguration'DocumentIntelligenceClientConfiguration)7DocumentIntelligenceAdministrationClientOperationsMixin)DocumentIntelligenceClientOperationsMixin)AsyncTokenCredentialc            
       z    e Zd ZdZdedeedf   deddfdZd	d
de	de
dedee   fdZddZdefdZdeddfdZy)DocumentIntelligenceClienta  DocumentIntelligenceClient.

    :param endpoint: The Document Intelligence service endpoint. Required.
    :type endpoint: str
    :param credential: Credential used to authenticate requests to the service. Is either a
     AzureKeyCredential type or a TokenCredential type. Required.
    :type credential: ~azure.core.credentials.AzureKeyCredential or
     ~azure.core.credentials_async.AsyncTokenCredential
    :keyword api_version: The API version to use for this operation. Default value is "2024-11-30".
     Note that overriding this default value may result in unsupported behavior.
    :paramtype api_version: str
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
     Retry-After header is present.
    endpoint
credentialr   kwargsreturnNc                 *   d}t        d||d|| _        |j                  dd       }|'t        j                  di || j                  j
                  | j                  j                  | j                  j                  t        j                  di || j                  j                  | j                  j                  | j                  j                  | j                  j                  | j                  j                  t        j                  di || j                  j                  rt        j                  di |nd | j                  j                   g}t#        d||d|| _        t'               | _        t+               | _        d| j(                  _        y Nz{endpoint}/documentintelligence)r   r   r   )base_urlr   F )r   _configpopr   RequestIdPolicyheaders_policyuser_agent_policyproxy_policyContentDecodePolicyredirect_policyretry_policyauthentication_policycustom_hook_policylogging_policyDistributedTracingPolicySensitiveHeaderCleanupPolicyhttp_logging_policyr	   _clientr   
_serializer   _deserializeclient_side_validationselfr   r   r   	_endpoint	_policiess         j/root/aria/tools/markitdown-venv/lib/python3.12/site-packages/azure/ai/documentintelligence/aio/_client.py__init__z#DocumentIntelligenceClient.__init__0   s@    6	>r]grkqrJJz40	((262++..)),,6v6,,))22//++11;F;CG<<C_C_55??ei00I -@,q]f,qjp,q$,(N16.    Fstreamrequestr<   c                   t        |      }d| j                  j                  d| j                  j                  dd      i} | j
                  j                  |j                  fi ||_         | j
                  j                  |fd|i|S a6  Runs the network request through the client's chained policies.

        >>> from azure.core.rest import HttpRequest
        >>> request = HttpRequest("GET", "https://www.example.org/")
        <HttpRequest [GET], url: 'https://www.example.org/'>
        >>> response = await client.send_request(request)
        <AsyncHttpResponse: 200 OK>

        For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request

        :param request: The network request you want to make. Required.
        :type request: ~azure.core.rest.HttpRequest
        :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
        :return: The response of your network call. Does not do error handling on your response.
        :rtype: ~azure.core.rest.AsyncHttpResponse
        r   zself._config.endpointstrT)
skip_quoter<   r   r1   urlr!   r   r0   
format_urlsend_requestr5   r=   r<   r   request_copypath_format_argumentss         r8   rE   z'DocumentIntelligenceClient.send_requestL       (  (++,CT\\EZEZ\anr+s!
 34<<22<3C3C]G\](t||((OfOOOr:   c                 T   K   | j                   j                          d {    y 7 wNr0   closer5   s    r8   rM   z DocumentIntelligenceClient.closeh        ll  """   (&(c                 V   K   | j                   j                          d {    | S 7 wrK   r0   
__aenter__rN   s    r8   rS   z%DocumentIntelligenceClient.__aenter__k   &     ll%%''' 	(   )')exc_detailsc                 R   K    | j                   j                  |  d {    y 7 wrK   r0   	__aexit__r5   rV   s     r8   rY   z$DocumentIntelligenceClient.__aexit__o         $dll$$k222   '%'r   N__name__
__module____qualname____doc__r@   r   r
   r   r9   r   boolr   r   rE   rM   r   rS   rY   r    r:   r8   r   r       s    77)./ACY/Y)Z7fi7	7: 7<P"P/3PGJP	$	%P8#$ 3C 3D 3r:   r   c            
       z    e Zd ZdZdedeedf   deddfdZd	d
de	de
dedee   fdZddZdefdZdeddfdZy)(DocumentIntelligenceAdministrationClienta  DocumentIntelligenceAdministrationClient.

    :param endpoint: The Document Intelligence service endpoint. Required.
    :type endpoint: str
    :param credential: Credential used to authenticate requests to the service. Is either a
     AzureKeyCredential type or a TokenCredential type. Required.
    :type credential: ~azure.core.credentials.AzureKeyCredential or
     ~azure.core.credentials_async.AsyncTokenCredential
    :keyword api_version: The API version to use for this operation. Default value is "2024-11-30".
     Note that overriding this default value may result in unsupported behavior.
    :paramtype api_version: str
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
     Retry-After header is present.
    r   r   r   r   r   Nc                 *   d}t        d||d|| _        |j                  dd       }|'t        j                  di || j                  j
                  | j                  j                  | j                  j                  t        j                  di || j                  j                  | j                  j                  | j                  j                  | j                  j                  | j                  j                  t        j                  di || j                  j                  rt        j                  di |nd | j                  j                   g}t#        d||d|| _        t'               | _        t+               | _        d| j(                  _        y r   )r   r!   r"   r   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r	   r0   r   r1   r   r2   r3   r4   s         r8   r9   z1DocumentIntelligenceAdministrationClient.__init__   sH    6	L 
*
8>
 JJz40	((262++..)),,6v6,,))22//++11;F;CG<<C_C_55??ei00I -@,q]f,qjp,q$,(N16.r:   Fr;   r=   r<   c                   t        |      }d| j                  j                  d| j                  j                  dd      i} | j
                  j                  |j                  fi ||_         | j
                  j                  |fd|i|S r?   rB   rF   s         r8   rE   z5DocumentIntelligenceAdministrationClient.send_request   rI   r:   c                 T   K   | j                   j                          d {    y 7 wrK   rL   rN   s    r8   rM   z.DocumentIntelligenceAdministrationClient.close   rO   rP   c                 V   K   | j                   j                          d {    | S 7 wrK   rR   rN   s    r8   rS   z3DocumentIntelligenceAdministrationClient.__aenter__   rT   rU   rV   c                 R   K    | j                   j                  |  d {    y 7 wrK   rX   rZ   s     r8   rY   z2DocumentIntelligenceAdministrationClient.__aexit__   r[   r\   r]   r^   r    r:   r8   re   re   s   s    77)./ACY/Y)Z7fi7	7> 7<P"P/3PGJP	$	%P8#$ 3C 3D 3r:   re   N)copyr   typingr   r   r   r   typing_extensionsr   
azure.corer	   azure.core.credentialsr
   azure.core.pipeliner   azure.core.restr   r   _serializationr   r   _configurationr   r   _operationsr   r   azure.core.credentials_asyncr   r   re   r    r:   r8   <module>rv      sS     7 7 " * 5 ( : 5
 AP3!J P3fR3/f R3r:   