
    j;                         U d Z ddlmZmZ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 erdd	lmZ dd
lmZ eeef   Z e       Zeed<   dgZ G d de      Zd Zy)z{Customize generated code here.

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
    )TYPE_CHECKINGAnyIOOptionalUnionoverload)distributed_trace_async   )ContentUnderstandingClient   )models)AnalyzeAsyncLROPoller)AzureKeyCredential)AsyncTokenCredential_Unsetr   c                   |    e Zd ZdZdeded   deddf fdZeddd	d
ede	e
j                     deeeef      deeee
j                  f      deddfd       Zedddd
ededeeee
j                  f      dededdfd       Zedddd
edee   deeee
j                  f      dededdfd       Zeefeddddd
edeeee   f   de	e
j                     deeeef      deeee
j                  f      dee   deddf fd       Zeddddd
ededee   dedeeee
j                  f      deddf fd       Z xZS )r   aP  Custom async ContentUnderstandingClient with static patches for analyze operations.

    This wrapper:
    - Hides the string_encoding parameter (always uses "codePoint" for Python)
    - Returns AnalyzeAsyncLROPoller with .operation_id property
    - Fixes content_type default for begin_analyze_binary
    - Defaults polling_interval to 3 seconds

    :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. 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. Default value is 3 seconds.
    endpoint
credential)r   r   kwargsreturnNc                 N    |j                  dd       t        |   d||d| y )Npolling_interval   )r   r    )
setdefaultsuper__init__)selfr   r   r   	__class__s       i/root/aria/tools/markitdown-venv/lib/python3.12/site-packages/azure/ai/contentunderstanding/aio/_patch.pyr   z#ContentUnderstandingClient.__init__3   s-     	,a0L(zLVL    )model_deploymentsprocessing_locationanalyzer_idinputsr"   r#   z-AnalyzeAsyncLROPoller[_models.AnalysisResult]c                   K   yw)aT  Extract content and fields from input.

        :param analyzer_id: The unique identifier of the analyzer. Required.
        :type analyzer_id: str
        :keyword inputs: Inputs to analyze. Currently, only pro mode supports multiple inputs.
         Required.
        :paramtype inputs: list[~azure.ai.contentunderstanding.models.AnalysisInput]
        :keyword model_deployments: Override default mapping of model names to deployments.
         Ex. { "gpt-4.1": "myGpt41Deployment", "text-embedding-3-large":
         "myTextEmbedding3LargeDeployment" }. Default value is None.
        :paramtype model_deployments: dict[str, str]
        :keyword processing_location: The location where the data may be processed. Defaults to
         global. Known values are: "geography", "dataZone", and "global". Default value is None.
        :paramtype processing_location: str or ~azure.ai.contentunderstanding.models.ProcessingLocation
        :return: An instance of AnalyzeAsyncLROPoller that returns AnalysisResult. The AnalysisResult is
         compatible with MutableMapping. The poller includes an .operation_id property.
        :rtype: ~azure.ai.contentunderstanding.aio.models.AnalyzeAsyncLROPoller[~azure.ai.contentunderstanding.models.AnalysisResult]
        :raises ~azure.core.exceptions.HttpResponseError:

        .. note::
           The string_encoding parameter is automatically set to "codePoint" for Python as it
           matches Python's native string indexing behavior (len() and str[i] use code points).
           This ensures ContentSpan offsets work correctly with Python string slicing.
        Nr   )r   r$   r%   r"   r#   r   s         r    begin_analyzez(ContentUnderstandingClient.begin_analyze=           application/json)r#   content_typebodyr+   c                   K   yw)af  Extract content and fields from input.

        :param analyzer_id: The unique identifier of the analyzer. Required.
        :type analyzer_id: str
        :param body: JSON body. Required.
        :type body: JSON
        :keyword processing_location: The location where the data may be processed. Defaults to
         global. Known values are: "geography", "dataZone", and "global". Default value is None.
        :paramtype processing_location: str or ~azure.ai.contentunderstanding.models.ProcessingLocation
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: An instance of AnalyzeAsyncLROPoller that returns AnalysisResult. The AnalysisResult is
         compatible with MutableMapping. The poller includes an .operation_id property.
        :rtype: ~azure.ai.contentunderstanding.aio.models.AnalyzeAsyncLROPoller[~azure.ai.contentunderstanding.models.AnalysisResult]
        :raises ~azure.core.exceptions.HttpResponseError:

        .. note::
           The string_encoding parameter is automatically set to "codePoint" for Python as it
           matches Python's native string indexing behavior (len() and str[i] use code points).
           This ensures ContentSpan offsets work correctly with Python string slicing.
        Nr   r   r$   r,   r#   r+   r   s         r    r'   z(ContentUnderstandingClient.begin_analyze`   r(   r)   c                   K   yw)av  Extract content and fields from input.

        :param analyzer_id: The unique identifier of the analyzer. Required.
        :type analyzer_id: str
        :param body: Binary stream body. Required.
        :type body: IO[bytes]
        :keyword processing_location: The location where the data may be processed. Defaults to
         global. Known values are: "geography", "dataZone", and "global". Default value is None.
        :paramtype processing_location: str or ~azure.ai.contentunderstanding.models.ProcessingLocation
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: An instance of AnalyzeAsyncLROPoller that returns AnalysisResult. The AnalysisResult is
         compatible with MutableMapping. The poller includes an .operation_id property.
        :rtype: ~azure.ai.contentunderstanding.aio.models.AnalyzeAsyncLROPoller[~azure.ai.contentunderstanding.models.AnalysisResult]
        :raises ~azure.core.exceptions.HttpResponseError:

        .. note::
           The string_encoding parameter is automatically set to "codePoint" for Python as it
           matches Python's native string indexing behavior (len() and str[i] use code points).
           This ensures ContentSpan offsets work correctly with Python string slicing.
        Nr   r.   s         r    r'   z(ContentUnderstandingClient.begin_analyze   r(   r)   )r%   r"   r#   r+   c          
         K   d|d<   ||nd}|t         urt        
|   d||||||d| d{   }	nt        
|   d|||||d| d{   }	t        j                  |	      S 7 77 w)aW  Extract content and fields from input.

        :param analyzer_id: The unique identifier of the analyzer. Required.
        :type analyzer_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Default value is None.
        :type body: JSON or IO[bytes]
        :keyword inputs: Inputs to analyze. Currently, only pro mode supports multiple inputs.
         Required.
        :paramtype inputs: list[~azure.ai.contentunderstanding.models.AnalysisInput]
        :keyword model_deployments: Override default mapping of model names to deployments.
         Ex. { "gpt-4.1": "myGpt41Deployment", "text-embedding-3-large":
         "myTextEmbedding3LargeDeployment" }. Default value is None.
        :paramtype model_deployments: dict[str, str]
        :keyword processing_location: The location where the data may be processed. Defaults to
         global. Known values are: "geography", "dataZone", and "global". Default value is None.
        :paramtype processing_location: str or ~azure.ai.contentunderstanding.models.ProcessingLocation
        :keyword content_type: Body Parameter content-type. Default value is "application/json".
        :paramtype content_type: str
        :return: An instance of AnalyzeAsyncLROPoller that returns AnalysisResult. The AnalysisResult is
         compatible with MutableMapping. The poller includes an .operation_id property.
        :rtype: ~azure.ai.contentunderstanding.aio.models.AnalyzeAsyncLROPoller[~azure.ai.contentunderstanding.models.AnalysisResult]
        :raises ~azure.core.exceptions.HttpResponseError:

        .. note::
           The string_encoding parameter is automatically set to "codePoint" for Python as it
           matches Python's native string indexing behavior (len() and str[i] use code points).
           This ensures ContentSpan offsets work correctly with Python string slicing.
        	codePointstring_encodingNr*   )r$   r,   r#   r+   r%   r"   )r$   r#   r+   r%   r"   r   )r   r   r'   r   from_poller)r   r$   r,   r%   r"   r#   r+   r   content_type_strpollerr   s             r    r'   z(ContentUnderstandingClient.begin_analyze   s     R %0 ! )4L:L 	 v 70 '$7-"3  F !70 '$7-"3  F %0088)s!   -A,A(A,A*A,*A,zapplication/octet-stream)content_ranger+   r#   binary_inputr6   c          
      v   K   t        |   d||d|||d| d{   }t        j                  |      S 7 w)a  Extract content and fields from input.

        :param analyzer_id: The unique identifier of the analyzer. Required.
        :type analyzer_id: str
        :param binary_input: The binary content of the document to analyze. Required.
        :type binary_input: bytes
        :keyword content_range: Range of the input to analyze (ex. ``1-3,5,9-``). Document content uses
         1-based page numbers, while audio visual content uses integer milliseconds. Default value is None.
        :paramtype content_range: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/octet-stream".
        :paramtype content_type: str
        :keyword processing_location: The location where the data may be processed. Defaults to
         global. Known values are: "geography", "dataZone", and "global". Default value is None.
        :paramtype processing_location: str or ~azure.ai.contentunderstanding.models.ProcessingLocation
        :return: An instance of AnalyzeAsyncLROPoller that returns AnalysisResult. The AnalysisResult is
         compatible with MutableMapping. The poller includes an .operation_id property.
        :rtype: ~azure.ai.contentunderstanding.aio.models.AnalyzeAsyncLROPoller[~azure.ai.contentunderstanding.models.AnalysisResult]
        :raises ~azure.core.exceptions.HttpResponseError:

        .. note::
           The string_encoding parameter is automatically set to "codePoint" for Python as it
           matches Python's native string indexing behavior (len() and str[i] use code points).
           This ensures ContentSpan offsets work correctly with Python string slicing.
        r1   )r$   r7   r2   r6   r+   r#   Nr   )r   begin_analyze_binaryr   r3   )	r   r$   r7   r6   r+   r#   r   r5   r   s	           r    r9   z/ContentUnderstandingClient.begin_analyze_binary   sW     L w3 
#%''% 3
 
 
 %0088
s   979)__name__
__module____qualname____doc__strr   r   r   r   list_modelsAnalysisInputr   dictProcessingLocationr'   JSONr   bytesr	   r   r9   __classcell__)r   s   @r    r   r      s   *MM FGM 	M
 
M  7;PT   W**+	 
 $DcN3  &eC1K1K,K&LM    
9   D  QU. 
 &eC1K1K,K&LM   
9 @  QU. i
 &eC1K1K,K&LM   
9 @  (.E9
 /56:PT&*E9E9 D"U)O$E9
 W**+E9 $DcN3E9 &eC1K1K,K&LME9 smE9 E9 
9E9 E9N  (,6PT0909 09
  }09 09 &eC1K1K,K&LM09 09 
909 09r!   c                       y)zDo not remove from this file.

    `patch_sdk` is a last resort escape hatch that allows you to do customizations
    you can't accomplish using the techniques described in
    https://aka.ms/azsdk/python/dpcodegen/python/customize
    Nr   r   r!   r    	patch_sdkrH     s    r!   N)r=   typingr   r   r   r   r   r   "azure.core.tracing.decorator_asyncr	   _clientr   GeneratedClient r   r@   r   azure.core.credentialsr   azure.core.credentials_asyncr   rB   r>   rD   objectr   __annotations____all__rH   r   r!   r    <module>rS      s]   
 E D F B   )9ACH~h '
(~9 ~9Br!   