
    j>                         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 d
dlmZ erd dlmZ  G d de      Zy)    )deepcopy)Any	AwaitableTYPE_CHECKINGUnion)Self)AsyncPipelineClient)AzureKeyCredential)policies)AsyncHttpResponseHttpRequest   )Deserializer
Serializer   )'ContentUnderstandingClientConfiguration)*_ContentUnderstandingClientOperationsMixin)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)ContentUnderstandingClienta   ContentUnderstandingClient.

    :param endpoint: Content Understanding service endpoint. Required.
    :type endpoint: str
    :param credential: Credential used to authenticate requests to the service. Is either a key
     credential type or a token credential 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. Known values are "2025-11-01"
     and None. Default value is "2025-11-01". 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}/contentunderstanding)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/contentunderstanding/aio/_client.py__init__z#ContentUnderstandingClient.__init__+   sU    6	> 
*
8>
 JJz40	((262++..)),,6v6,,))22//++11;F; ||33 99CFC00#I& -@ -
-
6<-
 %,(N16.    F)streamrequestr7   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_quoter7   )r   r.   urlr   r   r-   
format_urlsend_request)r1   r8   r7   r   request_copypath_format_argumentss         r4   r>   z'ContentUnderstandingClient.send_requestS   s    (  (++')>)>RV , !
 34<<22
 5
 )t||((OfOOOr6   c                 T   K   | j                   j                          d {    y 7 wN)r-   closer1   s    r4   rC   z ContentUnderstandingClient.closes   s     ll  """s   (&(c                 V   K   | j                   j                          d {    | S 7 wrB   )r-   
__aenter__rD   s    r4   rF   z%ContentUnderstandingClient.__aenter__v   s&     ll%%''' 	(s   )')exc_detailsc                 R   K    | j                   j                  |  d {    y 7 wrB   )r-   	__aexit__)r1   rG   s     r4   rI   z$ContentUnderstandingClient.__aexit__z   s      $dll$$k222s   '%')r   N)__name__
__module____qualname____doc__r:   r   r
   r   r5   r   boolr   r   r>   rC   r   rF   rI   r   r6   r4   r   r      s     &7&7 ,.DDE&7 	&7
 
&7R 7<P"P/3PGJP	$	%P@#$ 3C 3D 3r6   r   N)copyr   typingr   r   r   r   typing_extensionsr   
azure.corer	   azure.core.credentialsr
   azure.core.pipeliner   azure.core.restr   r   _utils.serializationr   r   _configurationr   _operationsr   azure.core.credentials_asyncr   r   r   r6   r4   <module>rZ      s=     7 7 " * 5 ( : ; C CAa3!K a3r6   