
    j)"                         d dl mZ d dl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TYPE_CHECKINGUnion)Self)PipelineClient)AzureKeyCredential)policies)HttpRequestHttpResponse   )5DocumentIntelligenceAdministrationClientConfiguration'DocumentIntelligenceClientConfiguration)7DocumentIntelligenceAdministrationClientOperationsMixin)DocumentIntelligenceClientOperationsMixin)Deserializer
Serializer)TokenCredentialc            	       t    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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.TokenCredential
    :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         f/root/aria/tools/markitdown-venv/lib/python3.12/site-packages/azure/ai/documentintelligence/_client.py__init__z#DocumentIntelligenceClient.__init__0   s=   5	>r]grkqrJJz40	((262++..)),,6v6,,))22//++11;F;CG<<C_C_55??ei00I (6'gyS\'g`f'g$,(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 a&  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 = client.send_request(request)
        <HttpResponse: 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.HttpResponse
        r   zself._config.endpointstrT)
skip_quoter:   r   r/   urlr   r   r.   
format_urlsend_requestr3   r;   r:   r   request_copypath_format_argumentss         r6   rC   z'DocumentIntelligenceClient.send_requestJ       $  (++,CT\\EZEZ\anr+s!
 34<<22<3C3C]G\](t||((OfOOOr8   c                 8    | j                   j                          y Nr.   closer3   s    r6   rK   z DocumentIntelligenceClient.closed       r8   c                 :    | j                   j                          | S rI   r.   	__enter__rL   s    r6   rP   z$DocumentIntelligenceClient.__enter__g        r8   exc_detailsc                 6     | j                   j                  |  y rI   r.   __exit__r3   rR   s     r6   rU   z#DocumentIntelligenceClient.__exit__k       {+r8   r   N__name__
__module____qualname____doc__r>   r   r	   r   r7   r   boolr   rC   rK   r   rP   rU   r   r8   r6   r   r       s    7 7%8JL]8]2^ 7jm 7rv 74 DI PK PD PTW P\h P44 ,S ,T ,r8   r   c            	       t    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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.TokenCredential
    :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   r.   r   r/   r   r0   r1   r2   s         r6   r7   z1DocumentIntelligenceAdministrationClient.__init__   sE   5	L 
*
8>
 JJz40	((262++..)),,6v6,,))22//++11;F;CG<<C_C_55??ei00I (6'gyS\'g`f'g$,(N16.r8   Fr9   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=   r@   rD   s         r6   rC   z5DocumentIntelligenceAdministrationClient.send_request   rG   r8   c                 8    | j                   j                          y rI   rJ   rL   s    r6   rK   z.DocumentIntelligenceAdministrationClient.close   rM   r8   c                 :    | j                   j                          | S rI   rO   rL   s    r6   rP   z2DocumentIntelligenceAdministrationClient.__enter__   rQ   r8   rR   c                 6     | j                   j                  |  y rI   rT   rV   s     r6   rU   z1DocumentIntelligenceAdministrationClient.__exit__   rW   r8   rX   rY   r   r8   r6   r`   r`   o   s    7 7%8JL]8]2^ 7jm 7rv 78 DI PK PD PTW P\h P44 ,S ,T ,r8   r`   N)copyr   typingr   r   r   typing_extensionsr   
azure.corer   azure.core.credentialsr	   azure.core.pipeliner
   azure.core.restr   r   _configurationr   r   _operationsr   r   _serializationr   r   r   r   r`   r   r8   r6   <module>rp      sS     , , " % 5 ( 5 56L,!J L,^N,/f N,r8   