
    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 ddlmZ erdd	lmZmZ eeef   Z e       Zeed
<   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   )ContentUnderstandingClient)to_llm_input)models)AnalyzeLROPollerAzureKeyCredentialTokenCredential_Unsetr   r   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   a:  Custom ContentUnderstandingClient with static patches for analyze operations.

    This wrapper:
    - Hides the string_encoding parameter (always uses "codePoint" for Python)
    - Returns AnalyzeLROPoller 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.TokenCredential
    :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
credentialr   kwargsreturnNc                 N    |j                  dd       t        |   d||d| y )Npolling_interval   )r   r    )
setdefaultsuper__init__)selfr   r   r   	__class__s       e/root/aria/tools/markitdown-venv/lib/python3.12/site-packages/azure/ai/contentunderstanding/_patch.pyr   z#ContentUnderstandingClient.__init__3   s-     	,a0L(zLVL    )model_deploymentsprocessing_locationanalyzer_idinputsr#   r$   z(AnalyzeLROPoller[_models.AnalysisResult]c                     y)aF  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 AnalyzeLROPoller that returns AnalysisResult. The AnalysisResult is
         compatible with MutableMapping. The poller includes an .operation_id property.
        :rtype: ~azure.ai.contentunderstanding.models.AnalyzeLROPoller[~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=       r"   application/json)r$   content_typebodyr+   c                     y)aX  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 AnalyzeLROPoller that returns AnalysisResult. The AnalysisResult is
         compatible with MutableMapping. The poller includes an .operation_id property.
        :rtype: ~azure.ai.contentunderstanding.models.AnalyzeLROPoller[~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                     y)ah  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 AnalyzeLROPoller that returns AnalysisResult. The AnalysisResult is
         compatible with MutableMapping. The poller includes an .operation_id property.
        :rtype: ~azure.ai.contentunderstanding.models.AnalyzeLROPoller[~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          
          d|d<   ||nd}|t         urt        
|   d||||||d|}	nt        
|   d|||||d|}	t        j                  |	      S )aI  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 AnalyzeLROPoller that returns AnalysisResult. The AnalysisResult is
         compatible with MutableMapping. The poller includes an .operation_id property.
        :rtype: ~azure.ai.contentunderstanding.models.AnalyzeLROPoller[~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_encodingr*   )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W* '$7-"3 F W* '$7-"3 F  ++F33r"   zapplication/octet-stream)content_ranger+   r$   binary_inputr6   c          
      Z    t        |   d||d|||d|}t        j                  |      S )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 AnalyzeLROPoller that returns AnalysisResult. The AnalysisResult is
         compatible with MutableMapping. The poller includes an .operation_id property.
        :rtype: ~azure.ai.contentunderstanding.models.AnalyzeLROPoller[~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$   r   )r   begin_analyze_binaryr   r3   )	r   r%   r7   r6   r+   r$   r   r5   r    s	           r!   r9   z/ContentUnderstandingClient.begin_analyze_binary   sI    L - 
#%''% 3
 
  ++F33r"   )__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 ABM 	M
 
M  7;PT   W**+	 
 $DcN3  &eC1K1K,K&LM    
4   D  QU. 
 &eC1K1K,K&LM   
4 @  QU. i
 &eC1K1K,K&LM   
4 @  (.E4
 /56:PT&*E4E4 D"U)O$E4
 W**+E4 $DcN3E4 &eC1K1K,K&LME4 smE4 E4 
4E4 E4N  (,6PT0404 04
  }04 04 &eC1K1K,K&LM04 04 
404 04r"   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     r)   r"   N)r=   typingr   r   r   r   r   r   azure.core.tracing.decoratorr	   _clientr   GeneratedClient_helpersr    r   r@   r   azure.core.credentialsr   r   rB   r>   rD   objectr   __annotations____all__rH   r   r"   r!   <module>rS      s_   
 E D : B "  $JCH~h '
8~4 ~4Br"   