From 2dd43e5b670f5cb464eb17857efad3ee4d2003bd Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Thu, 22 Apr 2021 16:12:28 -0700 Subject: [PATCH 1/5] regen on v2.1 --- .../azure/ai/formrecognizer/_api_versions.py | 3 +- .../ai/formrecognizer/_form_base_client.py | 2 +- .../formrecognizer/_form_recognizer_client.py | 60 +++--- .../formrecognizer/_form_training_client.py | 4 +- .../_generated/_form_recognizer_client.py | 13 +- .../_generated/_operations_mixin.py | 176 +++++++++--------- .../_generated/aio/_form_recognizer_client.py | 13 +- .../_generated/aio/_operations_mixin.py | 176 +++++++++--------- .../ai/formrecognizer/_generated/models.py | 3 +- .../_generated/v2_0/_metadata.json | 16 +- .../_form_recognizer_client_operations.py | 24 +-- .../_form_recognizer_client_operations.py | 24 +-- .../{v2_1_preview_3 => v2_1}/__init__.py | 0 .../_configuration.py | 0 .../_form_recognizer_client.py | 2 +- .../{v2_1_preview_3 => v2_1}/_metadata.json | 122 ++++++------ .../{v2_1_preview_3 => v2_1}/aio/__init__.py | 0 .../aio/_configuration.py | 0 .../aio/_form_recognizer_client.py | 2 +- .../aio/operations/__init__.py | 0 .../_form_recognizer_client_operations.py | 104 +++++------ .../models/__init__.py | 0 .../models/_form_recognizer_client_enums.py | 0 .../models/_models.py | 93 +++++---- .../models/_models_py3.py | 93 +++++---- .../operations/__init__.py | 0 .../_form_recognizer_client_operations.py | 104 +++++------ .../{v2_1_preview_3 => v2_1}/py.typed | 0 .../azure/ai/formrecognizer/_helpers.py | 2 +- .../aio/_form_base_client_async.py | 7 +- .../aio/_form_recognizer_client_async.py | 60 +++--- .../aio/_form_training_client_async.py | 4 +- .../tests/test_business_card.py | 2 +- .../tests/test_business_card_async.py | 2 +- .../tests/test_business_card_from_url.py | 2 +- .../test_business_card_from_url_async.py | 2 +- .../tests/test_compose_model.py | 2 +- .../tests/test_compose_model_async.py | 2 +- .../tests/test_content.py | 2 +- .../tests/test_content_async.py | 2 +- .../tests/test_content_from_url.py | 2 +- .../tests/test_content_from_url_async.py | 2 +- .../tests/test_id_documents.py | 2 +- .../tests/test_id_documents_async.py | 2 +- .../tests/test_id_documents_from_url.py | 2 +- .../tests/test_id_documents_from_url_async.py | 2 +- .../tests/test_invoice.py | 2 +- .../tests/test_invoice_async.py | 2 +- .../tests/test_invoice_from_url.py | 2 +- .../tests/test_invoice_from_url_async.py | 2 +- .../tests/test_multiapi.py | 16 +- .../tests/test_multiapi_async.py | 16 +- .../tests/test_receipt.py | 2 +- .../tests/test_receipt_async.py | 2 +- .../tests/test_receipt_from_url.py | 2 +- .../tests/test_receipt_from_url_async.py | 2 +- .../tests/test_training.py | 2 +- .../tests/test_training_async.py | 2 +- 58 files changed, 594 insertions(+), 593 deletions(-) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/__init__.py (100%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/_configuration.py (100%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/_form_recognizer_client.py (98%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/_metadata.json (68%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/aio/__init__.py (100%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/aio/_configuration.py (100%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/aio/_form_recognizer_client.py (98%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/aio/operations/__init__.py (100%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/aio/operations/_form_recognizer_client_operations.py (95%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/models/__init__.py (100%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/models/_form_recognizer_client_enums.py (100%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/models/_models.py (92%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/models/_models_py3.py (92%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/operations/__init__.py (100%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/operations/_form_recognizer_client_operations.py (95%) rename sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/{v2_1_preview_3 => v2_1}/py.typed (100%) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_api_versions.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_api_versions.py index 1c4cb7225907..0177a6d0c72e 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_api_versions.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_api_versions.py @@ -10,7 +10,8 @@ class FormRecognizerApiVersion(str, Enum): """Form Recognizer API versions supported by this package""" #: This is the default version - V2_1_PREVIEW = "2.1-preview.3" + V2_1 = "2.1" + V2_1_PREVIEW = "2.1-preview.3" # TODO what to do about this enum value? V2_0 = "2.0" diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_base_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_base_client.py index 4ff5dee30bf4..ef94c999d488 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_base_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_base_client.py @@ -21,7 +21,7 @@ def __init__(self, endpoint, credential, **kwargs): self._endpoint = endpoint self._credential = credential self._api_version = kwargs.pop( - "api_version", FormRecognizerApiVersion.V2_1_PREVIEW + "api_version", FormRecognizerApiVersion.V2_1 ) validate_api_version(self._api_version) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py index 149b4e4deb70..63a7f8d61ea8 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py @@ -127,20 +127,20 @@ def begin_recognize_receipts(self, receipt, **kwargs): # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if locale: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"locale": locale}) else: raise ValueError( - "'locale' is only available for API version V2_1_PREVIEW and up" + "'locale' is only available for API version V2_1 and up" ) # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1_PREVIEW and up" + "'pages' is only available for API version V2_1 and up" ) return self._client.begin_analyze_receipt_async( # type: ignore file_stream=receipt, @@ -198,20 +198,20 @@ def begin_recognize_receipts_from_url(self, receipt_url, **kwargs): # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if locale: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"locale": locale}) else: raise ValueError( - "'locale' is only available for API version V2_1_PREVIEW and up" + "'locale' is only available for API version V2_1 and up" ) # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1_PREVIEW and up" + "'pages' is only available for API version V2_1 and up" ) return self._client.begin_analyze_receipt_async( # type: ignore file_stream={"source": receipt_url}, @@ -288,7 +288,7 @@ def begin_recognize_business_cards(self, business_card, **kwargs): except ValueError as e: if "begin_analyze_business_card_async" in str(e): raise ValueError( - "Method 'begin_recognize_business_cards' is only available for API version V2_1_PREVIEW and up" + "Method 'begin_recognize_business_cards' is only available for API version V2_1 and up" ) raise e @@ -338,7 +338,7 @@ def begin_recognize_business_cards_from_url(self, business_card_url, **kwargs): if "begin_analyze_business_card_async" in str(e): raise ValueError( "Method 'begin_recognize_business_cards_from_url' is " - "only available for API version V2_1_PREVIEW and up" + "only available for API version V2_1 and up" ) raise e @@ -406,7 +406,7 @@ def begin_recognize_id_documents(self, id_document, **kwargs): except ValueError as e: if "begin_analyze_id_document_async" in str(e): raise ValueError( - "Method 'begin_recognize_id_documents' is only available for API version V2_1_PREVIEW and up" + "Method 'begin_recognize_id_documents' is only available for API version V2_1 and up" ) raise e @@ -453,7 +453,7 @@ def begin_recognize_id_documents_from_url(self, id_document_url, **kwargs): if "begin_analyze_id_document_async" in str(e): raise ValueError( "Method 'begin_recognize_id_documents_from_url' is " - "only available for API version V2_1_PREVIEW and up" + "only available for API version V2_1 and up" ) raise e @@ -523,7 +523,7 @@ def begin_recognize_invoices(self, invoice, **kwargs): except ValueError as e: if "begin_analyze_invoice_async" in str(e): raise ValueError( - "Method 'begin_recognize_invoices' is only available for API version V2_1_PREVIEW and up" + "Method 'begin_recognize_invoices' is only available for API version V2_1 and up" ) raise e @@ -571,7 +571,7 @@ def begin_recognize_invoices_from_url(self, invoice_url, **kwargs): if "begin_analyze_invoice_async" in str(e): raise ValueError( "Method 'begin_recognize_invoices_from_url' is " - "only available for API version V2_1_PREVIEW and up" + "only available for API version V2_1 and up" ) raise e @@ -644,27 +644,27 @@ def begin_recognize_content(self, form, **kwargs): # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1_PREVIEW and up" + "'pages' is only available for API version V2_1 and up" ) if reading_order: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"reading_order": reading_order}) else: raise ValueError( - "'reading_order' is only available for API version V2_1_PREVIEW and up" + "'reading_order' is only available for API version V2_1 and up" ) if language: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"language": language}) else: raise ValueError( - "'language' is only available for API version V2_1_PREVIEW and up" + "'language' is only available for API version V2_1 and up" ) return self._client.begin_analyze_layout_async( # type: ignore @@ -714,27 +714,27 @@ def begin_recognize_content_from_url(self, form_url, **kwargs): # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1_PREVIEW and up" + "'pages' is only available for API version V2_1 and up" ) if reading_order: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"reading_order": reading_order}) else: raise ValueError( - "'reading_order' is only available for API version V2_1_PREVIEW and up" + "'reading_order' is only available for API version V2_1 and up" ) if language: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"language": language}) else: raise ValueError( - "'language' is only available for API version V2_1_PREVIEW and up" + "'language' is only available for API version V2_1 and up" ) return self._client.begin_analyze_layout_async( # type: ignore @@ -817,11 +817,11 @@ def analyze_callback( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1_PREVIEW and up" + "'pages' is only available for API version V2_1 and up" ) return self._client.begin_analyze_with_custom_model( # type: ignore @@ -886,11 +886,11 @@ def analyze_callback( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1_PREVIEW and up" + "'pages' is only available for API version V2_1 and up" ) return self._client.begin_analyze_with_custom_model( # type: ignore diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py index 35fbf3b7bc79..8bab61a45e61 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py @@ -135,7 +135,7 @@ def callback_v2_1(raw_response, _, headers): # pylint: disable=unused-argument model_name = kwargs.pop("model_name", None) if model_name and self._api_version == "2.0": raise ValueError( - "'model_name' is only available for API version V2_1_PREVIEW and up" + "'model_name' is only available for API version V2_1 and up" ) continuation_token = kwargs.pop("continuation_token", None) polling_interval = kwargs.pop( @@ -492,7 +492,7 @@ def _compose_callback( ) except ValueError: raise ValueError( - "Method 'begin_create_composed_model' is only available for API version V2_1_PREVIEW and up" + "Method 'begin_create_composed_model' is only available for API version V2_1 and up" ) def get_form_recognizer_client(self, **kwargs): diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_form_recognizer_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_form_recognizer_client.py index c0d28163f74b..70711a41213c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_form_recognizer_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_form_recognizer_client.py @@ -55,11 +55,12 @@ class FormRecognizerClient(FormRecognizerClientOperationsMixin, MultiApiClientMi :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2.1-preview.3' + DEFAULT_API_VERSION = '2.1' _PROFILE_TAG = "azure.ai.formrecognizer.FormRecognizerClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, + 'train_custom_model_async': '2.0', }}, _PROFILE_TAG + " latest" ) @@ -74,8 +75,8 @@ def __init__( ): if api_version == '2.0': base_url = '{endpoint}/formrecognizer/v2.0' - elif api_version == '2.1-preview.3': - base_url = '{endpoint}/formrecognizer/v2.1-preview.3' + elif api_version == '2.1': + base_url = '{endpoint}/formrecognizer/v2.1' else: raise ValueError("API version {} is not available".format(api_version)) self._config = FormRecognizerClientConfiguration(credential, endpoint, **kwargs) @@ -94,13 +95,13 @@ def models(cls, api_version=DEFAULT_API_VERSION): """Module depends on the API version: * 2.0: :mod:`v2_0.models` - * 2.1-preview.3: :mod:`v2_1_preview_3.models` + * 2.1: :mod:`v2_1.models` """ if api_version == '2.0': from .v2_0 import models return models - elif api_version == '2.1-preview.3': - from .v2_1_preview_3 import models + elif api_version == '2.1': + from .v2_1 import models return models raise ValueError("API version {} is not available".format(api_version)) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_operations_mixin.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_operations_mixin.py index 4424212191c3..166066a26dd9 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_operations_mixin.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_operations_mixin.py @@ -45,19 +45,19 @@ def begin_analyze_business_card_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -65,8 +65,8 @@ def begin_analyze_business_card_async( :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_analyze_business_card_async') - if api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_business_card_async'".format(api_version)) mixin_instance = OperationClass() @@ -98,13 +98,13 @@ def begin_analyze_id_document_async( range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -112,8 +112,8 @@ def begin_analyze_id_document_async( :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_analyze_id_document_async') - if api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_id_document_async'".format(api_version)) mixin_instance = OperationClass() @@ -143,19 +143,19 @@ def begin_analyze_invoice_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -163,8 +163,8 @@ def begin_analyze_invoice_async( :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_analyze_invoice_async') - if api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_invoice_async'".format(api_version)) mixin_instance = OperationClass() @@ -212,18 +212,18 @@ def begin_analyze_layout_async( seventy-three languages and handwritten – English only). Layout supports auto language identification and multi language documents, so only provide a language code if you would like to force the documented to be processed as that specific language. - :type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language + :type language: str or ~azure.ai.formrecognizer.v2_1.models.Language :param reading_order: Reading order algorithm to sort the text lines returned. Supported reading orders include: basic(default), natural. - :type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder + :type reading_order: str or ~azure.ai.formrecognizer.v2_1.models.ReadingOrder :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -233,8 +233,8 @@ def begin_analyze_layout_async( api_version = self._get_api_version('begin_analyze_layout_async') if api_version == '2.0': from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_layout_async'".format(api_version)) mixin_instance = OperationClass() @@ -246,7 +246,7 @@ def begin_analyze_layout_async( # FIXME: this is handwritten if api_version == '2.0': return mixin_instance.begin_analyze_layout_async(file_stream, **kwargs) - elif api_version == '2.1-preview.3': + elif api_version == '2.1': return mixin_instance.begin_analyze_layout_async(pages, language, reading_order, file_stream, **kwargs) def begin_analyze_receipt_async( @@ -268,19 +268,19 @@ def begin_analyze_receipt_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -290,8 +290,8 @@ def begin_analyze_receipt_async( api_version = self._get_api_version('begin_analyze_receipt_async') if api_version == '2.0': from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_receipt_async'".format(api_version)) mixin_instance = OperationClass() @@ -303,7 +303,7 @@ def begin_analyze_receipt_async( # FIXME: this is handwritten if api_version == '2.0': return mixin_instance.begin_analyze_receipt_async(include_text_details, file_stream, **kwargs) - elif api_version == '2.1-preview.3': + elif api_version == '2.1': return mixin_instance.begin_analyze_receipt_async(include_text_details, locale, pages, file_stream, **kwargs) def begin_analyze_with_custom_model( @@ -330,13 +330,13 @@ def begin_analyze_with_custom_model( range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -346,8 +346,8 @@ def begin_analyze_with_custom_model( api_version = self._get_api_version('begin_analyze_with_custom_model') if api_version == '2.0': from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_with_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -359,7 +359,7 @@ def begin_analyze_with_custom_model( # FIXME: this is handwritten if api_version == '2.0': return mixin_instance.begin_analyze_with_custom_model(model_id, include_text_details, file_stream, **kwargs) - elif api_version == '2.1-preview.3': + elif api_version == '2.1': return mixin_instance.begin_analyze_with_custom_model(model_id, include_text_details, pages, file_stream, **kwargs) def begin_compose_custom_models_async( @@ -374,11 +374,11 @@ def begin_compose_custom_models_async( It would validate limit of models put together. :param compose_request: Compose models. - :type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest + :type compose_request: ~azure.ai.formrecognizer.v2_1.models.ComposeRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -386,8 +386,8 @@ def begin_compose_custom_models_async( :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_compose_custom_models_async') - if api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_compose_custom_models_async'".format(api_version)) mixin_instance = OperationClass() @@ -412,11 +412,11 @@ def begin_copy_custom_model( :param model_id: Model identifier. :type model_id: str :param copy_request: Copy request parameters. - :type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest + :type copy_request: ~azure.ai.formrecognizer.v2_1.models.CopyRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -426,8 +426,8 @@ def begin_copy_custom_model( api_version = self._get_api_version('begin_copy_custom_model') if api_version == '2.0': from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_copy_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -456,11 +456,11 @@ def begin_train_custom_model_async( or 'image/bmp'. Other type of content is ignored. :param train_request: Training request parameters. - :type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest + :type train_request: ~azure.ai.formrecognizer.v2_1.models.TrainRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -468,8 +468,8 @@ def begin_train_custom_model_async( :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_train_custom_model_async') - if api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_train_custom_model_async'".format(api_version)) mixin_instance = OperationClass() @@ -500,8 +500,8 @@ def delete_custom_model( api_version = self._get_api_version('delete_custom_model') if api_version == '2.0': from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'delete_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -522,14 +522,14 @@ def generate_model_copy_authorization( :keyword callable cls: A custom type or function that will be passed the direct response :return: CopyAuthorizationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.CopyAuthorizationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('generate_model_copy_authorization') if api_version == '2.0': from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'generate_model_copy_authorization'".format(api_version)) mixin_instance = OperationClass() @@ -553,12 +553,12 @@ def get_analyze_business_card_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_business_card_result') - if api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_business_card_result'".format(api_version)) mixin_instance = OperationClass() @@ -585,14 +585,14 @@ def get_analyze_form_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_form_result') if api_version == '2.0': from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_form_result'".format(api_version)) mixin_instance = OperationClass() @@ -616,12 +616,12 @@ def get_analyze_id_document_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_id_document_result') - if api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_id_document_result'".format(api_version)) mixin_instance = OperationClass() @@ -645,12 +645,12 @@ def get_analyze_invoice_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_invoice_result') - if api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_invoice_result'".format(api_version)) mixin_instance = OperationClass() @@ -674,14 +674,14 @@ def get_analyze_layout_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_layout_result') if api_version == '2.0': from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_layout_result'".format(api_version)) mixin_instance = OperationClass() @@ -705,14 +705,14 @@ def get_analyze_receipt_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_receipt_result') if api_version == '2.0': from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_receipt_result'".format(api_version)) mixin_instance = OperationClass() @@ -739,14 +739,14 @@ def get_custom_model( :type include_keys: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: Model, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Model + :rtype: ~azure.ai.formrecognizer.v2_1.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_custom_model') if api_version == '2.0': from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -773,14 +773,14 @@ def get_custom_model_copy_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CopyOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.CopyOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_custom_model_copy_result') if api_version == '2.0': from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_custom_model_copy_result'".format(api_version)) mixin_instance = OperationClass() @@ -801,14 +801,14 @@ def get_custom_models( :keyword callable cls: A custom type or function that will be passed the direct response :return: Models, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Models + :rtype: ~azure.ai.formrecognizer.v2_1.models.Models :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_custom_models') if api_version == '2.0': from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_custom_models'".format(api_version)) mixin_instance = OperationClass() @@ -829,14 +829,14 @@ def list_custom_models( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Models or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.formrecognizer.v2_1_preview_3.models.Models] + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.formrecognizer.v2_1.models.Models] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_custom_models') if api_version == '2.0': from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_custom_models'".format(api_version)) mixin_instance = OperationClass() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_form_recognizer_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_form_recognizer_client.py index cf8e61eb0f41..96db4056a936 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_form_recognizer_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_form_recognizer_client.py @@ -53,11 +53,12 @@ class FormRecognizerClient(FormRecognizerClientOperationsMixin, MultiApiClientMi :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2.1-preview.3' + DEFAULT_API_VERSION = '2.1' _PROFILE_TAG = "azure.ai.formrecognizer.FormRecognizerClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, + 'train_custom_model_async': '2.0', }}, _PROFILE_TAG + " latest" ) @@ -72,8 +73,8 @@ def __init__( ) -> None: if api_version == '2.0': base_url = '{endpoint}/formrecognizer/v2.0' - elif api_version == '2.1-preview.3': - base_url = '{endpoint}/formrecognizer/v2.1-preview.3' + elif api_version == '2.1': + base_url = '{endpoint}/formrecognizer/v2.1' else: raise ValueError("API version {} is not available".format(api_version)) self._config = FormRecognizerClientConfiguration(credential, endpoint, **kwargs) @@ -92,13 +93,13 @@ def models(cls, api_version=DEFAULT_API_VERSION): """Module depends on the API version: * 2.0: :mod:`v2_0.models` - * 2.1-preview.3: :mod:`v2_1_preview_3.models` + * 2.1: :mod:`v2_1.models` """ if api_version == '2.0': from ..v2_0 import models return models - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3 import models + elif api_version == '2.1': + from ..v2_1 import models return models raise ValueError("API version {} is not available".format(api_version)) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_operations_mixin.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_operations_mixin.py index 0742416eb59d..6ec0092a0fd9 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_operations_mixin.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_operations_mixin.py @@ -41,19 +41,19 @@ async def begin_analyze_business_card_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -61,8 +61,8 @@ async def begin_analyze_business_card_async( :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_analyze_business_card_async') - if api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_business_card_async'".format(api_version)) mixin_instance = OperationClass() @@ -94,13 +94,13 @@ async def begin_analyze_id_document_async( range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -108,8 +108,8 @@ async def begin_analyze_id_document_async( :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_analyze_id_document_async') - if api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_id_document_async'".format(api_version)) mixin_instance = OperationClass() @@ -139,19 +139,19 @@ async def begin_analyze_invoice_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -159,8 +159,8 @@ async def begin_analyze_invoice_async( :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_analyze_invoice_async') - if api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_invoice_async'".format(api_version)) mixin_instance = OperationClass() @@ -208,18 +208,18 @@ async def begin_analyze_layout_async( seventy-three languages and handwritten – English only). Layout supports auto language identification and multi language documents, so only provide a language code if you would like to force the documented to be processed as that specific language. - :type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language + :type language: str or ~azure.ai.formrecognizer.v2_1.models.Language :param reading_order: Reading order algorithm to sort the text lines returned. Supported reading orders include: basic(default), natural. - :type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder + :type reading_order: str or ~azure.ai.formrecognizer.v2_1.models.ReadingOrder :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -229,8 +229,8 @@ async def begin_analyze_layout_async( api_version = self._get_api_version('begin_analyze_layout_async') if api_version == '2.0': from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_layout_async'".format(api_version)) mixin_instance = OperationClass() @@ -242,7 +242,7 @@ async def begin_analyze_layout_async( # FIXME: this is handwritten if api_version == '2.0': return await mixin_instance.begin_analyze_layout_async(file_stream, **kwargs) - elif api_version == '2.1-preview.3': + elif api_version == '2.1': return await mixin_instance.begin_analyze_layout_async(pages, language, reading_order, file_stream, **kwargs) async def begin_analyze_receipt_async( @@ -264,19 +264,19 @@ async def begin_analyze_receipt_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -286,8 +286,8 @@ async def begin_analyze_receipt_async( api_version = self._get_api_version('begin_analyze_receipt_async') if api_version == '2.0': from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_receipt_async'".format(api_version)) mixin_instance = OperationClass() @@ -299,7 +299,7 @@ async def begin_analyze_receipt_async( # FIXME: this is handwritten if api_version == '2.0': return await mixin_instance.begin_analyze_receipt_async(include_text_details, file_stream, **kwargs) - elif api_version == '2.1-preview.3': + elif api_version == '2.1': return await mixin_instance.begin_analyze_receipt_async(include_text_details, locale, pages, file_stream, **kwargs) async def begin_analyze_with_custom_model( @@ -326,13 +326,13 @@ async def begin_analyze_with_custom_model( range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -342,8 +342,8 @@ async def begin_analyze_with_custom_model( api_version = self._get_api_version('begin_analyze_with_custom_model') if api_version == '2.0': from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_with_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -355,7 +355,7 @@ async def begin_analyze_with_custom_model( # FIXME: this is handwritten if api_version == '2.0': return await mixin_instance.begin_analyze_with_custom_model(model_id, include_text_details, file_stream, **kwargs) - elif api_version == '2.1-preview.3': + elif api_version == '2.1': return await mixin_instance.begin_analyze_with_custom_model(model_id, include_text_details, pages, file_stream, **kwargs) async def begin_compose_custom_models_async( @@ -370,11 +370,11 @@ async def begin_compose_custom_models_async( It would validate limit of models put together. :param compose_request: Compose models. - :type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest + :type compose_request: ~azure.ai.formrecognizer.v2_1.models.ComposeRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -382,8 +382,8 @@ async def begin_compose_custom_models_async( :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_compose_custom_models_async') - if api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_compose_custom_models_async'".format(api_version)) mixin_instance = OperationClass() @@ -408,11 +408,11 @@ async def begin_copy_custom_model( :param model_id: Model identifier. :type model_id: str :param copy_request: Copy request parameters. - :type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest + :type copy_request: ~azure.ai.formrecognizer.v2_1.models.CopyRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -422,8 +422,8 @@ async def begin_copy_custom_model( api_version = self._get_api_version('begin_copy_custom_model') if api_version == '2.0': from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_copy_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -452,11 +452,11 @@ async def begin_train_custom_model_async( or 'image/bmp'. Other type of content is ignored. :param train_request: Training request parameters. - :type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest + :type train_request: ~azure.ai.formrecognizer.v2_1.models.TrainRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -464,8 +464,8 @@ async def begin_train_custom_model_async( :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_train_custom_model_async') - if api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_train_custom_model_async'".format(api_version)) mixin_instance = OperationClass() @@ -496,8 +496,8 @@ async def delete_custom_model( api_version = self._get_api_version('delete_custom_model') if api_version == '2.0': from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'delete_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -518,14 +518,14 @@ async def generate_model_copy_authorization( :keyword callable cls: A custom type or function that will be passed the direct response :return: CopyAuthorizationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.CopyAuthorizationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('generate_model_copy_authorization') if api_version == '2.0': from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'generate_model_copy_authorization'".format(api_version)) mixin_instance = OperationClass() @@ -549,12 +549,12 @@ async def get_analyze_business_card_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_business_card_result') - if api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_business_card_result'".format(api_version)) mixin_instance = OperationClass() @@ -581,14 +581,14 @@ async def get_analyze_form_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_form_result') if api_version == '2.0': from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_form_result'".format(api_version)) mixin_instance = OperationClass() @@ -612,12 +612,12 @@ async def get_analyze_id_document_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_id_document_result') - if api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_id_document_result'".format(api_version)) mixin_instance = OperationClass() @@ -641,12 +641,12 @@ async def get_analyze_invoice_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_invoice_result') - if api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + if api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_invoice_result'".format(api_version)) mixin_instance = OperationClass() @@ -670,14 +670,14 @@ async def get_analyze_layout_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_layout_result') if api_version == '2.0': from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_layout_result'".format(api_version)) mixin_instance = OperationClass() @@ -701,14 +701,14 @@ async def get_analyze_receipt_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_receipt_result') if api_version == '2.0': from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_receipt_result'".format(api_version)) mixin_instance = OperationClass() @@ -735,14 +735,14 @@ async def get_custom_model( :type include_keys: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: Model, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Model + :rtype: ~azure.ai.formrecognizer.v2_1.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_custom_model') if api_version == '2.0': from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -769,14 +769,14 @@ async def get_custom_model_copy_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CopyOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.CopyOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_custom_model_copy_result') if api_version == '2.0': from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_custom_model_copy_result'".format(api_version)) mixin_instance = OperationClass() @@ -797,14 +797,14 @@ async def get_custom_models( :keyword callable cls: A custom type or function that will be passed the direct response :return: Models, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Models + :rtype: ~azure.ai.formrecognizer.v2_1.models.Models :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_custom_models') if api_version == '2.0': from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_custom_models'".format(api_version)) mixin_instance = OperationClass() @@ -825,14 +825,14 @@ def list_custom_models( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Models or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.formrecognizer.v2_1_preview_3.models.Models] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.formrecognizer.v2_1.models.Models] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_custom_models') if api_version == '2.0': from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass - elif api_version == '2.1-preview.3': - from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1': + from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_custom_models'".format(api_version)) mixin_instance = OperationClass() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/models.py index 6c7122cc10ed..5b454eea28d5 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/models.py @@ -4,4 +4,5 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from .v2_1_preview_3.models import * +from .v2_0.models import * +from .v2_1.models import * diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_0/_metadata.json b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_0/_metadata.json index 9eaedd177725..cbdb78002793 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_0/_metadata.json +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_0/_metadata.json @@ -142,12 +142,12 @@ "begin_analyze_with_custom_model" : { "sync": { "signature": "def begin_analyze_with_custom_model(\n self,\n model_id, # type: str\n include_text_details=False, # type: Optional[bool]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Analyze Form.\n\nExtract key-value pairs, tables, and semantic values from a given document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027 or\n\u0027image/tiff\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_0.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Form.\n\nExtract key-value pairs, tables, and semantic values from a given document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027 or\n\u0027image/tiff\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_0.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_analyze_with_custom_model(\n self,\n model_id: str,\n include_text_details: Optional[bool] = False,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Analyze Form.\n\nExtract key-value pairs, tables, and semantic values from a given document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027 or\n\u0027image/tiff\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_0.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Form.\n\nExtract key-value pairs, tables, and semantic values from a given document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027 or\n\u0027image/tiff\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_0.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "model_id, include_text_details, file_stream" }, @@ -178,12 +178,12 @@ "begin_copy_custom_model" : { "sync": { "signature": "def begin_copy_custom_model(\n self,\n model_id, # type: str\n copy_request, # type: \"_models.CopyRequest\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Copy Custom Model.\n\nCopy custom model stored in this resource (the source) to user specified target Form Recognizer\nresource.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_0.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Copy Custom Model.\n\nCopy custom model stored in this resource (the source) to user specified target Form Recognizer\nresource.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_0.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_copy_custom_model(\n self,\n model_id: str,\n copy_request: \"_models.CopyRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Copy Custom Model.\n\nCopy custom model stored in this resource (the source) to user specified target Form Recognizer\nresource.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_0.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Copy Custom Model.\n\nCopy custom model stored in this resource (the source) to user specified target Form Recognizer\nresource.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_0.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "model_id, copy_request" }, @@ -226,12 +226,12 @@ "begin_analyze_receipt_async" : { "sync": { "signature": "def begin_analyze_receipt_async(\n self,\n include_text_details=False, # type: Optional[bool]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Analyze Receipt.\n\nExtract field text and semantic values from a given receipt document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027 or\n\u0027image/tiff\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_0.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Receipt.\n\nExtract field text and semantic values from a given receipt document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027 or\n\u0027image/tiff\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_0.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_analyze_receipt_async(\n self,\n include_text_details: Optional[bool] = False,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Analyze Receipt.\n\nExtract field text and semantic values from a given receipt document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027 or\n\u0027image/tiff\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_0.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Receipt.\n\nExtract field text and semantic values from a given receipt document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027 or\n\u0027image/tiff\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_0.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "include_text_details, file_stream" }, @@ -262,12 +262,12 @@ "begin_analyze_layout_async" : { "sync": { "signature": "def begin_analyze_layout_async(\n self,\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Analyze Layout.\n\nExtract text and layout information from a given document. The input document must be of one of\nthe supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027 or \u0027image/tiff\u0027.\nAlternatively, use \u0027application/json\u0027 type to specify the location (Uri or local path) of the\ndocument to be analyzed.\n\n:param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_0.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Layout.\n\nExtract text and layout information from a given document. The input document must be of one of\nthe supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027 or \u0027image/tiff\u0027.\nAlternatively, use \u0027application/json\u0027 type to specify the location (Uri or local path) of the\ndocument to be analyzed.\n\n:param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_0.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_analyze_layout_async(\n self,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Analyze Layout.\n\nExtract text and layout information from a given document. The input document must be of one of\nthe supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027 or \u0027image/tiff\u0027.\nAlternatively, use \u0027application/json\u0027 type to specify the location (Uri or local path) of the\ndocument to be analyzed.\n\n:param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_0.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Layout.\n\nExtract text and layout information from a given document. The input document must be of one of\nthe supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027 or \u0027image/tiff\u0027.\nAlternatively, use \u0027application/json\u0027 type to specify the location (Uri or local path) of the\ndocument to be analyzed.\n\n:param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_0.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "file_stream" }, diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_0/aio/operations/_form_recognizer_client_operations.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_0/aio/operations/_form_recognizer_client_operations.py index 5dfc78af8182..c8a35c4cc3a5 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_0/aio/operations/_form_recognizer_client_operations.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_0/aio/operations/_form_recognizer_client_operations.py @@ -290,15 +290,15 @@ async def begin_analyze_with_custom_model( Allowed values are: "application/pdf", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -466,15 +466,15 @@ async def begin_copy_custom_model( :type copy_request: ~azure.ai.formrecognizer.v2_0.models.CopyRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -710,15 +710,15 @@ async def begin_analyze_receipt_async( Allowed values are: "application/pdf", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -890,15 +890,15 @@ async def begin_analyze_layout_async( Allowed values are: "application/pdf", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_0/operations/_form_recognizer_client_operations.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_0/operations/_form_recognizer_client_operations.py index 4270e2f1eaee..cd0461e24153 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_0/operations/_form_recognizer_client_operations.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_0/operations/_form_recognizer_client_operations.py @@ -299,15 +299,15 @@ def begin_analyze_with_custom_model( Allowed values are: "application/pdf", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -478,15 +478,15 @@ def begin_copy_custom_model( :type copy_request: ~azure.ai.formrecognizer.v2_0.models.CopyRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -726,15 +726,15 @@ def begin_analyze_receipt_async( Allowed values are: "application/pdf", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -909,15 +909,15 @@ def begin_analyze_layout_async( Allowed values are: "application/pdf", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/__init__.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/__init__.py similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/__init__.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/__init__.py diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_configuration.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/_configuration.py similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_configuration.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/_configuration.py diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_form_recognizer_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/_form_recognizer_client.py similarity index 98% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_form_recognizer_client.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/_form_recognizer_client.py index 5ab44db519d4..8c5339c74528 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_form_recognizer_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/_form_recognizer_client.py @@ -40,7 +40,7 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - base_url = '{endpoint}/formrecognizer/v2.1-preview.3' + base_url = '{endpoint}/formrecognizer/v2.1' self._config = FormRecognizerClientConfiguration(credential, endpoint, **kwargs) self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_metadata.json b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/_metadata.json similarity index 68% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_metadata.json rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/_metadata.json index f748aa5d61c0..3b8f7a4caf5d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_metadata.json +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/_metadata.json @@ -1,12 +1,12 @@ { - "chosen_version": "2.1-preview.3", - "total_api_version_list": ["2.1-preview.3"], + "chosen_version": "2.1", + "total_api_version_list": ["2.1"], "client": { "name": "FormRecognizerClient", "filename": "_form_recognizer_client", "description": "Extracts information from forms and images into structured data.", "base_url": null, - "custom_base_url": "\u0027{endpoint}/formrecognizer/v2.1-preview.3\u0027", + "custom_base_url": "\u0027{endpoint}/formrecognizer/v2.1\u0027", "azure_arm": false, "has_lro_operations": true, "client_side_validation": false, @@ -94,36 +94,36 @@ "_train_custom_model_async_initial" : { "sync": { "signature": "def _train_custom_model_async_initial(\n self,\n train_request, # type: \"_models.TrainRequest\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param train_request: Training request parameters.\n:type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param train_request: Training request parameters.\n:type train_request: ~azure.ai.formrecognizer.v2_1.models.TrainRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def _train_custom_model_async_initial(\n self,\n train_request: \"_models.TrainRequest\",\n **kwargs\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param train_request: Training request parameters.\n:type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param train_request: Training request parameters.\n:type train_request: ~azure.ai.formrecognizer.v2_1.models.TrainRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "train_request" }, "begin_train_custom_model_async" : { "sync": { "signature": "def begin_train_custom_model_async(\n self,\n train_request, # type: \"_models.TrainRequest\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Train Custom Model.\n\nCreate and train a custom model. The request must include a source parameter that is either an\nexternally accessible Azure storage blob container Uri (preferably a Shared Access Signature\nUri) or valid path to a data folder in a locally mounted drive. When local paths are specified,\nthey must follow the Linux/Unix path format and be an absolute path rooted to the input mount\nconfiguration setting value e.g., if \u0027{Mounts:Input}\u0027 configuration setting value is \u0027/input\u0027\nthen a valid source path would be \u0027/input/contosodataset\u0027. All data to be trained is expected\nto be under the source folder or sub folders under it. Models are trained using documents that\nare of the following content type - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027\nor \u0027image/bmp\u0027. Other type of content is ignored.\n\n:param train_request: Training request parameters.\n:type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Train Custom Model.\n\nCreate and train a custom model. The request must include a source parameter that is either an\nexternally accessible Azure storage blob container Uri (preferably a Shared Access Signature\nUri) or valid path to a data folder in a locally mounted drive. When local paths are specified,\nthey must follow the Linux/Unix path format and be an absolute path rooted to the input mount\nconfiguration setting value e.g., if \u0027{Mounts:Input}\u0027 configuration setting value is \u0027/input\u0027\nthen a valid source path would be \u0027/input/contosodataset\u0027. All data to be trained is expected\nto be under the source folder or sub folders under it. Models are trained using documents that\nare of the following content type - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027\nor \u0027image/bmp\u0027. Other type of content is ignored.\n\n:param train_request: Training request parameters.\n:type train_request: ~azure.ai.formrecognizer.v2_1.models.TrainRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_train_custom_model_async(\n self,\n train_request: \"_models.TrainRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Train Custom Model.\n\nCreate and train a custom model. The request must include a source parameter that is either an\nexternally accessible Azure storage blob container Uri (preferably a Shared Access Signature\nUri) or valid path to a data folder in a locally mounted drive. When local paths are specified,\nthey must follow the Linux/Unix path format and be an absolute path rooted to the input mount\nconfiguration setting value e.g., if \u0027{Mounts:Input}\u0027 configuration setting value is \u0027/input\u0027\nthen a valid source path would be \u0027/input/contosodataset\u0027. All data to be trained is expected\nto be under the source folder or sub folders under it. Models are trained using documents that\nare of the following content type - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027\nor \u0027image/bmp\u0027. Other type of content is ignored.\n\n:param train_request: Training request parameters.\n:type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Train Custom Model.\n\nCreate and train a custom model. The request must include a source parameter that is either an\nexternally accessible Azure storage blob container Uri (preferably a Shared Access Signature\nUri) or valid path to a data folder in a locally mounted drive. When local paths are specified,\nthey must follow the Linux/Unix path format and be an absolute path rooted to the input mount\nconfiguration setting value e.g., if \u0027{Mounts:Input}\u0027 configuration setting value is \u0027/input\u0027\nthen a valid source path would be \u0027/input/contosodataset\u0027. All data to be trained is expected\nto be under the source folder or sub folders under it. Models are trained using documents that\nare of the following content type - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027\nor \u0027image/bmp\u0027. Other type of content is ignored.\n\n:param train_request: Training request parameters.\n:type train_request: ~azure.ai.formrecognizer.v2_1.models.TrainRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "train_request" }, "get_custom_model" : { "sync": { "signature": "def get_custom_model(\n self,\n model_id, # type: str\n include_keys=False, # type: Optional[bool]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Get Custom Model.\n\nGet detailed information about a custom model.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_keys: Include list of extracted keys in model information.\n:type include_keys: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Model, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Model\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Custom Model.\n\nGet detailed information about a custom model.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_keys: Include list of extracted keys in model information.\n:type include_keys: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Model, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.Model\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def get_custom_model(\n self,\n model_id: str,\n include_keys: Optional[bool] = False,\n **kwargs\n) -\u003e \"_models.Model\":\n", - "doc": "\"\"\"Get Custom Model.\n\nGet detailed information about a custom model.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_keys: Include list of extracted keys in model information.\n:type include_keys: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Model, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Model\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Custom Model.\n\nGet detailed information about a custom model.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_keys: Include list of extracted keys in model information.\n:type include_keys: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Model, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.Model\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "model_id, include_keys" }, @@ -142,312 +142,312 @@ "_analyze_with_custom_model_initial" : { "sync": { "signature": "def _analyze_with_custom_model_initial(\n self,\n model_id, # type: str\n include_text_details=False, # type: Optional[bool]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def _analyze_with_custom_model_initial(\n self,\n model_id: str,\n include_text_details: Optional[bool] = False,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "model_id, include_text_details, pages, file_stream" }, "begin_analyze_with_custom_model" : { "sync": { "signature": "def begin_analyze_with_custom_model(\n self,\n model_id, # type: str\n include_text_details=False, # type: Optional[bool]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Analyze Form.\n\nExtract key-value pairs, tables, and semantic values from a given document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri or local path) of the document to be analyzed.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Form.\n\nExtract key-value pairs, tables, and semantic values from a given document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri or local path) of the document to be analyzed.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_analyze_with_custom_model(\n self,\n model_id: str,\n include_text_details: Optional[bool] = False,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Analyze Form.\n\nExtract key-value pairs, tables, and semantic values from a given document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri or local path) of the document to be analyzed.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Form.\n\nExtract key-value pairs, tables, and semantic values from a given document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri or local path) of the document to be analyzed.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "model_id, include_text_details, pages, file_stream" }, "get_analyze_form_result" : { "sync": { "signature": "def get_analyze_form_result(\n self,\n model_id, # type: str\n result_id, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Get Analyze Form Result.\n\nObtain current status and the result of the analyze form operation.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Analyze Form Result.\n\nObtain current status and the result of the analyze form operation.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def get_analyze_form_result(\n self,\n model_id: str,\n result_id: str,\n **kwargs\n) -\u003e \"_models.AnalyzeOperationResult\":\n", - "doc": "\"\"\"Get Analyze Form Result.\n\nObtain current status and the result of the analyze form operation.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Analyze Form Result.\n\nObtain current status and the result of the analyze form operation.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "model_id, result_id" }, "_copy_custom_model_initial" : { "sync": { "signature": "def _copy_custom_model_initial(\n self,\n model_id, # type: str\n copy_request, # type: \"_models.CopyRequest\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_1.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def _copy_custom_model_initial(\n self,\n model_id: str,\n copy_request: \"_models.CopyRequest\",\n **kwargs\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_1.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "model_id, copy_request" }, "begin_copy_custom_model" : { "sync": { "signature": "def begin_copy_custom_model(\n self,\n model_id, # type: str\n copy_request, # type: \"_models.CopyRequest\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Copy Custom Model.\n\nCopy custom model stored in this resource (the source) to user specified target Form Recognizer\nresource.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Copy Custom Model.\n\nCopy custom model stored in this resource (the source) to user specified target Form Recognizer\nresource.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_1.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_copy_custom_model(\n self,\n model_id: str,\n copy_request: \"_models.CopyRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Copy Custom Model.\n\nCopy custom model stored in this resource (the source) to user specified target Form Recognizer\nresource.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Copy Custom Model.\n\nCopy custom model stored in this resource (the source) to user specified target Form Recognizer\nresource.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_1.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "model_id, copy_request" }, "get_custom_model_copy_result" : { "sync": { "signature": "def get_custom_model_copy_result(\n self,\n model_id, # type: str\n result_id, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Get Custom Model Copy Result.\n\nObtain current status and the result of a custom model copy operation.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param result_id: Copy operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Custom Model Copy Result.\n\nObtain current status and the result of a custom model copy operation.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param result_id: Copy operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.CopyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def get_custom_model_copy_result(\n self,\n model_id: str,\n result_id: str,\n **kwargs\n) -\u003e \"_models.CopyOperationResult\":\n", - "doc": "\"\"\"Get Custom Model Copy Result.\n\nObtain current status and the result of a custom model copy operation.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param result_id: Copy operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Custom Model Copy Result.\n\nObtain current status and the result of a custom model copy operation.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param result_id: Copy operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.CopyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "model_id, result_id" }, "generate_model_copy_authorization" : { "sync": { "signature": "def generate_model_copy_authorization(\n self,\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Generate Copy Authorization.\n\nGenerate authorization to copy a model into the target Form Recognizer resource.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyAuthorizationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Generate Copy Authorization.\n\nGenerate authorization to copy a model into the target Form Recognizer resource.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyAuthorizationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.CopyAuthorizationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def generate_model_copy_authorization(\n self,\n **kwargs\n) -\u003e \"_models.CopyAuthorizationResult\":\n", - "doc": "\"\"\"Generate Copy Authorization.\n\nGenerate authorization to copy a model into the target Form Recognizer resource.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyAuthorizationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Generate Copy Authorization.\n\nGenerate authorization to copy a model into the target Form Recognizer resource.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyAuthorizationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.CopyAuthorizationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "" }, "_compose_custom_models_async_initial" : { "sync": { "signature": "def _compose_custom_models_async_initial(\n self,\n compose_request, # type: \"_models.ComposeRequest\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param compose_request: Compose models.\n:type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param compose_request: Compose models.\n:type compose_request: ~azure.ai.formrecognizer.v2_1.models.ComposeRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def _compose_custom_models_async_initial(\n self,\n compose_request: \"_models.ComposeRequest\",\n **kwargs\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param compose_request: Compose models.\n:type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param compose_request: Compose models.\n:type compose_request: ~azure.ai.formrecognizer.v2_1.models.ComposeRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "compose_request" }, "begin_compose_custom_models_async" : { "sync": { "signature": "def begin_compose_custom_models_async(\n self,\n compose_request, # type: \"_models.ComposeRequest\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Compose trained with labels models into one composed model.\n\nCompose request would include list of models ids.\nIt would validate what all models either trained with labels model or composed model.\nIt would validate limit of models put together.\n\n:param compose_request: Compose models.\n:type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Compose trained with labels models into one composed model.\n\nCompose request would include list of models ids.\nIt would validate what all models either trained with labels model or composed model.\nIt would validate limit of models put together.\n\n:param compose_request: Compose models.\n:type compose_request: ~azure.ai.formrecognizer.v2_1.models.ComposeRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_compose_custom_models_async(\n self,\n compose_request: \"_models.ComposeRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Compose trained with labels models into one composed model.\n\nCompose request would include list of models ids.\nIt would validate what all models either trained with labels model or composed model.\nIt would validate limit of models put together.\n\n:param compose_request: Compose models.\n:type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Compose trained with labels models into one composed model.\n\nCompose request would include list of models ids.\nIt would validate what all models either trained with labels model or composed model.\nIt would validate limit of models put together.\n\n:param compose_request: Compose models.\n:type compose_request: ~azure.ai.formrecognizer.v2_1.models.ComposeRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "compose_request" }, "_analyze_business_card_async_initial" : { "sync": { "signature": "def _analyze_business_card_async_initial(\n self,\n include_text_details=False, # type: Optional[bool]\n locale=None, # type: Optional[Union[str, \"_models.Locale\"]]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def _analyze_business_card_async_initial(\n self,\n include_text_details: Optional[bool] = False,\n locale: Optional[Union[str, \"_models.Locale\"]] = None,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "include_text_details, locale, pages, file_stream" }, "begin_analyze_business_card_async" : { "sync": { "signature": "def begin_analyze_business_card_async(\n self,\n include_text_details=False, # type: Optional[bool]\n locale=None, # type: Optional[Union[str, \"_models.Locale\"]]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Analyze Business Card.\n\nExtract field text and semantic values from a given business card document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Business Card.\n\nExtract field text and semantic values from a given business card document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_analyze_business_card_async(\n self,\n include_text_details: Optional[bool] = False,\n locale: Optional[Union[str, \"_models.Locale\"]] = None,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Analyze Business Card.\n\nExtract field text and semantic values from a given business card document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Business Card.\n\nExtract field text and semantic values from a given business card document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "include_text_details, locale, pages, file_stream" }, "get_analyze_business_card_result" : { "sync": { "signature": "def get_analyze_business_card_result(\n self,\n result_id, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Get Analyze Business Card Result.\n\nTrack the progress and obtain the result of the analyze business card operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Analyze Business Card Result.\n\nTrack the progress and obtain the result of the analyze business card operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def get_analyze_business_card_result(\n self,\n result_id: str,\n **kwargs\n) -\u003e \"_models.AnalyzeOperationResult\":\n", - "doc": "\"\"\"Get Analyze Business Card Result.\n\nTrack the progress and obtain the result of the analyze business card operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Analyze Business Card Result.\n\nTrack the progress and obtain the result of the analyze business card operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "result_id" }, "_analyze_invoice_async_initial" : { "sync": { "signature": "def _analyze_invoice_async_initial(\n self,\n include_text_details=False, # type: Optional[bool]\n locale=None, # type: Optional[Union[str, \"_models.Locale\"]]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def _analyze_invoice_async_initial(\n self,\n include_text_details: Optional[bool] = False,\n locale: Optional[Union[str, \"_models.Locale\"]] = None,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "include_text_details, locale, pages, file_stream" }, "begin_analyze_invoice_async" : { "sync": { "signature": "def begin_analyze_invoice_async(\n self,\n include_text_details=False, # type: Optional[bool]\n locale=None, # type: Optional[Union[str, \"_models.Locale\"]]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Analyze Invoice Document.\n\nExtract field text and semantic values from a given invoice document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Invoice Document.\n\nExtract field text and semantic values from a given invoice document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_analyze_invoice_async(\n self,\n include_text_details: Optional[bool] = False,\n locale: Optional[Union[str, \"_models.Locale\"]] = None,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Analyze Invoice Document.\n\nExtract field text and semantic values from a given invoice document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Invoice Document.\n\nExtract field text and semantic values from a given invoice document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "include_text_details, locale, pages, file_stream" }, "get_analyze_invoice_result" : { "sync": { "signature": "def get_analyze_invoice_result(\n self,\n result_id, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Get Analyze Invoice Result.\n\nTrack the progress and obtain the result of the analyze invoice operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Analyze Invoice Result.\n\nTrack the progress and obtain the result of the analyze invoice operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def get_analyze_invoice_result(\n self,\n result_id: str,\n **kwargs\n) -\u003e \"_models.AnalyzeOperationResult\":\n", - "doc": "\"\"\"Get Analyze Invoice Result.\n\nTrack the progress and obtain the result of the analyze invoice operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Analyze Invoice Result.\n\nTrack the progress and obtain the result of the analyze invoice operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "result_id" }, "_analyze_id_document_async_initial" : { "sync": { "signature": "def _analyze_id_document_async_initial(\n self,\n include_text_details=False, # type: Optional[bool]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def _analyze_id_document_async_initial(\n self,\n include_text_details: Optional[bool] = False,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "include_text_details, pages, file_stream" }, "begin_analyze_id_document_async" : { "sync": { "signature": "def begin_analyze_id_document_async(\n self,\n include_text_details=False, # type: Optional[bool]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Analyze ID Document.\n\nExtract field text and semantic values from a given ID document. The input document must be of\none of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027\nor \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri) of the\ndocument to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze ID Document.\n\nExtract field text and semantic values from a given ID document. The input document must be of\none of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027\nor \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri) of the\ndocument to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_analyze_id_document_async(\n self,\n include_text_details: Optional[bool] = False,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Analyze ID Document.\n\nExtract field text and semantic values from a given ID document. The input document must be of\none of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027\nor \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri) of the\ndocument to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze ID Document.\n\nExtract field text and semantic values from a given ID document. The input document must be of\none of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027\nor \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri) of the\ndocument to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "include_text_details, pages, file_stream" }, "get_analyze_id_document_result" : { "sync": { "signature": "def get_analyze_id_document_result(\n self,\n result_id, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Get Analyze ID Document Result.\n\nTrack the progress and obtain the result of the analyze ID operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Analyze ID Document Result.\n\nTrack the progress and obtain the result of the analyze ID operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def get_analyze_id_document_result(\n self,\n result_id: str,\n **kwargs\n) -\u003e \"_models.AnalyzeOperationResult\":\n", - "doc": "\"\"\"Get Analyze ID Document Result.\n\nTrack the progress and obtain the result of the analyze ID operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Analyze ID Document Result.\n\nTrack the progress and obtain the result of the analyze ID operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "result_id" }, "_analyze_receipt_async_initial" : { "sync": { "signature": "def _analyze_receipt_async_initial(\n self,\n include_text_details=False, # type: Optional[bool]\n locale=None, # type: Optional[Union[str, \"_models.Locale\"]]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def _analyze_receipt_async_initial(\n self,\n include_text_details: Optional[bool] = False,\n locale: Optional[Union[str, \"_models.Locale\"]] = None,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "include_text_details, locale, pages, file_stream" }, "begin_analyze_receipt_async" : { "sync": { "signature": "def begin_analyze_receipt_async(\n self,\n include_text_details=False, # type: Optional[bool]\n locale=None, # type: Optional[Union[str, \"_models.Locale\"]]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Analyze Receipt.\n\nExtract field text and semantic values from a given receipt document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Receipt.\n\nExtract field text and semantic values from a given receipt document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_analyze_receipt_async(\n self,\n include_text_details: Optional[bool] = False,\n locale: Optional[Union[str, \"_models.Locale\"]] = None,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Analyze Receipt.\n\nExtract field text and semantic values from a given receipt document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Receipt.\n\nExtract field text and semantic values from a given receipt document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "include_text_details, locale, pages, file_stream" }, "get_analyze_receipt_result" : { "sync": { "signature": "def get_analyze_receipt_result(\n self,\n result_id, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Get Analyze Receipt Result.\n\nTrack the progress and obtain the result of the analyze receipt operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Analyze Receipt Result.\n\nTrack the progress and obtain the result of the analyze receipt operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def get_analyze_receipt_result(\n self,\n result_id: str,\n **kwargs\n) -\u003e \"_models.AnalyzeOperationResult\":\n", - "doc": "\"\"\"Get Analyze Receipt Result.\n\nTrack the progress and obtain the result of the analyze receipt operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Analyze Receipt Result.\n\nTrack the progress and obtain the result of the analyze receipt operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "result_id" }, "_analyze_layout_async_initial" : { "sync": { "signature": "def _analyze_layout_async_initial(\n self,\n pages=None, # type: Optional[List[str]]\n language=None, # type: Optional[Union[str, \"_models.Language\"]]\n reading_order=\"basic\", # type: Optional[Union[str, \"_models.ReadingOrder\"]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param language: Currently, only Afrikaans (\u2018af\u2019), Albanian (\u2018sq\u2019), Asturian (\u2018ast\u2019), Basque\n (\u2018eu\u2019), Bislama (\u2018bi\u2019), Breton (\u2018br\u2019), Catalan (\u2018ca\u2019), Cebuano (\u2018ceb\u2019), Chamorro (\u2018ch\u2019),\n Cornish (\u2018kw\u2019), Corsican (\u2018co\u2019), Crimean Tatar - Latin script(\u2018crh\u2019), Czech (\u2018cs\u2019), Danish\n (\u2018da\u2019), Dutch (\u2018nl\u2019), English (\u0027en\u0027), Estonian (\u2018et\u2019), Fijian (\u2018fj\u2019), Filipino (\u2018fil\u2019), Finnish\n (\u2018fi\u2019), French (\u2018fr\u2019), Friulian (\u2018fur\u2019), Galician (\u2018gl\u2019), German (\u2018de\u2019), Gilbertese (\u2018gil\u2019),\n Greenlandic (\u2018kl\u2019), Haitian Creole (\u2018ht\u2019), Hani (\u2018hni\u2019), Hmong Daw (\u2018mww\u2019), Hungarian (\u2018hu\u2019),\n Indonesian (\u2018id\u2019), Interlingua (\u2018ia\u2019), Inuktitut (\u2018iu\u2019), Irish (\u2018ga\u2019), Italian (\u2018it\u2019), Japanese\n (\u2018ja\u2019), Javanese (\u2018jv\u2019), Kabuverdianu (\u2018kea\u2019), Kachin (\u2018kac\u2019), Kara-Kalpak (\u2018kaa\u2019), Kashubian\n (\u2018csb\u2019), Khasi (\u2018kha\u2019), Korean (\u2018ko\u2019), Kurdish - Latin script (\u2018ku\u2019), K\u2019iche\u2019 (\u2018quc\u2019),\n Luxembourgish (\u2018lb\u2019), Malay (\u2018ms\u2019), Manx (\u2018gv\u2019), Neapolitan (\u2018nap\u2019), Norwegian (\u2018no\u2019), Occitan\n (\u2018oc\u2019), Polish (\u2018pl\u2019), Portuguese (\u2018pt\u2019), Romansh (\u2018rm\u2019), Scots (\u2018sco\u2019), Scottish Gaelic\n (\u2018gd\u2019), simplified Chinese (\u2018zh-Hans\u2019), Slovenian (\u2018sl\u2019), Spanish (\u2018es\u2019), Swahili (\u2018sw\u2019),\n Swedish (\u2018sv\u2019), Tatar - Latin script (\u2018tt\u2019), Tetum (\u2018tet\u2019), traditional Chinese (\u2018zh-Hant\u2019),\n Turkish (\u2018tr\u2019), Upper Sorbian (\u2018hsb\u2019), Uzbek (\u2018uz\u2019), Volap\u00fck (\u2018vo\u2019), Walser (\u2018wae\u2019), Western\n Frisian (\u2018fy\u2019), Yucatec Maya (\u2018yua\u2019), Zhuang (\u2018za\u2019) and Zulu (\u2018zu\u2019) are supported (print \u2013\n seventy-three languages and handwritten \u2013 English only). Layout supports auto language\n identification and multi language documents, so only provide a language code if you would like\n to force the documented to be processed as that specific language.\n:type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language\n:param reading_order: Reading order algorithm to sort the text lines returned. Supported\n reading orders include: basic(default), natural.\n:type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param language: Currently, only Afrikaans (\u2018af\u2019), Albanian (\u2018sq\u2019), Asturian (\u2018ast\u2019), Basque\n (\u2018eu\u2019), Bislama (\u2018bi\u2019), Breton (\u2018br\u2019), Catalan (\u2018ca\u2019), Cebuano (\u2018ceb\u2019), Chamorro (\u2018ch\u2019),\n Cornish (\u2018kw\u2019), Corsican (\u2018co\u2019), Crimean Tatar - Latin script(\u2018crh\u2019), Czech (\u2018cs\u2019), Danish\n (\u2018da\u2019), Dutch (\u2018nl\u2019), English (\u0027en\u0027), Estonian (\u2018et\u2019), Fijian (\u2018fj\u2019), Filipino (\u2018fil\u2019), Finnish\n (\u2018fi\u2019), French (\u2018fr\u2019), Friulian (\u2018fur\u2019), Galician (\u2018gl\u2019), German (\u2018de\u2019), Gilbertese (\u2018gil\u2019),\n Greenlandic (\u2018kl\u2019), Haitian Creole (\u2018ht\u2019), Hani (\u2018hni\u2019), Hmong Daw (\u2018mww\u2019), Hungarian (\u2018hu\u2019),\n Indonesian (\u2018id\u2019), Interlingua (\u2018ia\u2019), Inuktitut (\u2018iu\u2019), Irish (\u2018ga\u2019), Italian (\u2018it\u2019), Japanese\n (\u2018ja\u2019), Javanese (\u2018jv\u2019), Kabuverdianu (\u2018kea\u2019), Kachin (\u2018kac\u2019), Kara-Kalpak (\u2018kaa\u2019), Kashubian\n (\u2018csb\u2019), Khasi (\u2018kha\u2019), Korean (\u2018ko\u2019), Kurdish - Latin script (\u2018ku\u2019), K\u2019iche\u2019 (\u2018quc\u2019),\n Luxembourgish (\u2018lb\u2019), Malay (\u2018ms\u2019), Manx (\u2018gv\u2019), Neapolitan (\u2018nap\u2019), Norwegian (\u2018no\u2019), Occitan\n (\u2018oc\u2019), Polish (\u2018pl\u2019), Portuguese (\u2018pt\u2019), Romansh (\u2018rm\u2019), Scots (\u2018sco\u2019), Scottish Gaelic\n (\u2018gd\u2019), simplified Chinese (\u2018zh-Hans\u2019), Slovenian (\u2018sl\u2019), Spanish (\u2018es\u2019), Swahili (\u2018sw\u2019),\n Swedish (\u2018sv\u2019), Tatar - Latin script (\u2018tt\u2019), Tetum (\u2018tet\u2019), traditional Chinese (\u2018zh-Hant\u2019),\n Turkish (\u2018tr\u2019), Upper Sorbian (\u2018hsb\u2019), Uzbek (\u2018uz\u2019), Volap\u00fck (\u2018vo\u2019), Walser (\u2018wae\u2019), Western\n Frisian (\u2018fy\u2019), Yucatec Maya (\u2018yua\u2019), Zhuang (\u2018za\u2019) and Zulu (\u2018zu\u2019) are supported (print \u2013\n seventy-three languages and handwritten \u2013 English only). Layout supports auto language\n identification and multi language documents, so only provide a language code if you would like\n to force the documented to be processed as that specific language.\n:type language: str or ~azure.ai.formrecognizer.v2_1.models.Language\n:param reading_order: Reading order algorithm to sort the text lines returned. Supported\n reading orders include: basic(default), natural.\n:type reading_order: str or ~azure.ai.formrecognizer.v2_1.models.ReadingOrder\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def _analyze_layout_async_initial(\n self,\n pages: Optional[List[str]] = None,\n language: Optional[Union[str, \"_models.Language\"]] = None,\n reading_order: Optional[Union[str, \"_models.ReadingOrder\"]] = \"basic\",\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param language: Currently, only Afrikaans (\u2018af\u2019), Albanian (\u2018sq\u2019), Asturian (\u2018ast\u2019), Basque\n (\u2018eu\u2019), Bislama (\u2018bi\u2019), Breton (\u2018br\u2019), Catalan (\u2018ca\u2019), Cebuano (\u2018ceb\u2019), Chamorro (\u2018ch\u2019),\n Cornish (\u2018kw\u2019), Corsican (\u2018co\u2019), Crimean Tatar - Latin script(\u2018crh\u2019), Czech (\u2018cs\u2019), Danish\n (\u2018da\u2019), Dutch (\u2018nl\u2019), English (\u0027en\u0027), Estonian (\u2018et\u2019), Fijian (\u2018fj\u2019), Filipino (\u2018fil\u2019), Finnish\n (\u2018fi\u2019), French (\u2018fr\u2019), Friulian (\u2018fur\u2019), Galician (\u2018gl\u2019), German (\u2018de\u2019), Gilbertese (\u2018gil\u2019),\n Greenlandic (\u2018kl\u2019), Haitian Creole (\u2018ht\u2019), Hani (\u2018hni\u2019), Hmong Daw (\u2018mww\u2019), Hungarian (\u2018hu\u2019),\n Indonesian (\u2018id\u2019), Interlingua (\u2018ia\u2019), Inuktitut (\u2018iu\u2019), Irish (\u2018ga\u2019), Italian (\u2018it\u2019), Japanese\n (\u2018ja\u2019), Javanese (\u2018jv\u2019), Kabuverdianu (\u2018kea\u2019), Kachin (\u2018kac\u2019), Kara-Kalpak (\u2018kaa\u2019), Kashubian\n (\u2018csb\u2019), Khasi (\u2018kha\u2019), Korean (\u2018ko\u2019), Kurdish - Latin script (\u2018ku\u2019), K\u2019iche\u2019 (\u2018quc\u2019),\n Luxembourgish (\u2018lb\u2019), Malay (\u2018ms\u2019), Manx (\u2018gv\u2019), Neapolitan (\u2018nap\u2019), Norwegian (\u2018no\u2019), Occitan\n (\u2018oc\u2019), Polish (\u2018pl\u2019), Portuguese (\u2018pt\u2019), Romansh (\u2018rm\u2019), Scots (\u2018sco\u2019), Scottish Gaelic\n (\u2018gd\u2019), simplified Chinese (\u2018zh-Hans\u2019), Slovenian (\u2018sl\u2019), Spanish (\u2018es\u2019), Swahili (\u2018sw\u2019),\n Swedish (\u2018sv\u2019), Tatar - Latin script (\u2018tt\u2019), Tetum (\u2018tet\u2019), traditional Chinese (\u2018zh-Hant\u2019),\n Turkish (\u2018tr\u2019), Upper Sorbian (\u2018hsb\u2019), Uzbek (\u2018uz\u2019), Volap\u00fck (\u2018vo\u2019), Walser (\u2018wae\u2019), Western\n Frisian (\u2018fy\u2019), Yucatec Maya (\u2018yua\u2019), Zhuang (\u2018za\u2019) and Zulu (\u2018zu\u2019) are supported (print \u2013\n seventy-three languages and handwritten \u2013 English only). Layout supports auto language\n identification and multi language documents, so only provide a language code if you would like\n to force the documented to be processed as that specific language.\n:type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language\n:param reading_order: Reading order algorithm to sort the text lines returned. Supported\n reading orders include: basic(default), natural.\n:type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"\n\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param language: Currently, only Afrikaans (\u2018af\u2019), Albanian (\u2018sq\u2019), Asturian (\u2018ast\u2019), Basque\n (\u2018eu\u2019), Bislama (\u2018bi\u2019), Breton (\u2018br\u2019), Catalan (\u2018ca\u2019), Cebuano (\u2018ceb\u2019), Chamorro (\u2018ch\u2019),\n Cornish (\u2018kw\u2019), Corsican (\u2018co\u2019), Crimean Tatar - Latin script(\u2018crh\u2019), Czech (\u2018cs\u2019), Danish\n (\u2018da\u2019), Dutch (\u2018nl\u2019), English (\u0027en\u0027), Estonian (\u2018et\u2019), Fijian (\u2018fj\u2019), Filipino (\u2018fil\u2019), Finnish\n (\u2018fi\u2019), French (\u2018fr\u2019), Friulian (\u2018fur\u2019), Galician (\u2018gl\u2019), German (\u2018de\u2019), Gilbertese (\u2018gil\u2019),\n Greenlandic (\u2018kl\u2019), Haitian Creole (\u2018ht\u2019), Hani (\u2018hni\u2019), Hmong Daw (\u2018mww\u2019), Hungarian (\u2018hu\u2019),\n Indonesian (\u2018id\u2019), Interlingua (\u2018ia\u2019), Inuktitut (\u2018iu\u2019), Irish (\u2018ga\u2019), Italian (\u2018it\u2019), Japanese\n (\u2018ja\u2019), Javanese (\u2018jv\u2019), Kabuverdianu (\u2018kea\u2019), Kachin (\u2018kac\u2019), Kara-Kalpak (\u2018kaa\u2019), Kashubian\n (\u2018csb\u2019), Khasi (\u2018kha\u2019), Korean (\u2018ko\u2019), Kurdish - Latin script (\u2018ku\u2019), K\u2019iche\u2019 (\u2018quc\u2019),\n Luxembourgish (\u2018lb\u2019), Malay (\u2018ms\u2019), Manx (\u2018gv\u2019), Neapolitan (\u2018nap\u2019), Norwegian (\u2018no\u2019), Occitan\n (\u2018oc\u2019), Polish (\u2018pl\u2019), Portuguese (\u2018pt\u2019), Romansh (\u2018rm\u2019), Scots (\u2018sco\u2019), Scottish Gaelic\n (\u2018gd\u2019), simplified Chinese (\u2018zh-Hans\u2019), Slovenian (\u2018sl\u2019), Spanish (\u2018es\u2019), Swahili (\u2018sw\u2019),\n Swedish (\u2018sv\u2019), Tatar - Latin script (\u2018tt\u2019), Tetum (\u2018tet\u2019), traditional Chinese (\u2018zh-Hant\u2019),\n Turkish (\u2018tr\u2019), Upper Sorbian (\u2018hsb\u2019), Uzbek (\u2018uz\u2019), Volap\u00fck (\u2018vo\u2019), Walser (\u2018wae\u2019), Western\n Frisian (\u2018fy\u2019), Yucatec Maya (\u2018yua\u2019), Zhuang (\u2018za\u2019) and Zulu (\u2018zu\u2019) are supported (print \u2013\n seventy-three languages and handwritten \u2013 English only). Layout supports auto language\n identification and multi language documents, so only provide a language code if you would like\n to force the documented to be processed as that specific language.\n:type language: str or ~azure.ai.formrecognizer.v2_1.models.Language\n:param reading_order: Reading order algorithm to sort the text lines returned. Supported\n reading orders include: basic(default), natural.\n:type reading_order: str or ~azure.ai.formrecognizer.v2_1.models.ReadingOrder\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "pages, language, reading_order, file_stream" }, "begin_analyze_layout_async" : { "sync": { "signature": "def begin_analyze_layout_async(\n self,\n pages=None, # type: Optional[List[str]]\n language=None, # type: Optional[Union[str, \"_models.Language\"]]\n reading_order=\"basic\", # type: Optional[Union[str, \"_models.ReadingOrder\"]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Analyze Layout.\n\nExtract text and layout information from a given document. The input document must be of one of\nthe supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027 or\n\u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param language: Currently, only Afrikaans (\u2018af\u2019), Albanian (\u2018sq\u2019), Asturian (\u2018ast\u2019), Basque\n (\u2018eu\u2019), Bislama (\u2018bi\u2019), Breton (\u2018br\u2019), Catalan (\u2018ca\u2019), Cebuano (\u2018ceb\u2019), Chamorro (\u2018ch\u2019),\n Cornish (\u2018kw\u2019), Corsican (\u2018co\u2019), Crimean Tatar - Latin script(\u2018crh\u2019), Czech (\u2018cs\u2019), Danish\n (\u2018da\u2019), Dutch (\u2018nl\u2019), English (\u0027en\u0027), Estonian (\u2018et\u2019), Fijian (\u2018fj\u2019), Filipino (\u2018fil\u2019), Finnish\n (\u2018fi\u2019), French (\u2018fr\u2019), Friulian (\u2018fur\u2019), Galician (\u2018gl\u2019), German (\u2018de\u2019), Gilbertese (\u2018gil\u2019),\n Greenlandic (\u2018kl\u2019), Haitian Creole (\u2018ht\u2019), Hani (\u2018hni\u2019), Hmong Daw (\u2018mww\u2019), Hungarian (\u2018hu\u2019),\n Indonesian (\u2018id\u2019), Interlingua (\u2018ia\u2019), Inuktitut (\u2018iu\u2019), Irish (\u2018ga\u2019), Italian (\u2018it\u2019), Japanese\n (\u2018ja\u2019), Javanese (\u2018jv\u2019), Kabuverdianu (\u2018kea\u2019), Kachin (\u2018kac\u2019), Kara-Kalpak (\u2018kaa\u2019), Kashubian\n (\u2018csb\u2019), Khasi (\u2018kha\u2019), Korean (\u2018ko\u2019), Kurdish - Latin script (\u2018ku\u2019), K\u2019iche\u2019 (\u2018quc\u2019),\n Luxembourgish (\u2018lb\u2019), Malay (\u2018ms\u2019), Manx (\u2018gv\u2019), Neapolitan (\u2018nap\u2019), Norwegian (\u2018no\u2019), Occitan\n (\u2018oc\u2019), Polish (\u2018pl\u2019), Portuguese (\u2018pt\u2019), Romansh (\u2018rm\u2019), Scots (\u2018sco\u2019), Scottish Gaelic\n (\u2018gd\u2019), simplified Chinese (\u2018zh-Hans\u2019), Slovenian (\u2018sl\u2019), Spanish (\u2018es\u2019), Swahili (\u2018sw\u2019),\n Swedish (\u2018sv\u2019), Tatar - Latin script (\u2018tt\u2019), Tetum (\u2018tet\u2019), traditional Chinese (\u2018zh-Hant\u2019),\n Turkish (\u2018tr\u2019), Upper Sorbian (\u2018hsb\u2019), Uzbek (\u2018uz\u2019), Volap\u00fck (\u2018vo\u2019), Walser (\u2018wae\u2019), Western\n Frisian (\u2018fy\u2019), Yucatec Maya (\u2018yua\u2019), Zhuang (\u2018za\u2019) and Zulu (\u2018zu\u2019) are supported (print \u2013\n seventy-three languages and handwritten \u2013 English only). Layout supports auto language\n identification and multi language documents, so only provide a language code if you would like\n to force the documented to be processed as that specific language.\n:type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language\n:param reading_order: Reading order algorithm to sort the text lines returned. Supported\n reading orders include: basic(default), natural.\n:type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Layout.\n\nExtract text and layout information from a given document. The input document must be of one of\nthe supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027 or\n\u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param language: Currently, only Afrikaans (\u2018af\u2019), Albanian (\u2018sq\u2019), Asturian (\u2018ast\u2019), Basque\n (\u2018eu\u2019), Bislama (\u2018bi\u2019), Breton (\u2018br\u2019), Catalan (\u2018ca\u2019), Cebuano (\u2018ceb\u2019), Chamorro (\u2018ch\u2019),\n Cornish (\u2018kw\u2019), Corsican (\u2018co\u2019), Crimean Tatar - Latin script(\u2018crh\u2019), Czech (\u2018cs\u2019), Danish\n (\u2018da\u2019), Dutch (\u2018nl\u2019), English (\u0027en\u0027), Estonian (\u2018et\u2019), Fijian (\u2018fj\u2019), Filipino (\u2018fil\u2019), Finnish\n (\u2018fi\u2019), French (\u2018fr\u2019), Friulian (\u2018fur\u2019), Galician (\u2018gl\u2019), German (\u2018de\u2019), Gilbertese (\u2018gil\u2019),\n Greenlandic (\u2018kl\u2019), Haitian Creole (\u2018ht\u2019), Hani (\u2018hni\u2019), Hmong Daw (\u2018mww\u2019), Hungarian (\u2018hu\u2019),\n Indonesian (\u2018id\u2019), Interlingua (\u2018ia\u2019), Inuktitut (\u2018iu\u2019), Irish (\u2018ga\u2019), Italian (\u2018it\u2019), Japanese\n (\u2018ja\u2019), Javanese (\u2018jv\u2019), Kabuverdianu (\u2018kea\u2019), Kachin (\u2018kac\u2019), Kara-Kalpak (\u2018kaa\u2019), Kashubian\n (\u2018csb\u2019), Khasi (\u2018kha\u2019), Korean (\u2018ko\u2019), Kurdish - Latin script (\u2018ku\u2019), K\u2019iche\u2019 (\u2018quc\u2019),\n Luxembourgish (\u2018lb\u2019), Malay (\u2018ms\u2019), Manx (\u2018gv\u2019), Neapolitan (\u2018nap\u2019), Norwegian (\u2018no\u2019), Occitan\n (\u2018oc\u2019), Polish (\u2018pl\u2019), Portuguese (\u2018pt\u2019), Romansh (\u2018rm\u2019), Scots (\u2018sco\u2019), Scottish Gaelic\n (\u2018gd\u2019), simplified Chinese (\u2018zh-Hans\u2019), Slovenian (\u2018sl\u2019), Spanish (\u2018es\u2019), Swahili (\u2018sw\u2019),\n Swedish (\u2018sv\u2019), Tatar - Latin script (\u2018tt\u2019), Tetum (\u2018tet\u2019), traditional Chinese (\u2018zh-Hant\u2019),\n Turkish (\u2018tr\u2019), Upper Sorbian (\u2018hsb\u2019), Uzbek (\u2018uz\u2019), Volap\u00fck (\u2018vo\u2019), Walser (\u2018wae\u2019), Western\n Frisian (\u2018fy\u2019), Yucatec Maya (\u2018yua\u2019), Zhuang (\u2018za\u2019) and Zulu (\u2018zu\u2019) are supported (print \u2013\n seventy-three languages and handwritten \u2013 English only). Layout supports auto language\n identification and multi language documents, so only provide a language code if you would like\n to force the documented to be processed as that specific language.\n:type language: str or ~azure.ai.formrecognizer.v2_1.models.Language\n:param reading_order: Reading order algorithm to sort the text lines returned. Supported\n reading orders include: basic(default), natural.\n:type reading_order: str or ~azure.ai.formrecognizer.v2_1.models.ReadingOrder\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_analyze_layout_async(\n self,\n pages: Optional[List[str]] = None,\n language: Optional[Union[str, \"_models.Language\"]] = None,\n reading_order: Optional[Union[str, \"_models.ReadingOrder\"]] = \"basic\",\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Analyze Layout.\n\nExtract text and layout information from a given document. The input document must be of one of\nthe supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027 or\n\u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param language: Currently, only Afrikaans (\u2018af\u2019), Albanian (\u2018sq\u2019), Asturian (\u2018ast\u2019), Basque\n (\u2018eu\u2019), Bislama (\u2018bi\u2019), Breton (\u2018br\u2019), Catalan (\u2018ca\u2019), Cebuano (\u2018ceb\u2019), Chamorro (\u2018ch\u2019),\n Cornish (\u2018kw\u2019), Corsican (\u2018co\u2019), Crimean Tatar - Latin script(\u2018crh\u2019), Czech (\u2018cs\u2019), Danish\n (\u2018da\u2019), Dutch (\u2018nl\u2019), English (\u0027en\u0027), Estonian (\u2018et\u2019), Fijian (\u2018fj\u2019), Filipino (\u2018fil\u2019), Finnish\n (\u2018fi\u2019), French (\u2018fr\u2019), Friulian (\u2018fur\u2019), Galician (\u2018gl\u2019), German (\u2018de\u2019), Gilbertese (\u2018gil\u2019),\n Greenlandic (\u2018kl\u2019), Haitian Creole (\u2018ht\u2019), Hani (\u2018hni\u2019), Hmong Daw (\u2018mww\u2019), Hungarian (\u2018hu\u2019),\n Indonesian (\u2018id\u2019), Interlingua (\u2018ia\u2019), Inuktitut (\u2018iu\u2019), Irish (\u2018ga\u2019), Italian (\u2018it\u2019), Japanese\n (\u2018ja\u2019), Javanese (\u2018jv\u2019), Kabuverdianu (\u2018kea\u2019), Kachin (\u2018kac\u2019), Kara-Kalpak (\u2018kaa\u2019), Kashubian\n (\u2018csb\u2019), Khasi (\u2018kha\u2019), Korean (\u2018ko\u2019), Kurdish - Latin script (\u2018ku\u2019), K\u2019iche\u2019 (\u2018quc\u2019),\n Luxembourgish (\u2018lb\u2019), Malay (\u2018ms\u2019), Manx (\u2018gv\u2019), Neapolitan (\u2018nap\u2019), Norwegian (\u2018no\u2019), Occitan\n (\u2018oc\u2019), Polish (\u2018pl\u2019), Portuguese (\u2018pt\u2019), Romansh (\u2018rm\u2019), Scots (\u2018sco\u2019), Scottish Gaelic\n (\u2018gd\u2019), simplified Chinese (\u2018zh-Hans\u2019), Slovenian (\u2018sl\u2019), Spanish (\u2018es\u2019), Swahili (\u2018sw\u2019),\n Swedish (\u2018sv\u2019), Tatar - Latin script (\u2018tt\u2019), Tetum (\u2018tet\u2019), traditional Chinese (\u2018zh-Hant\u2019),\n Turkish (\u2018tr\u2019), Upper Sorbian (\u2018hsb\u2019), Uzbek (\u2018uz\u2019), Volap\u00fck (\u2018vo\u2019), Walser (\u2018wae\u2019), Western\n Frisian (\u2018fy\u2019), Yucatec Maya (\u2018yua\u2019), Zhuang (\u2018za\u2019) and Zulu (\u2018zu\u2019) are supported (print \u2013\n seventy-three languages and handwritten \u2013 English only). Layout supports auto language\n identification and multi language documents, so only provide a language code if you would like\n to force the documented to be processed as that specific language.\n:type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language\n:param reading_order: Reading order algorithm to sort the text lines returned. Supported\n reading orders include: basic(default), natural.\n:type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "doc": "\"\"\"Analyze Layout.\n\nExtract text and layout information from a given document. The input document must be of one of\nthe supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027 or\n\u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param language: Currently, only Afrikaans (\u2018af\u2019), Albanian (\u2018sq\u2019), Asturian (\u2018ast\u2019), Basque\n (\u2018eu\u2019), Bislama (\u2018bi\u2019), Breton (\u2018br\u2019), Catalan (\u2018ca\u2019), Cebuano (\u2018ceb\u2019), Chamorro (\u2018ch\u2019),\n Cornish (\u2018kw\u2019), Corsican (\u2018co\u2019), Crimean Tatar - Latin script(\u2018crh\u2019), Czech (\u2018cs\u2019), Danish\n (\u2018da\u2019), Dutch (\u2018nl\u2019), English (\u0027en\u0027), Estonian (\u2018et\u2019), Fijian (\u2018fj\u2019), Filipino (\u2018fil\u2019), Finnish\n (\u2018fi\u2019), French (\u2018fr\u2019), Friulian (\u2018fur\u2019), Galician (\u2018gl\u2019), German (\u2018de\u2019), Gilbertese (\u2018gil\u2019),\n Greenlandic (\u2018kl\u2019), Haitian Creole (\u2018ht\u2019), Hani (\u2018hni\u2019), Hmong Daw (\u2018mww\u2019), Hungarian (\u2018hu\u2019),\n Indonesian (\u2018id\u2019), Interlingua (\u2018ia\u2019), Inuktitut (\u2018iu\u2019), Irish (\u2018ga\u2019), Italian (\u2018it\u2019), Japanese\n (\u2018ja\u2019), Javanese (\u2018jv\u2019), Kabuverdianu (\u2018kea\u2019), Kachin (\u2018kac\u2019), Kara-Kalpak (\u2018kaa\u2019), Kashubian\n (\u2018csb\u2019), Khasi (\u2018kha\u2019), Korean (\u2018ko\u2019), Kurdish - Latin script (\u2018ku\u2019), K\u2019iche\u2019 (\u2018quc\u2019),\n Luxembourgish (\u2018lb\u2019), Malay (\u2018ms\u2019), Manx (\u2018gv\u2019), Neapolitan (\u2018nap\u2019), Norwegian (\u2018no\u2019), Occitan\n (\u2018oc\u2019), Polish (\u2018pl\u2019), Portuguese (\u2018pt\u2019), Romansh (\u2018rm\u2019), Scots (\u2018sco\u2019), Scottish Gaelic\n (\u2018gd\u2019), simplified Chinese (\u2018zh-Hans\u2019), Slovenian (\u2018sl\u2019), Spanish (\u2018es\u2019), Swahili (\u2018sw\u2019),\n Swedish (\u2018sv\u2019), Tatar - Latin script (\u2018tt\u2019), Tetum (\u2018tet\u2019), traditional Chinese (\u2018zh-Hant\u2019),\n Turkish (\u2018tr\u2019), Upper Sorbian (\u2018hsb\u2019), Uzbek (\u2018uz\u2019), Volap\u00fck (\u2018vo\u2019), Walser (\u2018wae\u2019), Western\n Frisian (\u2018fy\u2019), Yucatec Maya (\u2018yua\u2019), Zhuang (\u2018za\u2019) and Zulu (\u2018zu\u2019) are supported (print \u2013\n seventy-three languages and handwritten \u2013 English only). Layout supports auto language\n identification and multi language documents, so only provide a language code if you would like\n to force the documented to be processed as that specific language.\n:type language: str or ~azure.ai.formrecognizer.v2_1.models.Language\n:param reading_order: Reading order algorithm to sort the text lines returned. Supported\n reading orders include: basic(default), natural.\n:type reading_order: str or ~azure.ai.formrecognizer.v2_1.models.ReadingOrder\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "pages, language, reading_order, file_stream" }, "get_analyze_layout_result" : { "sync": { "signature": "def get_analyze_layout_result(\n self,\n result_id, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Get Analyze Layout Result.\n\nTrack the progress and obtain the result of the analyze layout operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Analyze Layout Result.\n\nTrack the progress and obtain the result of the analyze layout operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def get_analyze_layout_result(\n self,\n result_id: str,\n **kwargs\n) -\u003e \"_models.AnalyzeOperationResult\":\n", - "doc": "\"\"\"Get Analyze Layout Result.\n\nTrack the progress and obtain the result of the analyze layout operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Analyze Layout Result.\n\nTrack the progress and obtain the result of the analyze layout operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "result_id" }, "list_custom_models" : { "sync": { "signature": "def list_custom_models(\n self,\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"List Custom Models.\n\nGet information about all custom models.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Models or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.ai.formrecognizer.v2_1_preview_3.models.Models]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"List Custom Models.\n\nGet information about all custom models.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Models or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.ai.formrecognizer.v2_1.models.Models]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, "signature": "def list_custom_models(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.Models\"]:\n", - "doc": "\"\"\"List Custom Models.\n\nGet information about all custom models.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Models or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.formrecognizer.v2_1_preview_3.models.Models]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"List Custom Models.\n\nGet information about all custom models.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Models or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.formrecognizer.v2_1.models.Models]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "" }, "get_custom_models" : { "sync": { "signature": "def get_custom_models(\n self,\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Get Custom Models.\n\nGet information about all custom models.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Models, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Models\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Custom Models.\n\nGet information about all custom models.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Models, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.Models\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def get_custom_models(\n self,\n **kwargs\n) -\u003e \"_models.Models\":\n", - "doc": "\"\"\"Get Custom Models.\n\nGet information about all custom models.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Models, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Models\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Get Custom Models.\n\nGet information about all custom models.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Models, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1.models.Models\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "" } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/__init__.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/aio/__init__.py similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/__init__.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/aio/__init__.py diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/_configuration.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/aio/_configuration.py similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/_configuration.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/aio/_configuration.py diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/_form_recognizer_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/aio/_form_recognizer_client.py similarity index 98% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/_form_recognizer_client.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/aio/_form_recognizer_client.py index b7244d5e518b..8bc39cd2bace 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/_form_recognizer_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/aio/_form_recognizer_client.py @@ -37,7 +37,7 @@ def __init__( endpoint: str, **kwargs: Any ) -> None: - base_url = '{endpoint}/formrecognizer/v2.1-preview.3' + base_url = '{endpoint}/formrecognizer/v2.1' self._config = FormRecognizerClientConfiguration(credential, endpoint, **kwargs) self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/operations/__init__.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/aio/operations/__init__.py similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/operations/__init__.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/aio/operations/__init__.py diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/operations/_form_recognizer_client_operations.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/aio/operations/_form_recognizer_client_operations.py similarity index 95% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/operations/_form_recognizer_client_operations.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/aio/operations/_form_recognizer_client_operations.py index c7144db47041..e690c8f1d142 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/operations/_form_recognizer_client_operations.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/aio/operations/_form_recognizer_client_operations.py @@ -88,18 +88,18 @@ async def begin_train_custom_model_async( or 'image/bmp'. Other type of content is ignored. :param train_request: Training request parameters. - :type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest + :type train_request: ~azure.ai.formrecognizer.v2_1.models.TrainRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -154,7 +154,7 @@ async def get_custom_model( :type include_keys: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: Model, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Model + :rtype: ~azure.ai.formrecognizer.v2_1.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] @@ -342,20 +342,20 @@ async def begin_analyze_with_custom_model( range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -414,7 +414,7 @@ async def get_analyze_form_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] @@ -521,18 +521,18 @@ async def begin_copy_custom_model( :param model_id: Model identifier. :type model_id: str :param copy_request: Copy request parameters. - :type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest + :type copy_request: ~azure.ai.formrecognizer.v2_1.models.CopyRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -589,7 +589,7 @@ async def get_custom_model_copy_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CopyOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.CopyOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CopyOperationResult"] @@ -642,7 +642,7 @@ async def generate_model_copy_authorization( :keyword callable cls: A custom type or function that will be passed the direct response :return: CopyAuthorizationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.CopyAuthorizationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CopyAuthorizationResult"] @@ -745,18 +745,18 @@ async def begin_compose_custom_models_async( It would validate limit of models put together. :param compose_request: Compose models. - :type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest + :type compose_request: ~azure.ai.formrecognizer.v2_1.models.ComposeRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -882,26 +882,26 @@ async def begin_analyze_business_card_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -956,7 +956,7 @@ async def get_analyze_business_card_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] @@ -1085,26 +1085,26 @@ async def begin_analyze_invoice_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1159,7 +1159,7 @@ async def get_analyze_invoice_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] @@ -1287,20 +1287,20 @@ async def begin_analyze_id_document_async( range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1354,7 +1354,7 @@ async def get_analyze_id_document_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] @@ -1483,26 +1483,26 @@ async def begin_analyze_receipt_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1557,7 +1557,7 @@ async def get_analyze_receipt_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] @@ -1704,25 +1704,25 @@ async def begin_analyze_layout_async( seventy-three languages and handwritten – English only). Layout supports auto language identification and multi language documents, so only provide a language code if you would like to force the documented to be processed as that specific language. - :type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language + :type language: str or ~azure.ai.formrecognizer.v2_1.models.Language :param reading_order: Reading order algorithm to sort the text lines returned. Supported reading orders include: basic(default), natural. - :type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder + :type reading_order: str or ~azure.ai.formrecognizer.v2_1.models.ReadingOrder :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1777,7 +1777,7 @@ async def get_analyze_layout_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] @@ -1829,7 +1829,7 @@ def list_custom_models( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Models or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.formrecognizer.v2_1_preview_3.models.Models] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.formrecognizer.v2_1.models.Models] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Models"] @@ -1902,7 +1902,7 @@ async def get_custom_models( :keyword callable cls: A custom type or function that will be passed the direct response :return: Models, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Models + :rtype: ~azure.ai.formrecognizer.v2_1.models.Models :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Models"] diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/__init__.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/models/__init__.py similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/__init__.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/models/__init__.py diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_form_recognizer_client_enums.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/models/_form_recognizer_client_enums.py similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_form_recognizer_client_enums.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/models/_form_recognizer_client_enums.py diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/models/_models.py similarity index 92% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/models/_models.py index 7490488d77be..d170074aefc5 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/models/_models.py @@ -17,14 +17,14 @@ class AnalyzeOperationResult(msrest.serialization.Model): :param status: Required. Operation status. Possible values include: "notStarted", "running", "succeeded", "failed". - :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.OperationStatus + :type status: str or ~azure.ai.formrecognizer.v2_1.models.OperationStatus :param created_date_time: Required. Date and time (UTC) when the analyze operation was submitted. :type created_date_time: ~datetime.datetime :param last_updated_date_time: Required. Date and time (UTC) when the status was last updated. :type last_updated_date_time: ~datetime.datetime :param analyze_result: Results of the analyze operation. - :type analyze_result: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeResult + :type analyze_result: ~azure.ai.formrecognizer.v2_1.models.AnalyzeResult """ _validation = { @@ -59,13 +59,13 @@ class AnalyzeResult(msrest.serialization.Model): :param version: Required. Version of schema used for this result. :type version: str :param read_results: Required. Text extracted from the input. - :type read_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ReadResult] + :type read_results: list[~azure.ai.formrecognizer.v2_1.models.ReadResult] :param page_results: Page-level information extracted from the input. - :type page_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.PageResult] + :type page_results: list[~azure.ai.formrecognizer.v2_1.models.PageResult] :param document_results: Document-level information extracted from the input. - :type document_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.DocumentResult] + :type document_results: list[~azure.ai.formrecognizer.v2_1.models.DocumentResult] :param errors: List of errors reported during the analyze operation. - :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + :type errors: list[~azure.ai.formrecognizer.v2_1.models.ErrorInformation] """ _validation = { @@ -99,7 +99,7 @@ class Appearance(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param style: Required. An object representing the style of the text line. - :type style: ~azure.ai.formrecognizer.v2_1_preview_3.models.Style + :type style: ~azure.ai.formrecognizer.v2_1.models.Style """ _validation = { @@ -209,13 +209,13 @@ class CopyOperationResult(msrest.serialization.Model): :param status: Required. Operation status. Possible values include: "notStarted", "running", "succeeded", "failed". - :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.OperationStatus + :type status: str or ~azure.ai.formrecognizer.v2_1.models.OperationStatus :param created_date_time: Required. Date and time (UTC) when the copy operation was submitted. :type created_date_time: ~datetime.datetime :param last_updated_date_time: Required. Date and time (UTC) when the status was last updated. :type last_updated_date_time: ~datetime.datetime :param copy_result: Results of the copy operation. - :type copy_result: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyResult + :type copy_result: ~azure.ai.formrecognizer.v2_1.models.CopyResult """ _validation = { @@ -254,8 +254,7 @@ class CopyRequest(msrest.serialization.Model): region name supported by Cognitive Services. :type target_resource_region: str :param copy_authorization: Required. Entity that encodes claims to authorize the copy request. - :type copy_authorization: - ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult + :type copy_authorization: ~azure.ai.formrecognizer.v2_1.models.CopyAuthorizationResult """ _validation = { @@ -288,7 +287,7 @@ class CopyResult(msrest.serialization.Model): :param model_id: Required. Identifier of the target model. :type model_id: str :param errors: Errors returned during the copy operation. - :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + :type errors: list[~azure.ai.formrecognizer.v2_1.models.ErrorInformation] """ _validation = { @@ -319,7 +318,7 @@ class DataTable(msrest.serialization.Model): :param columns: Required. Number of columns. :type columns: int :param cells: Required. List of cells contained in the table. - :type cells: list[~azure.ai.formrecognizer.v2_1_preview_3.models.DataTableCell] + :type cells: list[~azure.ai.formrecognizer.v2_1.models.DataTableCell] :param bounding_box: Required. Bounding box of the table. :type bounding_box: list[float] """ @@ -431,7 +430,7 @@ class DocumentResult(msrest.serialization.Model): :param doc_type_confidence: Predicted document type confidence. :type doc_type_confidence: float :param fields: Required. Dictionary of named field values. - :type fields: dict[str, ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValue] + :type fields: dict[str, ~azure.ai.formrecognizer.v2_1.models.FieldValue] """ _validation = { @@ -497,7 +496,7 @@ class ErrorResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param error: Required. - :type error: ~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation + :type error: ~azure.ai.formrecognizer.v2_1.models.ErrorInformation """ _validation = { @@ -523,7 +522,7 @@ class FieldValue(msrest.serialization.Model): :param type: Required. Type of field value. Possible values include: "string", "date", "time", "phoneNumber", "number", "integer", "array", "object", "selectionMark", "gender", "country". - :type type: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValueType + :type type: str or ~azure.ai.formrecognizer.v2_1.models.FieldValueType :param value_string: String value. :type value_string: str :param value_date: Date value. @@ -537,15 +536,14 @@ class FieldValue(msrest.serialization.Model): :param value_integer: Integer value. :type value_integer: int :param value_array: Array of field values. - :type value_array: list[~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValue] + :type value_array: list[~azure.ai.formrecognizer.v2_1.models.FieldValue] :param value_object: Dictionary of named field values. - :type value_object: dict[str, ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValue] + :type value_object: dict[str, ~azure.ai.formrecognizer.v2_1.models.FieldValue] :param value_selection_mark: Selection mark value. Possible values include: "selected", "unselected". - :type value_selection_mark: str or - ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValueSelectionMark + :type value_selection_mark: str or ~azure.ai.formrecognizer.v2_1.models.FieldValueSelectionMark :param value_gender: Gender value: M, F, or X. Possible values include: "M", "F", "X". - :type value_gender: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValueGender + :type value_gender: str or ~azure.ai.formrecognizer.v2_1.models.FieldValueGender :param value_country: 3-letter country code (ISO 3166-1 alpha-3). :type value_country: str :param text: Text content of the extracted field. @@ -674,7 +672,7 @@ class KeyValueElement(msrest.serialization.Model): :param type: Semantic data type of the key value element. Possible values include: "string", "selectionMark". - :type type: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValueType + :type type: str or ~azure.ai.formrecognizer.v2_1.models.KeyValueType :param text: Required. The text content of the key or value. :type text: str :param bounding_box: Bounding box of the key or value. @@ -715,9 +713,9 @@ class KeyValuePair(msrest.serialization.Model): :param label: A user defined label for the key/value pair entry. :type label: str :param key: Required. Information about the extracted key in a key-value pair. - :type key: ~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValueElement + :type key: ~azure.ai.formrecognizer.v2_1.models.KeyValueElement :param value: Required. Information about the extracted value in a key-value pair. - :type value: ~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValueElement + :type value: ~azure.ai.formrecognizer.v2_1.models.KeyValueElement :param confidence: Required. Confidence value. :type confidence: float """ @@ -752,13 +750,13 @@ class Model(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param model_info: Required. Basic custom model information. - :type model_info: ~azure.ai.formrecognizer.v2_1_preview_3.models.ModelInfo + :type model_info: ~azure.ai.formrecognizer.v2_1.models.ModelInfo :param keys: Keys extracted by the custom model. - :type keys: ~azure.ai.formrecognizer.v2_1_preview_3.models.KeysResult + :type keys: ~azure.ai.formrecognizer.v2_1.models.KeysResult :param train_result: Training result for custom model. - :type train_result: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainResult + :type train_result: ~azure.ai.formrecognizer.v2_1.models.TrainResult :param composed_train_results: Training result for composed model. - :type composed_train_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.TrainResult] + :type composed_train_results: list[~azure.ai.formrecognizer.v2_1.models.TrainResult] """ _validation = { @@ -792,7 +790,7 @@ class ModelInfo(msrest.serialization.Model): :type model_id: str :param status: Required. Status of the model. Possible values include: "creating", "ready", "invalid". - :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ModelStatus + :type status: str or ~azure.ai.formrecognizer.v2_1.models.ModelStatus :param created_date_time: Required. Date and time (UTC) when the model was created. :type created_date_time: ~datetime.datetime :param last_updated_date_time: Required. Date and time (UTC) when the status was last updated. @@ -800,7 +798,7 @@ class ModelInfo(msrest.serialization.Model): :param model_name: Optional user defined model name (max length: 1024). :type model_name: str :param attributes: Optional model attributes. - :type attributes: ~azure.ai.formrecognizer.v2_1_preview_3.models.Attributes + :type attributes: ~azure.ai.formrecognizer.v2_1.models.Attributes """ _validation = { @@ -836,9 +834,9 @@ class Models(msrest.serialization.Model): """Response to the list custom models operation. :param summary: Summary of all trained custom models. - :type summary: ~azure.ai.formrecognizer.v2_1_preview_3.models.ModelsSummary + :type summary: ~azure.ai.formrecognizer.v2_1.models.ModelsSummary :param model_list: Collection of trained custom models. - :type model_list: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ModelInfo] + :type model_list: list[~azure.ai.formrecognizer.v2_1.models.ModelInfo] :param next_link: Link to the next page of custom models. :type next_link: str """ @@ -904,9 +902,9 @@ class PageResult(msrest.serialization.Model): :param cluster_id: Cluster identifier. :type cluster_id: int :param key_value_pairs: List of key-value pairs extracted from the page. - :type key_value_pairs: list[~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValuePair] + :type key_value_pairs: list[~azure.ai.formrecognizer.v2_1.models.KeyValuePair] :param tables: List of data tables extracted from the page. - :type tables: list[~azure.ai.formrecognizer.v2_1_preview_3.models.DataTable] + :type tables: list[~azure.ai.formrecognizer.v2_1.models.DataTable] """ _validation = { @@ -949,15 +947,15 @@ class ReadResult(msrest.serialization.Model): :param unit: Required. The unit used by the width, height and boundingBox properties. For images, the unit is "pixel". For PDF, the unit is "inch". Possible values include: "pixel", "inch". - :type unit: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.LengthUnit + :type unit: str or ~azure.ai.formrecognizer.v2_1.models.LengthUnit :param lines: When includeTextDetails is set to true, a list of recognized text lines. The maximum number of lines returned is 300 per page. The lines are sorted top to bottom, left to right, although in certain cases proximity is treated with higher priority. As the sorting order depends on the detected text, it may change across images and OCR version updates. Thus, business logic should be built upon the actual line location instead of order. - :type lines: list[~azure.ai.formrecognizer.v2_1_preview_3.models.TextLine] + :type lines: list[~azure.ai.formrecognizer.v2_1.models.TextLine] :param selection_marks: List of selection marks extracted from the page. - :type selection_marks: list[~azure.ai.formrecognizer.v2_1_preview_3.models.SelectionMark] + :type selection_marks: list[~azure.ai.formrecognizer.v2_1.models.SelectionMark] """ _validation = { @@ -1003,7 +1001,7 @@ class SelectionMark(msrest.serialization.Model): :type confidence: float :param state: Required. State of the selection mark. Possible values include: "selected", "unselected". - :type state: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.SelectionMarkState + :type state: str or ~azure.ai.formrecognizer.v2_1.models.SelectionMarkState """ _validation = { @@ -1058,7 +1056,7 @@ class Style(msrest.serialization.Model): :param name: Required. The text line style name, including handwriting and other. Possible values include: "other", "handwriting". - :type name: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.TextStyle + :type name: str or ~azure.ai.formrecognizer.v2_1.models.TextStyle :param confidence: Required. The confidence of text line style. :type confidence: float """ @@ -1092,9 +1090,9 @@ class TextLine(msrest.serialization.Model): :param bounding_box: Required. Bounding box of an extracted line. :type bounding_box: list[float] :param words: Required. List of words in the text line. - :type words: list[~azure.ai.formrecognizer.v2_1_preview_3.models.TextWord] + :type words: list[~azure.ai.formrecognizer.v2_1.models.TextWord] :param appearance: Text appearance properties. - :type appearance: ~azure.ai.formrecognizer.v2_1_preview_3.models.Appearance + :type appearance: ~azure.ai.formrecognizer.v2_1.models.Appearance """ _validation = { @@ -1166,10 +1164,10 @@ class TrainingDocumentInfo(msrest.serialization.Model): :param pages: Required. Total number of pages trained. :type pages: int :param errors: Required. List of errors. - :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + :type errors: list[~azure.ai.formrecognizer.v2_1.models.ErrorInformation] :param status: Required. Status of the training operation. Possible values include: "succeeded", "partiallySucceeded", "failed". - :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainStatus + :type status: str or ~azure.ai.formrecognizer.v2_1.models.TrainStatus """ _validation = { @@ -1205,7 +1203,7 @@ class TrainRequest(msrest.serialization.Model): :param source: Required. Source path containing the training documents. :type source: str :param source_filter: Filter to apply to the documents in the source path for training. - :type source_filter: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainSourceFilter + :type source_filter: ~azure.ai.formrecognizer.v2_1.models.TrainSourceFilter :param use_label_file: Use label file for training a model. :type use_label_file: bool :param model_name: Optional user defined model name (max length: 1024). @@ -1241,17 +1239,16 @@ class TrainResult(msrest.serialization.Model): :param training_documents: Required. List of the documents used to train the model and any errors reported in each document. - :type training_documents: - list[~azure.ai.formrecognizer.v2_1_preview_3.models.TrainingDocumentInfo] + :type training_documents: list[~azure.ai.formrecognizer.v2_1.models.TrainingDocumentInfo] :param fields: List of fields used to train the model and the train operation error reported by each. - :type fields: list[~azure.ai.formrecognizer.v2_1_preview_3.models.FormFieldsReport] + :type fields: list[~azure.ai.formrecognizer.v2_1.models.FormFieldsReport] :param average_model_accuracy: Average accuracy. :type average_model_accuracy: float :param model_id: Model identifier. :type model_id: str :param errors: Errors returned during the training operation. - :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + :type errors: list[~azure.ai.formrecognizer.v2_1.models.ErrorInformation] """ _validation = { diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models_py3.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/models/_models_py3.py similarity index 92% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models_py3.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/models/_models_py3.py index a1ed52242c63..50277ec26f67 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models_py3.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/models/_models_py3.py @@ -22,14 +22,14 @@ class AnalyzeOperationResult(msrest.serialization.Model): :param status: Required. Operation status. Possible values include: "notStarted", "running", "succeeded", "failed". - :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.OperationStatus + :type status: str or ~azure.ai.formrecognizer.v2_1.models.OperationStatus :param created_date_time: Required. Date and time (UTC) when the analyze operation was submitted. :type created_date_time: ~datetime.datetime :param last_updated_date_time: Required. Date and time (UTC) when the status was last updated. :type last_updated_date_time: ~datetime.datetime :param analyze_result: Results of the analyze operation. - :type analyze_result: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeResult + :type analyze_result: ~azure.ai.formrecognizer.v2_1.models.AnalyzeResult """ _validation = { @@ -69,13 +69,13 @@ class AnalyzeResult(msrest.serialization.Model): :param version: Required. Version of schema used for this result. :type version: str :param read_results: Required. Text extracted from the input. - :type read_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ReadResult] + :type read_results: list[~azure.ai.formrecognizer.v2_1.models.ReadResult] :param page_results: Page-level information extracted from the input. - :type page_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.PageResult] + :type page_results: list[~azure.ai.formrecognizer.v2_1.models.PageResult] :param document_results: Document-level information extracted from the input. - :type document_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.DocumentResult] + :type document_results: list[~azure.ai.formrecognizer.v2_1.models.DocumentResult] :param errors: List of errors reported during the analyze operation. - :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + :type errors: list[~azure.ai.formrecognizer.v2_1.models.ErrorInformation] """ _validation = { @@ -115,7 +115,7 @@ class Appearance(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param style: Required. An object representing the style of the text line. - :type style: ~azure.ai.formrecognizer.v2_1_preview_3.models.Style + :type style: ~azure.ai.formrecognizer.v2_1.models.Style """ _validation = { @@ -236,13 +236,13 @@ class CopyOperationResult(msrest.serialization.Model): :param status: Required. Operation status. Possible values include: "notStarted", "running", "succeeded", "failed". - :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.OperationStatus + :type status: str or ~azure.ai.formrecognizer.v2_1.models.OperationStatus :param created_date_time: Required. Date and time (UTC) when the copy operation was submitted. :type created_date_time: ~datetime.datetime :param last_updated_date_time: Required. Date and time (UTC) when the status was last updated. :type last_updated_date_time: ~datetime.datetime :param copy_result: Results of the copy operation. - :type copy_result: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyResult + :type copy_result: ~azure.ai.formrecognizer.v2_1.models.CopyResult """ _validation = { @@ -286,8 +286,7 @@ class CopyRequest(msrest.serialization.Model): region name supported by Cognitive Services. :type target_resource_region: str :param copy_authorization: Required. Entity that encodes claims to authorize the copy request. - :type copy_authorization: - ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult + :type copy_authorization: ~azure.ai.formrecognizer.v2_1.models.CopyAuthorizationResult """ _validation = { @@ -324,7 +323,7 @@ class CopyResult(msrest.serialization.Model): :param model_id: Required. Identifier of the target model. :type model_id: str :param errors: Errors returned during the copy operation. - :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + :type errors: list[~azure.ai.formrecognizer.v2_1.models.ErrorInformation] """ _validation = { @@ -358,7 +357,7 @@ class DataTable(msrest.serialization.Model): :param columns: Required. Number of columns. :type columns: int :param cells: Required. List of cells contained in the table. - :type cells: list[~azure.ai.formrecognizer.v2_1_preview_3.models.DataTableCell] + :type cells: list[~azure.ai.formrecognizer.v2_1.models.DataTableCell] :param bounding_box: Required. Bounding box of the table. :type bounding_box: list[float] """ @@ -486,7 +485,7 @@ class DocumentResult(msrest.serialization.Model): :param doc_type_confidence: Predicted document type confidence. :type doc_type_confidence: float :param fields: Required. Dictionary of named field values. - :type fields: dict[str, ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValue] + :type fields: dict[str, ~azure.ai.formrecognizer.v2_1.models.FieldValue] """ _validation = { @@ -561,7 +560,7 @@ class ErrorResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param error: Required. - :type error: ~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation + :type error: ~azure.ai.formrecognizer.v2_1.models.ErrorInformation """ _validation = { @@ -589,7 +588,7 @@ class FieldValue(msrest.serialization.Model): :param type: Required. Type of field value. Possible values include: "string", "date", "time", "phoneNumber", "number", "integer", "array", "object", "selectionMark", "gender", "country". - :type type: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValueType + :type type: str or ~azure.ai.formrecognizer.v2_1.models.FieldValueType :param value_string: String value. :type value_string: str :param value_date: Date value. @@ -603,15 +602,14 @@ class FieldValue(msrest.serialization.Model): :param value_integer: Integer value. :type value_integer: int :param value_array: Array of field values. - :type value_array: list[~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValue] + :type value_array: list[~azure.ai.formrecognizer.v2_1.models.FieldValue] :param value_object: Dictionary of named field values. - :type value_object: dict[str, ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValue] + :type value_object: dict[str, ~azure.ai.formrecognizer.v2_1.models.FieldValue] :param value_selection_mark: Selection mark value. Possible values include: "selected", "unselected". - :type value_selection_mark: str or - ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValueSelectionMark + :type value_selection_mark: str or ~azure.ai.formrecognizer.v2_1.models.FieldValueSelectionMark :param value_gender: Gender value: M, F, or X. Possible values include: "M", "F", "X". - :type value_gender: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValueGender + :type value_gender: str or ~azure.ai.formrecognizer.v2_1.models.FieldValueGender :param value_country: 3-letter country code (ISO 3166-1 alpha-3). :type value_country: str :param text: Text content of the extracted field. @@ -763,7 +761,7 @@ class KeyValueElement(msrest.serialization.Model): :param type: Semantic data type of the key value element. Possible values include: "string", "selectionMark". - :type type: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValueType + :type type: str or ~azure.ai.formrecognizer.v2_1.models.KeyValueType :param text: Required. The text content of the key or value. :type text: str :param bounding_box: Bounding box of the key or value. @@ -809,9 +807,9 @@ class KeyValuePair(msrest.serialization.Model): :param label: A user defined label for the key/value pair entry. :type label: str :param key: Required. Information about the extracted key in a key-value pair. - :type key: ~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValueElement + :type key: ~azure.ai.formrecognizer.v2_1.models.KeyValueElement :param value: Required. Information about the extracted value in a key-value pair. - :type value: ~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValueElement + :type value: ~azure.ai.formrecognizer.v2_1.models.KeyValueElement :param confidence: Required. Confidence value. :type confidence: float """ @@ -851,13 +849,13 @@ class Model(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param model_info: Required. Basic custom model information. - :type model_info: ~azure.ai.formrecognizer.v2_1_preview_3.models.ModelInfo + :type model_info: ~azure.ai.formrecognizer.v2_1.models.ModelInfo :param keys: Keys extracted by the custom model. - :type keys: ~azure.ai.formrecognizer.v2_1_preview_3.models.KeysResult + :type keys: ~azure.ai.formrecognizer.v2_1.models.KeysResult :param train_result: Training result for custom model. - :type train_result: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainResult + :type train_result: ~azure.ai.formrecognizer.v2_1.models.TrainResult :param composed_train_results: Training result for composed model. - :type composed_train_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.TrainResult] + :type composed_train_results: list[~azure.ai.formrecognizer.v2_1.models.TrainResult] """ _validation = { @@ -896,7 +894,7 @@ class ModelInfo(msrest.serialization.Model): :type model_id: str :param status: Required. Status of the model. Possible values include: "creating", "ready", "invalid". - :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ModelStatus + :type status: str or ~azure.ai.formrecognizer.v2_1.models.ModelStatus :param created_date_time: Required. Date and time (UTC) when the model was created. :type created_date_time: ~datetime.datetime :param last_updated_date_time: Required. Date and time (UTC) when the status was last updated. @@ -904,7 +902,7 @@ class ModelInfo(msrest.serialization.Model): :param model_name: Optional user defined model name (max length: 1024). :type model_name: str :param attributes: Optional model attributes. - :type attributes: ~azure.ai.formrecognizer.v2_1_preview_3.models.Attributes + :type attributes: ~azure.ai.formrecognizer.v2_1.models.Attributes """ _validation = { @@ -947,9 +945,9 @@ class Models(msrest.serialization.Model): """Response to the list custom models operation. :param summary: Summary of all trained custom models. - :type summary: ~azure.ai.formrecognizer.v2_1_preview_3.models.ModelsSummary + :type summary: ~azure.ai.formrecognizer.v2_1.models.ModelsSummary :param model_list: Collection of trained custom models. - :type model_list: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ModelInfo] + :type model_list: list[~azure.ai.formrecognizer.v2_1.models.ModelInfo] :param next_link: Link to the next page of custom models. :type next_link: str """ @@ -1023,9 +1021,9 @@ class PageResult(msrest.serialization.Model): :param cluster_id: Cluster identifier. :type cluster_id: int :param key_value_pairs: List of key-value pairs extracted from the page. - :type key_value_pairs: list[~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValuePair] + :type key_value_pairs: list[~azure.ai.formrecognizer.v2_1.models.KeyValuePair] :param tables: List of data tables extracted from the page. - :type tables: list[~azure.ai.formrecognizer.v2_1_preview_3.models.DataTable] + :type tables: list[~azure.ai.formrecognizer.v2_1.models.DataTable] """ _validation = { @@ -1073,15 +1071,15 @@ class ReadResult(msrest.serialization.Model): :param unit: Required. The unit used by the width, height and boundingBox properties. For images, the unit is "pixel". For PDF, the unit is "inch". Possible values include: "pixel", "inch". - :type unit: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.LengthUnit + :type unit: str or ~azure.ai.formrecognizer.v2_1.models.LengthUnit :param lines: When includeTextDetails is set to true, a list of recognized text lines. The maximum number of lines returned is 300 per page. The lines are sorted top to bottom, left to right, although in certain cases proximity is treated with higher priority. As the sorting order depends on the detected text, it may change across images and OCR version updates. Thus, business logic should be built upon the actual line location instead of order. - :type lines: list[~azure.ai.formrecognizer.v2_1_preview_3.models.TextLine] + :type lines: list[~azure.ai.formrecognizer.v2_1.models.TextLine] :param selection_marks: List of selection marks extracted from the page. - :type selection_marks: list[~azure.ai.formrecognizer.v2_1_preview_3.models.SelectionMark] + :type selection_marks: list[~azure.ai.formrecognizer.v2_1.models.SelectionMark] """ _validation = { @@ -1135,7 +1133,7 @@ class SelectionMark(msrest.serialization.Model): :type confidence: float :param state: Required. State of the selection mark. Possible values include: "selected", "unselected". - :type state: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.SelectionMarkState + :type state: str or ~azure.ai.formrecognizer.v2_1.models.SelectionMarkState """ _validation = { @@ -1196,7 +1194,7 @@ class Style(msrest.serialization.Model): :param name: Required. The text line style name, including handwriting and other. Possible values include: "other", "handwriting". - :type name: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.TextStyle + :type name: str or ~azure.ai.formrecognizer.v2_1.models.TextStyle :param confidence: Required. The confidence of text line style. :type confidence: float """ @@ -1233,9 +1231,9 @@ class TextLine(msrest.serialization.Model): :param bounding_box: Required. Bounding box of an extracted line. :type bounding_box: list[float] :param words: Required. List of words in the text line. - :type words: list[~azure.ai.formrecognizer.v2_1_preview_3.models.TextWord] + :type words: list[~azure.ai.formrecognizer.v2_1.models.TextWord] :param appearance: Text appearance properties. - :type appearance: ~azure.ai.formrecognizer.v2_1_preview_3.models.Appearance + :type appearance: ~azure.ai.formrecognizer.v2_1.models.Appearance """ _validation = { @@ -1316,10 +1314,10 @@ class TrainingDocumentInfo(msrest.serialization.Model): :param pages: Required. Total number of pages trained. :type pages: int :param errors: Required. List of errors. - :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + :type errors: list[~azure.ai.formrecognizer.v2_1.models.ErrorInformation] :param status: Required. Status of the training operation. Possible values include: "succeeded", "partiallySucceeded", "failed". - :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainStatus + :type status: str or ~azure.ai.formrecognizer.v2_1.models.TrainStatus """ _validation = { @@ -1360,7 +1358,7 @@ class TrainRequest(msrest.serialization.Model): :param source: Required. Source path containing the training documents. :type source: str :param source_filter: Filter to apply to the documents in the source path for training. - :type source_filter: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainSourceFilter + :type source_filter: ~azure.ai.formrecognizer.v2_1.models.TrainSourceFilter :param use_label_file: Use label file for training a model. :type use_label_file: bool :param model_name: Optional user defined model name (max length: 1024). @@ -1401,17 +1399,16 @@ class TrainResult(msrest.serialization.Model): :param training_documents: Required. List of the documents used to train the model and any errors reported in each document. - :type training_documents: - list[~azure.ai.formrecognizer.v2_1_preview_3.models.TrainingDocumentInfo] + :type training_documents: list[~azure.ai.formrecognizer.v2_1.models.TrainingDocumentInfo] :param fields: List of fields used to train the model and the train operation error reported by each. - :type fields: list[~azure.ai.formrecognizer.v2_1_preview_3.models.FormFieldsReport] + :type fields: list[~azure.ai.formrecognizer.v2_1.models.FormFieldsReport] :param average_model_accuracy: Average accuracy. :type average_model_accuracy: float :param model_id: Model identifier. :type model_id: str :param errors: Errors returned during the training operation. - :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + :type errors: list[~azure.ai.formrecognizer.v2_1.models.ErrorInformation] """ _validation = { diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/operations/__init__.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/operations/__init__.py similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/operations/__init__.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/operations/__init__.py diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/operations/_form_recognizer_client_operations.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/operations/_form_recognizer_client_operations.py similarity index 95% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/operations/_form_recognizer_client_operations.py rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/operations/_form_recognizer_client_operations.py index 55d5a31df492..de68683c1328 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/operations/_form_recognizer_client_operations.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/operations/_form_recognizer_client_operations.py @@ -94,18 +94,18 @@ def begin_train_custom_model_async( or 'image/bmp'. Other type of content is ignored. :param train_request: Training request parameters. - :type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest + :type train_request: ~azure.ai.formrecognizer.v2_1.models.TrainRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -161,7 +161,7 @@ def get_custom_model( :type include_keys: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: Model, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Model + :rtype: ~azure.ai.formrecognizer.v2_1.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] @@ -352,20 +352,20 @@ def begin_analyze_with_custom_model( range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -425,7 +425,7 @@ def get_analyze_form_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] @@ -534,18 +534,18 @@ def begin_copy_custom_model( :param model_id: Model identifier. :type model_id: str :param copy_request: Copy request parameters. - :type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest + :type copy_request: ~azure.ai.formrecognizer.v2_1.models.CopyRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -603,7 +603,7 @@ def get_custom_model_copy_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CopyOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.CopyOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CopyOperationResult"] @@ -657,7 +657,7 @@ def generate_model_copy_authorization( :keyword callable cls: A custom type or function that will be passed the direct response :return: CopyAuthorizationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.CopyAuthorizationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CopyAuthorizationResult"] @@ -762,18 +762,18 @@ def begin_compose_custom_models_async( It would validate limit of models put together. :param compose_request: Compose models. - :type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest + :type compose_request: ~azure.ai.formrecognizer.v2_1.models.ComposeRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -901,26 +901,26 @@ def begin_analyze_business_card_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -976,7 +976,7 @@ def get_analyze_business_card_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] @@ -1107,26 +1107,26 @@ def begin_analyze_invoice_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1182,7 +1182,7 @@ def get_analyze_invoice_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] @@ -1312,20 +1312,20 @@ def begin_analyze_id_document_async( range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1380,7 +1380,7 @@ def get_analyze_id_document_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] @@ -1511,26 +1511,26 @@ def begin_analyze_receipt_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1586,7 +1586,7 @@ def get_analyze_receipt_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] @@ -1735,25 +1735,25 @@ def begin_analyze_layout_async( seventy-three languages and handwritten – English only). Layout supports auto language identification and multi language documents, so only provide a language code if you would like to force the documented to be processed as that specific language. - :type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language + :type language: str or ~azure.ai.formrecognizer.v2_1.models.Language :param reading_order: Reading order algorithm to sort the text lines returned. Supported reading orders include: basic(default), natural. - :type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder + :type reading_order: str or ~azure.ai.formrecognizer.v2_1.models.ReadingOrder :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1809,7 +1809,7 @@ def get_analyze_layout_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] @@ -1862,7 +1862,7 @@ def list_custom_models( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Models or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.formrecognizer.v2_1_preview_3.models.Models] + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.formrecognizer.v2_1.models.Models] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Models"] @@ -1936,7 +1936,7 @@ def get_custom_models( :keyword callable cls: A custom type or function that will be passed the direct response :return: Models, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Models + :rtype: ~azure.ai.formrecognizer.v2_1.models.Models :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Models"] diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/py.typed b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/py.typed similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/py.typed rename to sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1/py.typed diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_helpers.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_helpers.py index 0976fcb5dccb..ea79ed9ac1c5 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_helpers.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_helpers.py @@ -18,7 +18,7 @@ def _get_deserialize(api_version): if api_version == "2.0": from ._generated.v2_0 import FormRecognizerClient else: - from ._generated.v2_1_preview_3 import FormRecognizerClient + from ._generated.v2_1 import FormRecognizerClient return FormRecognizerClient( # pylint: disable=protected-access "dummy", "dummy" )._deserialize diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_base_client_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_base_client_async.py index 412994355772..c9575f2687eb 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_base_client_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_base_client_async.py @@ -32,7 +32,7 @@ def __init__( self._endpoint = endpoint self._credential = credential self._api_version = kwargs.pop( - "api_version", FormRecognizerApiVersion.V2_1_PREVIEW + "api_version", FormRecognizerApiVersion.V2_1 ) validate_api_version(self._api_version) @@ -43,14 +43,17 @@ def __init__( http_logging_policy.allowed_header_names.update( { "Operation-Location", + "Location", "x-envoy-upstream-service-time", "apim-request-id", "Strict-Transport-Security", "x-content-type-options", + "ms-azure-ai-errorcode", + "x-ms-cs-error-code", } ) http_logging_policy.allowed_query_params.update( - {"includeTextDetails", "locale", "language", "includeKeys", "op"} + {"includeTextDetails", "locale", "language", "includeKeys", "op", "pages", "readingOrder"} ) self._client = FormRecognizer( endpoint=endpoint, diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py index 53ff2493fda6..2d2a8dca4f64 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py @@ -124,11 +124,11 @@ async def begin_recognize_receipts( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if locale: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"locale": locale}) else: raise ValueError( - "'locale' is only available for API version V2_1_PREVIEW and up" + "'locale' is only available for API version V2_1 and up" ) pages = kwargs.pop("pages", None) @@ -136,11 +136,11 @@ async def begin_recognize_receipts( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1_PREVIEW and up" + "'pages' is only available for API version V2_1 and up" ) return await self._client.begin_analyze_receipt_async( # type: ignore @@ -199,11 +199,11 @@ async def begin_recognize_receipts_from_url( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if locale: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"locale": locale}) else: raise ValueError( - "'locale' is only available for API version V2_1_PREVIEW and up" + "'locale' is only available for API version V2_1 and up" ) pages = kwargs.pop("pages", None) @@ -211,11 +211,11 @@ async def begin_recognize_receipts_from_url( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1_PREVIEW and up" + "'pages' is only available for API version V2_1 and up" ) return await self._client.begin_analyze_receipt_async( # type: ignore @@ -294,7 +294,7 @@ async def begin_recognize_business_cards( except ValueError as e: if "begin_analyze_business_card_async" in str(e): raise ValueError( - "Method 'begin_recognize_business_cards' is only available for API version V2_1_PREVIEW and up" + "Method 'begin_recognize_business_cards' is only available for API version V2_1 and up" ) raise e @@ -344,7 +344,7 @@ async def begin_recognize_business_cards_from_url( if "begin_analyze_business_card_async" in str(e): raise ValueError( "Method 'begin_recognize_business_cards_from_url' is only available for " - "API version V2_1_PREVIEW and up" + "API version V2_1 and up" ) raise e @@ -414,7 +414,7 @@ async def begin_recognize_id_documents( except ValueError as e: if "begin_analyze_id_document_async" in str(e): raise ValueError( - "Method 'begin_recognize_id_documents' is only available for API version V2_1_PREVIEW and up" + "Method 'begin_recognize_id_documents' is only available for API version V2_1 and up" ) raise e @@ -462,7 +462,7 @@ async def begin_recognize_id_documents_from_url( if "begin_analyze_id_document_async" in str(e): raise ValueError( "Method 'begin_recognize_id_documents_from_url' is " - "only available for API version V2_1_PREVIEW and up" + "only available for API version V2_1 and up" ) raise e @@ -533,7 +533,7 @@ async def begin_recognize_invoices( except ValueError as e: if "begin_analyze_invoice_async" in str(e): raise ValueError( - "Method 'begin_recognize_invoices' is only available for API version V2_1_PREVIEW and up" + "Method 'begin_recognize_invoices' is only available for API version V2_1 and up" ) raise e @@ -582,7 +582,7 @@ async def begin_recognize_invoices_from_url( if "begin_analyze_invoice_async" in str(e): raise ValueError( "Method 'begin_recognize_invoices_from_url' is " - "only available for API version V2_1_PREVIEW and up" + "only available for API version V2_1 and up" ) raise e @@ -656,27 +656,27 @@ async def begin_recognize_content( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1_PREVIEW and up" + "'pages' is only available for API version V2_1 and up" ) if reading_order: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"reading_order": reading_order}) else: raise ValueError( - "'reading_order' is only available for API version V2_1_PREVIEW and up" + "'reading_order' is only available for API version V2_1 and up" ) if language: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"language": language}) else: raise ValueError( - "'language' is only available for API version V2_1_PREVIEW and up" + "'language' is only available for API version V2_1 and up" ) return await self._client.begin_analyze_layout_async( # type: ignore @@ -727,27 +727,27 @@ async def begin_recognize_content_from_url( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1_PREVIEW and up" + "'pages' is only available for API version V2_1 and up" ) if reading_order: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"reading_order": reading_order}) else: raise ValueError( - "'reading_order' is only available for API version V2_1_PREVIEW and up" + "'reading_order' is only available for API version V2_1 and up" ) if language: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"language": language}) else: raise ValueError( - "'language' is only available for API version V2_1_PREVIEW and up" + "'language' is only available for API version V2_1 and up" ) return await self._client.begin_analyze_layout_async( # type: ignore @@ -831,11 +831,11 @@ def analyze_callback( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1_PREVIEW and up" + "'pages' is only available for API version V2_1 and up" ) return await self._client.begin_analyze_with_custom_model( # type: ignore @@ -901,11 +901,11 @@ def analyze_callback( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1_PREVIEW: + if self._api_version == FormRecognizerApiVersion.V2_1: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1_PREVIEW and up" + "'pages' is only available for API version V2_1 and up" ) return await self._client.begin_analyze_with_custom_model( # type: ignore diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py index 1fb0e25dca90..42c035730e2b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py @@ -129,7 +129,7 @@ def callback_v2_1(raw_response, _, headers): # pylint: disable=unused-argument model_name = kwargs.pop("model_name", None) if model_name and self._api_version == "2.0": raise ValueError( - "'model_name' is only available for API version V2_1_PREVIEW and up" + "'model_name' is only available for API version V2_1 and up" ) continuation_token = kwargs.pop("continuation_token", None) polling_interval = kwargs.pop( @@ -481,7 +481,7 @@ def _compose_callback( ) except ValueError: raise ValueError( - "Method 'begin_create_composed_model' is only available for API version V2_1_PREVIEW and up" + "Method 'begin_create_composed_model' is only available for API version V2_1 and up" ) def get_form_recognizer_client(self, **kwargs: Any) -> FormRecognizerClient: diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py index 614b6e40c1ea..4c98bf4d5193 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py @@ -420,7 +420,7 @@ def test_business_card_v2(self, client): business_card = fd.read() with pytest.raises(ValueError) as e: client.begin_recognize_business_cards(business_card) - assert "Method 'begin_recognize_business_cards' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "Method 'begin_recognize_business_cards' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py index d25faa9aeb55..f5ad4e2266a2 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py @@ -437,7 +437,7 @@ async def test_business_card_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_business_cards(business_card) - assert "Method 'begin_recognize_business_cards' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "Method 'begin_recognize_business_cards' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py index fa5cd66a6d45..f20a6c99804a 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py @@ -342,7 +342,7 @@ def test_business_card_continuation_token(self, client): def test_business_card_v2(self, client): with pytest.raises(ValueError) as e: client.begin_recognize_business_cards_from_url(self.business_card_url_jpg) - assert "Method 'begin_recognize_business_cards_from_url' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "Method 'begin_recognize_business_cards_from_url' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py index eb1259a9a344..c0cfafa6ded9 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py @@ -356,7 +356,7 @@ async def test_business_card_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_business_cards_from_url(self.business_card_url_jpg) - assert "Method 'begin_recognize_business_cards_from_url' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "Method 'begin_recognize_business_cards_from_url' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model.py index 0972c6558b61..5f8c22ab8454 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model.py @@ -91,4 +91,4 @@ def test_compose_model_bad_api_version(self, client, formrecognizer_storage_cont with pytest.raises(ValueError) as excinfo: poller = client.begin_create_composed_model(["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"]) result = poller.result() - assert "Method 'begin_create_composed_model' is only available for API version V2_1_PREVIEW and up" in str(excinfo.value) + assert "Method 'begin_create_composed_model' is only available for API version V2_1 and up" in str(excinfo.value) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model_async.py index 053bc0e66890..2f751f4c1bd3 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model_async.py @@ -92,4 +92,4 @@ async def test_compose_model_bad_api_version(self, client, formrecognizer_storag with pytest.raises(ValueError) as excinfo: poller = await client.begin_create_composed_model(["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"]) result = await poller.result() - assert "Method 'begin_create_composed_model' is only available for API version V2_1_PREVIEW and up" in str(excinfo.value) + assert "Method 'begin_create_composed_model' is only available for API version V2_1 and up" in str(excinfo.value) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py index f13df5fae9dc..0f5e4b126f0d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py @@ -387,4 +387,4 @@ def test_content_language_v2(self, client): myfile = fd.read() with pytest.raises(ValueError) as e: client.begin_recognize_content(myfile, language="en") - assert "'language' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "'language' is only available for API version V2_1 and up" in str(e.value) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py index 67c51378a982..23a57445ddd2 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py @@ -426,4 +426,4 @@ async def test_content_language_v2(self, client): async with client: with pytest.raises(ValueError) as e: await client.begin_recognize_content(myfile, language="en") - assert "'language' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "'language' is only available for API version V2_1 and up" in str(e.value) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py index 54c833b7ff87..9208694394f2 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py @@ -279,7 +279,7 @@ def test_content_language_error(self, client): def test_content_language_v2(self, client): with pytest.raises(ValueError) as e: client.begin_recognize_content_from_url(self.form_url_jpg, language="en") - assert "'language' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "'language' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py index 5ccb7059eaf6..249adabef930 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py @@ -305,7 +305,7 @@ async def test_content_language_v2(self, client): async with client: with pytest.raises(ValueError) as e: await client.begin_recognize_content_from_url(self.form_url_jpg, language="en") - assert "'language' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "'language' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents.py index f2c665d1c3ed..1e7c06ed017e 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents.py @@ -250,7 +250,7 @@ def test_id_document_v2(self, client): id_document = fd.read() with pytest.raises(ValueError) as e: client.begin_recognize_id_documents(id_document) - assert "Method 'begin_recognize_id_documents' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "Method 'begin_recognize_id_documents' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_async.py index 912459acacd9..92c91d477959 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_async.py @@ -269,7 +269,7 @@ async def test_id_document_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_id_documents(id_document) - assert "Method 'begin_recognize_id_documents' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "Method 'begin_recognize_id_documents' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url.py index ad8829113037..cc04fffda8da 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url.py @@ -173,7 +173,7 @@ def test_id_document_continuation_token(self, client): def test_id_document_v2(self, client): with pytest.raises(ValueError) as e: client.begin_recognize_id_documents_from_url(self.id_document_url_jpg) - assert "Method 'begin_recognize_id_documents_from_url' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "Method 'begin_recognize_id_documents_from_url' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url_async.py index ddf9da2f5be5..3512454e2879 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url_async.py @@ -187,7 +187,7 @@ async def test_id_document_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_id_documents_from_url(self.id_document_url_jpg) - assert "Method 'begin_recognize_id_documents_from_url' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "Method 'begin_recognize_id_documents_from_url' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py index 80002bf1835d..c8e044bdc114 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py @@ -345,7 +345,7 @@ def test_invoice_v2(self, client): invoice = fd.read() with pytest.raises(ValueError) as e: client.begin_recognize_invoices(invoice) - assert "Method 'begin_recognize_invoices' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "Method 'begin_recognize_invoices' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py index 315fb5730168..97fc01514d63 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py @@ -382,7 +382,7 @@ async def test_invoice_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_invoices(invoice) - assert "Method 'begin_recognize_invoices' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "Method 'begin_recognize_invoices' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py index 61259ff7c79c..4dda52e3a396 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py @@ -267,7 +267,7 @@ def test_invoice_continuation_token(self, client): def test_invoice_v2(self, client): with pytest.raises(ValueError) as e: client.begin_recognize_invoices_from_url(self.invoice_url_tiff) - assert "Method 'begin_recognize_invoices_from_url' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "Method 'begin_recognize_invoices_from_url' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py index 3f4204f29490..41fed55447f6 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py @@ -282,7 +282,7 @@ async def test_invoice_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_invoices_from_url(self.invoice_url_tiff) - assert "Method 'begin_recognize_invoices_from_url' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "Method 'begin_recognize_invoices_from_url' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi.py index 917e9c2e7767..838f9503add7 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi.py @@ -18,12 +18,12 @@ class TestMultiapi(FormRecognizerTest): @FormRecognizerPreparer() @FormRecognizerClientPreparer() def test_default_api_version_form_recognizer_client(self, client): - assert "v2.1-preview.3" in client._client._client._base_url + assert "v2.1" in client._client._client._base_url @FormRecognizerPreparer() @FormTrainingClientPreparer() def test_default_api_version_form_training_client(self, client): - assert "v2.1-preview.3" in client._client._client._base_url + assert "v2.1" in client._client._client._base_url @FormRecognizerPreparer() @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_0}) @@ -36,14 +36,14 @@ def test_v2_0_form_training_client(self, client): assert "v2.0" in client._client._client._base_url @FormRecognizerPreparer() - @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1_PREVIEW}) - def test_v2_1_preview_3_form_recognizer_client(self, client): - assert "v2.1-preview.3" in client._client._client._base_url + @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1}) + def test_v2_1_form_recognizer_client(self, client): + assert "v2.1" in client._client._client._base_url @FormRecognizerPreparer() - @FormTrainingClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1_PREVIEW}) - def test_v2_1_preview_3_form_training_client(self, client): - assert "v2.1-preview.3" in client._client._client._base_url + @FormTrainingClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1}) + def test_v2_1_form_training_client(self, client): + assert "v2.1" in client._client._client._base_url @FormRecognizerPreparer() @FormTrainingClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_0}) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi_async.py index a5fdee72becb..4141c4218fe3 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi_async.py @@ -19,12 +19,12 @@ class TestMultiapi(AsyncFormRecognizerTest): @FormRecognizerPreparer() @FormRecognizerClientPreparer() def test_default_api_version_form_recognizer_client(self, client): - assert "v2.1-preview.3" in client._client._client._base_url + assert "v2.1" in client._client._client._base_url @FormRecognizerPreparer() @FormTrainingClientPreparer() def test_default_api_version_form_training_client(self, client): - assert "v2.1-preview.3" in client._client._client._base_url + assert "v2.1" in client._client._client._base_url @FormRecognizerPreparer() @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_0}) @@ -37,14 +37,14 @@ def test_v2_0_form_training_client(self, client): assert "v2.0" in client._client._client._base_url @FormRecognizerPreparer() - @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1_PREVIEW}) - def test_v2_1_preview_1_form_recognizer_client(self, client): - assert "v2.1-preview.3" in client._client._client._base_url + @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1}) + def test_V2_1_form_recognizer_client(self, client): + assert "v2.1" in client._client._client._base_url @FormRecognizerPreparer() - @FormTrainingClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1_PREVIEW}) - def test_v2_1_preview_1_form_training_client(self, client): - assert "v2.1-preview.3" in client._client._client._base_url + @FormTrainingClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1}) + def test_V2_1_form_training_client(self, client): + assert "v2.1" in client._client._client._base_url @FormRecognizerPreparer() @FormTrainingClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_0}) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py index b605371a288a..93ddbf14b0f8 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py @@ -379,7 +379,7 @@ def test_receipt_locale_v2(self, client): receipt = fd.read() with pytest.raises(ValueError) as e: client.begin_recognize_receipts(receipt, locale="en-US") - assert "'locale' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "'locale' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py index 4bc853363b56..2241f3c942ce 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py @@ -409,7 +409,7 @@ async def test_receipt_locale_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_receipts(receipt, locale="en-US") - assert "'locale' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "'locale' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py index 1e0248428672..afbf6a76e21f 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py @@ -310,7 +310,7 @@ def test_receipt_locale_error(self, client): def test_receipt_locale_v2(self, client): with pytest.raises(ValueError) as e: client.begin_recognize_receipts_from_url(self.receipt_url_jpg, locale="en-US") - assert "'locale' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "'locale' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py index e845d86ef25b..d06446d13bdc 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py @@ -342,7 +342,7 @@ async def test_receipt_locale_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_receipts_from_url(self.receipt_url_jpg, locale="en-US") - assert "'locale' is only available for API version V2_1_PREVIEW and up" in str(e.value) + assert "'locale' is only available for API version V2_1 and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py index a0bb671127a5..d614d74ace53 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py @@ -264,4 +264,4 @@ def test_training_with_model_name_bad_api_version(self, client, formrecognizer_s with pytest.raises(ValueError) as excinfo: poller = client.begin_training(training_files_url="url", use_training_labels=True, model_name="not supported in v2.0") result = poller.result() - assert "'model_name' is only available for API version V2_1_PREVIEW and up" in str(excinfo.value) + assert "'model_name' is only available for API version V2_1 and up" in str(excinfo.value) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py index 906c871f4470..00cf0a178788 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py @@ -278,4 +278,4 @@ async def test_training_with_model_name_bad_api_version(self, client, formrecogn with pytest.raises(ValueError) as excinfo: poller = await client.begin_training(training_files_url="url", use_training_labels=True, model_name="not supported in v2.0") result = await poller.result() - assert "'model_name' is only available for API version V2_1_PREVIEW and up" in str(excinfo.value) + assert "'model_name' is only available for API version V2_1 and up" in str(excinfo.value) From a9afc58e2d8aa48b9a00d2027aa0cd1a4a840013 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Thu, 29 Apr 2021 14:37:54 -0700 Subject: [PATCH 2/5] use value_selection_mark --- .../azure/ai/formrecognizer/_models.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index c9a06a3800d4..c15114523663 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -63,9 +63,7 @@ def get_field_value( for key, value in value.value_object.items() } if value.type == "selectionMark": - return ( - value.text - ) # FIXME https://github.com/Azure/azure-sdk-for-python/issues/15276 + return value.value_selection_mark if value.type == "gender": return value.value_gender if value.type == "country": From 6bb2e8e26e48ee55d2ca14fb6381d0a772abc570 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Thu, 29 Apr 2021 15:21:47 -0700 Subject: [PATCH 3/5] selection mark value compatability between preview.3 and GA --- .../azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index c15114523663..82dc271259ea 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -63,7 +63,7 @@ def get_field_value( for key, value in value.value_object.items() } if value.type == "selectionMark": - return value.value_selection_mark + return value.value_selection_mark or value.text # TODO: preview.3 still returns in text if value.type == "gender": return value.value_gender if value.type == "country": From d957589575d9cc9beb6ff85c3067379989a6d5ad Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Sun, 2 May 2021 15:14:23 -0700 Subject: [PATCH 4/5] regenerate with v2.1-preview.3 and v2.1 --- .../azure-ai-formrecognizer/README.md | 2 +- .../azure/ai/formrecognizer/_api_versions.py | 2 +- .../ai/formrecognizer/_form_base_client.py | 2 +- .../formrecognizer/_form_recognizer_client.py | 60 +- .../formrecognizer/_form_training_client.py | 4 +- .../_generated/_form_recognizer_client.py | 9 +- .../_generated/_operations_mixin.py | 98 +- .../_generated/aio/_form_recognizer_client.py | 9 +- .../_generated/aio/_operations_mixin.py | 98 +- .../ai/formrecognizer/_generated/models.py | 3 +- .../_generated/v2_1_preview_3/__init__.py | 16 + .../v2_1_preview_3/_configuration.py | 68 + .../v2_1_preview_3/_form_recognizer_client.py | 82 + .../_generated/v2_1_preview_3/_metadata.json | 456 ++++ .../_generated/v2_1_preview_3/aio/__init__.py | 10 + .../v2_1_preview_3/aio/_configuration.py | 64 + .../aio/_form_recognizer_client.py | 75 + .../v2_1_preview_3/aio/operations/__init__.py | 13 + .../_form_recognizer_client_operations.py | 1946 ++++++++++++++++ .../v2_1_preview_3/models/__init__.py | 146 ++ .../models/_form_recognizer_client_enums.py | 216 ++ .../v2_1_preview_3/models/_models.py | 1308 +++++++++++ .../v2_1_preview_3/models/_models_py3.py | 1477 ++++++++++++ .../v2_1_preview_3/operations/__init__.py | 13 + .../_form_recognizer_client_operations.py | 1980 +++++++++++++++++ .../_generated/v2_1_preview_3/py.typed | 1 + .../azure/ai/formrecognizer/_helpers.py | 4 +- .../aio/_form_base_client_async.py | 2 +- .../aio/_form_recognizer_client_async.py | 60 +- .../aio/_form_training_client_async.py | 4 +- .../tests/test_business_card.py | 2 +- .../tests/test_business_card_async.py | 2 +- .../tests/test_business_card_from_url.py | 2 +- .../test_business_card_from_url_async.py | 2 +- .../tests/test_compose_model.py | 2 +- .../tests/test_compose_model_async.py | 2 +- .../tests/test_content.py | 2 +- .../tests/test_content_async.py | 2 +- .../tests/test_content_from_url.py | 2 +- .../tests/test_content_from_url_async.py | 2 +- .../tests/test_id_documents.py | 2 +- .../tests/test_id_documents_async.py | 2 +- .../tests/test_id_documents_from_url.py | 2 +- .../tests/test_id_documents_from_url_async.py | 2 +- .../tests/test_invoice.py | 2 +- .../tests/test_invoice_async.py | 2 +- .../tests/test_invoice_from_url.py | 2 +- .../tests/test_invoice_from_url_async.py | 2 +- .../tests/test_multiapi.py | 10 + .../tests/test_multiapi_async.py | 10 + .../tests/test_receipt.py | 2 +- .../tests/test_receipt_async.py | 2 +- .../tests/test_receipt_from_url.py | 2 +- .../tests/test_receipt_from_url_async.py | 2 +- .../tests/test_training.py | 2 +- .../tests/test_training_async.py | 2 +- 56 files changed, 8147 insertions(+), 149 deletions(-) create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/__init__.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_configuration.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_form_recognizer_client.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_metadata.json create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/__init__.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/_configuration.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/_form_recognizer_client.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/operations/__init__.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/operations/_form_recognizer_client_operations.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/__init__.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_form_recognizer_client_enums.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models_py3.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/operations/__init__.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/operations/_form_recognizer_client_operations.py create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/py.typed diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/README.md b/sdk/formrecognizer/azure-ai-formrecognizer/README.md index fbe1d966d779..5768db3fccdb 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/README.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/README.md @@ -34,7 +34,7 @@ This table shows the relationship between SDK versions and supported API version |SDK version|Supported API version of service |-|- |3.0.0 - Latest GA release (can be installed by removing the `--pre` flag)| 2.0 -|3.1.0b4 - Latest release (beta)| 2.0, 2.1-preview.3 +|3.1.0b5 - Latest release (beta)| 2.0, 2.1-preview.3, 2.1 #### Create a Form Recognizer resource diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_api_versions.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_api_versions.py index 0177a6d0c72e..29380a0f0cf2 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_api_versions.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_api_versions.py @@ -10,8 +10,8 @@ class FormRecognizerApiVersion(str, Enum): """Form Recognizer API versions supported by this package""" #: This is the default version + V2_1_PREVIEW = "2.1-preview.3" V2_1 = "2.1" - V2_1_PREVIEW = "2.1-preview.3" # TODO what to do about this enum value? V2_0 = "2.0" diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_base_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_base_client.py index ef94c999d488..4ff5dee30bf4 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_base_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_base_client.py @@ -21,7 +21,7 @@ def __init__(self, endpoint, credential, **kwargs): self._endpoint = endpoint self._credential = credential self._api_version = kwargs.pop( - "api_version", FormRecognizerApiVersion.V2_1 + "api_version", FormRecognizerApiVersion.V2_1_PREVIEW ) validate_api_version(self._api_version) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py index 63a7f8d61ea8..a8b90ea04038 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py @@ -127,20 +127,20 @@ def begin_recognize_receipts(self, receipt, **kwargs): # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if locale: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"locale": locale}) else: raise ValueError( - "'locale' is only available for API version V2_1 and up" + "'locale' is only available for API version V2_1_PREVIEW and up" ) # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1 and up" + "'pages' is only available for API version V2_1_PREVIEW and up" ) return self._client.begin_analyze_receipt_async( # type: ignore file_stream=receipt, @@ -198,20 +198,20 @@ def begin_recognize_receipts_from_url(self, receipt_url, **kwargs): # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if locale: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"locale": locale}) else: raise ValueError( - "'locale' is only available for API version V2_1 and up" + "'locale' is only available for API version V2_1_PREVIEW and up" ) # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1 and up" + "'pages' is only available for API version V2_1_PREVIEW and up" ) return self._client.begin_analyze_receipt_async( # type: ignore file_stream={"source": receipt_url}, @@ -288,7 +288,7 @@ def begin_recognize_business_cards(self, business_card, **kwargs): except ValueError as e: if "begin_analyze_business_card_async" in str(e): raise ValueError( - "Method 'begin_recognize_business_cards' is only available for API version V2_1 and up" + "Method 'begin_recognize_business_cards' is only available for API version V2_1_PREVIEW and up" ) raise e @@ -338,7 +338,7 @@ def begin_recognize_business_cards_from_url(self, business_card_url, **kwargs): if "begin_analyze_business_card_async" in str(e): raise ValueError( "Method 'begin_recognize_business_cards_from_url' is " - "only available for API version V2_1 and up" + "only available for API version V2_1_PREVIEW and up" ) raise e @@ -406,7 +406,7 @@ def begin_recognize_id_documents(self, id_document, **kwargs): except ValueError as e: if "begin_analyze_id_document_async" in str(e): raise ValueError( - "Method 'begin_recognize_id_documents' is only available for API version V2_1 and up" + "Method 'begin_recognize_id_documents' is only available for API version V2_1_PREVIEW and up" ) raise e @@ -453,7 +453,7 @@ def begin_recognize_id_documents_from_url(self, id_document_url, **kwargs): if "begin_analyze_id_document_async" in str(e): raise ValueError( "Method 'begin_recognize_id_documents_from_url' is " - "only available for API version V2_1 and up" + "only available for API version V2_1_PREVIEW and up" ) raise e @@ -523,7 +523,7 @@ def begin_recognize_invoices(self, invoice, **kwargs): except ValueError as e: if "begin_analyze_invoice_async" in str(e): raise ValueError( - "Method 'begin_recognize_invoices' is only available for API version V2_1 and up" + "Method 'begin_recognize_invoices' is only available for API version V2_1_PREVIEW and up" ) raise e @@ -571,7 +571,7 @@ def begin_recognize_invoices_from_url(self, invoice_url, **kwargs): if "begin_analyze_invoice_async" in str(e): raise ValueError( "Method 'begin_recognize_invoices_from_url' is " - "only available for API version V2_1 and up" + "only available for API version V2_1_PREVIEW and up" ) raise e @@ -644,27 +644,27 @@ def begin_recognize_content(self, form, **kwargs): # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1 and up" + "'pages' is only available for API version V2_1_PREVIEW and up" ) if reading_order: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"reading_order": reading_order}) else: raise ValueError( - "'reading_order' is only available for API version V2_1 and up" + "'reading_order' is only available for API version V2_1_PREVIEW and up" ) if language: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"language": language}) else: raise ValueError( - "'language' is only available for API version V2_1 and up" + "'language' is only available for API version V2_1_PREVIEW and up" ) return self._client.begin_analyze_layout_async( # type: ignore @@ -714,27 +714,27 @@ def begin_recognize_content_from_url(self, form_url, **kwargs): # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1 and up" + "'pages' is only available for API version V2_1_PREVIEW and up" ) if reading_order: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"reading_order": reading_order}) else: raise ValueError( - "'reading_order' is only available for API version V2_1 and up" + "'reading_order' is only available for API version V2_1_PREVIEW and up" ) if language: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"language": language}) else: raise ValueError( - "'language' is only available for API version V2_1 and up" + "'language' is only available for API version V2_1_PREVIEW and up" ) return self._client.begin_analyze_layout_async( # type: ignore @@ -817,11 +817,11 @@ def analyze_callback( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1 and up" + "'pages' is only available for API version V2_1_PREVIEW and up" ) return self._client.begin_analyze_with_custom_model( # type: ignore @@ -886,11 +886,11 @@ def analyze_callback( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1 and up" + "'pages' is only available for API version V2_1_PREVIEW and up" ) return self._client.begin_analyze_with_custom_model( # type: ignore diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py index 8bab61a45e61..35fbf3b7bc79 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py @@ -135,7 +135,7 @@ def callback_v2_1(raw_response, _, headers): # pylint: disable=unused-argument model_name = kwargs.pop("model_name", None) if model_name and self._api_version == "2.0": raise ValueError( - "'model_name' is only available for API version V2_1 and up" + "'model_name' is only available for API version V2_1_PREVIEW and up" ) continuation_token = kwargs.pop("continuation_token", None) polling_interval = kwargs.pop( @@ -492,7 +492,7 @@ def _compose_callback( ) except ValueError: raise ValueError( - "Method 'begin_create_composed_model' is only available for API version V2_1 and up" + "Method 'begin_create_composed_model' is only available for API version V2_1_PREVIEW and up" ) def get_form_recognizer_client(self, **kwargs): diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_form_recognizer_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_form_recognizer_client.py index 70711a41213c..fafcbdb9436f 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_form_recognizer_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_form_recognizer_client.py @@ -55,12 +55,11 @@ class FormRecognizerClient(FormRecognizerClientOperationsMixin, MultiApiClientMi :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2.1' + DEFAULT_API_VERSION = '2.1-preview.3' _PROFILE_TAG = "azure.ai.formrecognizer.FormRecognizerClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, - 'train_custom_model_async': '2.0', }}, _PROFILE_TAG + " latest" ) @@ -77,6 +76,8 @@ def __init__( base_url = '{endpoint}/formrecognizer/v2.0' elif api_version == '2.1': base_url = '{endpoint}/formrecognizer/v2.1' + elif api_version == '2.1-preview.3': + base_url = '{endpoint}/formrecognizer/v2.1-preview.3' else: raise ValueError("API version {} is not available".format(api_version)) self._config = FormRecognizerClientConfiguration(credential, endpoint, **kwargs) @@ -96,6 +97,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2.0: :mod:`v2_0.models` * 2.1: :mod:`v2_1.models` + * 2.1-preview.3: :mod:`v2_1_preview_3.models` """ if api_version == '2.0': from .v2_0 import models @@ -103,6 +105,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2.1': from .v2_1 import models return models + elif api_version == '2.1-preview.3': + from .v2_1_preview_3 import models + return models raise ValueError("API version {} is not available".format(api_version)) def close(self): diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_operations_mixin.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_operations_mixin.py index 166066a26dd9..3f5104d48717 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_operations_mixin.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_operations_mixin.py @@ -45,13 +45,13 @@ def begin_analyze_business_card_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response @@ -67,6 +67,8 @@ def begin_analyze_business_card_async( api_version = self._get_api_version('begin_analyze_business_card_async') if api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_business_card_async'".format(api_version)) mixin_instance = OperationClass() @@ -98,7 +100,7 @@ def begin_analyze_id_document_async( range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response @@ -114,6 +116,8 @@ def begin_analyze_id_document_async( api_version = self._get_api_version('begin_analyze_id_document_async') if api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_id_document_async'".format(api_version)) mixin_instance = OperationClass() @@ -143,13 +147,13 @@ def begin_analyze_invoice_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response @@ -165,6 +169,8 @@ def begin_analyze_invoice_async( api_version = self._get_api_version('begin_analyze_invoice_async') if api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_invoice_async'".format(api_version)) mixin_instance = OperationClass() @@ -212,12 +218,12 @@ def begin_analyze_layout_async( seventy-three languages and handwritten – English only). Layout supports auto language identification and multi language documents, so only provide a language code if you would like to force the documented to be processed as that specific language. - :type language: str or ~azure.ai.formrecognizer.v2_1.models.Language + :type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language :param reading_order: Reading order algorithm to sort the text lines returned. Supported reading orders include: basic(default), natural. - :type reading_order: str or ~azure.ai.formrecognizer.v2_1.models.ReadingOrder + :type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response @@ -235,6 +241,8 @@ def begin_analyze_layout_async( from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_layout_async'".format(api_version)) mixin_instance = OperationClass() @@ -248,6 +256,8 @@ def begin_analyze_layout_async( return mixin_instance.begin_analyze_layout_async(file_stream, **kwargs) elif api_version == '2.1': return mixin_instance.begin_analyze_layout_async(pages, language, reading_order, file_stream, **kwargs) + elif api_version == '2.1-preview.3': + return mixin_instance.begin_analyze_layout_async(pages, language, reading_order, file_stream, **kwargs) def begin_analyze_receipt_async( self, @@ -268,13 +278,13 @@ def begin_analyze_receipt_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response @@ -292,6 +302,8 @@ def begin_analyze_receipt_async( from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_receipt_async'".format(api_version)) mixin_instance = OperationClass() @@ -305,6 +317,8 @@ def begin_analyze_receipt_async( return mixin_instance.begin_analyze_receipt_async(include_text_details, file_stream, **kwargs) elif api_version == '2.1': return mixin_instance.begin_analyze_receipt_async(include_text_details, locale, pages, file_stream, **kwargs) + elif api_version == '2.1-preview.3': + return mixin_instance.begin_analyze_receipt_async(include_text_details, locale, pages, file_stream, **kwargs) def begin_analyze_with_custom_model( self, @@ -330,7 +344,7 @@ def begin_analyze_with_custom_model( range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response @@ -348,6 +362,8 @@ def begin_analyze_with_custom_model( from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_with_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -361,6 +377,8 @@ def begin_analyze_with_custom_model( return mixin_instance.begin_analyze_with_custom_model(model_id, include_text_details, file_stream, **kwargs) elif api_version == '2.1': return mixin_instance.begin_analyze_with_custom_model(model_id, include_text_details, pages, file_stream, **kwargs) + elif api_version == '2.1-preview.3': + return mixin_instance.begin_analyze_with_custom_model(model_id, include_text_details, pages, file_stream, **kwargs) def begin_compose_custom_models_async( self, @@ -374,7 +392,7 @@ def begin_compose_custom_models_async( It would validate limit of models put together. :param compose_request: Compose models. - :type compose_request: ~azure.ai.formrecognizer.v2_1.models.ComposeRequest + :type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be LROBasePolling. @@ -388,6 +406,8 @@ def begin_compose_custom_models_async( api_version = self._get_api_version('begin_compose_custom_models_async') if api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_compose_custom_models_async'".format(api_version)) mixin_instance = OperationClass() @@ -412,7 +432,7 @@ def begin_copy_custom_model( :param model_id: Model identifier. :type model_id: str :param copy_request: Copy request parameters. - :type copy_request: ~azure.ai.formrecognizer.v2_1.models.CopyRequest + :type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be LROBasePolling. @@ -428,6 +448,8 @@ def begin_copy_custom_model( from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_copy_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -456,7 +478,7 @@ def begin_train_custom_model_async( or 'image/bmp'. Other type of content is ignored. :param train_request: Training request parameters. - :type train_request: ~azure.ai.formrecognizer.v2_1.models.TrainRequest + :type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be LROBasePolling. @@ -470,6 +492,8 @@ def begin_train_custom_model_async( api_version = self._get_api_version('begin_train_custom_model_async') if api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_train_custom_model_async'".format(api_version)) mixin_instance = OperationClass() @@ -502,6 +526,8 @@ def delete_custom_model( from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'delete_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -522,7 +548,7 @@ def generate_model_copy_authorization( :keyword callable cls: A custom type or function that will be passed the direct response :return: CopyAuthorizationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.CopyAuthorizationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('generate_model_copy_authorization') @@ -530,6 +556,8 @@ def generate_model_copy_authorization( from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'generate_model_copy_authorization'".format(api_version)) mixin_instance = OperationClass() @@ -553,12 +581,14 @@ def get_analyze_business_card_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_business_card_result') if api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_business_card_result'".format(api_version)) mixin_instance = OperationClass() @@ -585,7 +615,7 @@ def get_analyze_form_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_form_result') @@ -593,6 +623,8 @@ def get_analyze_form_result( from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_form_result'".format(api_version)) mixin_instance = OperationClass() @@ -616,12 +648,14 @@ def get_analyze_id_document_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_id_document_result') if api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_id_document_result'".format(api_version)) mixin_instance = OperationClass() @@ -645,12 +679,14 @@ def get_analyze_invoice_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_invoice_result') if api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_invoice_result'".format(api_version)) mixin_instance = OperationClass() @@ -674,7 +710,7 @@ def get_analyze_layout_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_layout_result') @@ -682,6 +718,8 @@ def get_analyze_layout_result( from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_layout_result'".format(api_version)) mixin_instance = OperationClass() @@ -705,7 +743,7 @@ def get_analyze_receipt_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_receipt_result') @@ -713,6 +751,8 @@ def get_analyze_receipt_result( from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_receipt_result'".format(api_version)) mixin_instance = OperationClass() @@ -739,7 +779,7 @@ def get_custom_model( :type include_keys: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: Model, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.Model + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_custom_model') @@ -747,6 +787,8 @@ def get_custom_model( from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -773,7 +815,7 @@ def get_custom_model_copy_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CopyOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.CopyOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_custom_model_copy_result') @@ -781,6 +823,8 @@ def get_custom_model_copy_result( from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_custom_model_copy_result'".format(api_version)) mixin_instance = OperationClass() @@ -801,7 +845,7 @@ def get_custom_models( :keyword callable cls: A custom type or function that will be passed the direct response :return: Models, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.Models + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Models :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_custom_models') @@ -809,6 +853,8 @@ def get_custom_models( from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_custom_models'".format(api_version)) mixin_instance = OperationClass() @@ -829,7 +875,7 @@ def list_custom_models( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Models or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.formrecognizer.v2_1.models.Models] + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.formrecognizer.v2_1_preview_3.models.Models] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_custom_models') @@ -837,6 +883,8 @@ def list_custom_models( from .v2_0.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from .v2_1.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from .v2_1_preview_3.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_custom_models'".format(api_version)) mixin_instance = OperationClass() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_form_recognizer_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_form_recognizer_client.py index 96db4056a936..e393731f69a0 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_form_recognizer_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_form_recognizer_client.py @@ -53,12 +53,11 @@ class FormRecognizerClient(FormRecognizerClientOperationsMixin, MultiApiClientMi :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2.1' + DEFAULT_API_VERSION = '2.1-preview.3' _PROFILE_TAG = "azure.ai.formrecognizer.FormRecognizerClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, - 'train_custom_model_async': '2.0', }}, _PROFILE_TAG + " latest" ) @@ -75,6 +74,8 @@ def __init__( base_url = '{endpoint}/formrecognizer/v2.0' elif api_version == '2.1': base_url = '{endpoint}/formrecognizer/v2.1' + elif api_version == '2.1-preview.3': + base_url = '{endpoint}/formrecognizer/v2.1-preview.3' else: raise ValueError("API version {} is not available".format(api_version)) self._config = FormRecognizerClientConfiguration(credential, endpoint, **kwargs) @@ -94,6 +95,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2.0: :mod:`v2_0.models` * 2.1: :mod:`v2_1.models` + * 2.1-preview.3: :mod:`v2_1_preview_3.models` """ if api_version == '2.0': from ..v2_0 import models @@ -101,6 +103,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2.1': from ..v2_1 import models return models + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3 import models + return models raise ValueError("API version {} is not available".format(api_version)) async def close(self): diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_operations_mixin.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_operations_mixin.py index 6ec0092a0fd9..cee54d95b116 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_operations_mixin.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_operations_mixin.py @@ -41,13 +41,13 @@ async def begin_analyze_business_card_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response @@ -63,6 +63,8 @@ async def begin_analyze_business_card_async( api_version = self._get_api_version('begin_analyze_business_card_async') if api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_business_card_async'".format(api_version)) mixin_instance = OperationClass() @@ -94,7 +96,7 @@ async def begin_analyze_id_document_async( range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response @@ -110,6 +112,8 @@ async def begin_analyze_id_document_async( api_version = self._get_api_version('begin_analyze_id_document_async') if api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_id_document_async'".format(api_version)) mixin_instance = OperationClass() @@ -139,13 +143,13 @@ async def begin_analyze_invoice_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response @@ -161,6 +165,8 @@ async def begin_analyze_invoice_async( api_version = self._get_api_version('begin_analyze_invoice_async') if api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_invoice_async'".format(api_version)) mixin_instance = OperationClass() @@ -208,12 +214,12 @@ async def begin_analyze_layout_async( seventy-three languages and handwritten – English only). Layout supports auto language identification and multi language documents, so only provide a language code if you would like to force the documented to be processed as that specific language. - :type language: str or ~azure.ai.formrecognizer.v2_1.models.Language + :type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language :param reading_order: Reading order algorithm to sort the text lines returned. Supported reading orders include: basic(default), natural. - :type reading_order: str or ~azure.ai.formrecognizer.v2_1.models.ReadingOrder + :type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response @@ -231,6 +237,8 @@ async def begin_analyze_layout_async( from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_layout_async'".format(api_version)) mixin_instance = OperationClass() @@ -244,6 +252,8 @@ async def begin_analyze_layout_async( return await mixin_instance.begin_analyze_layout_async(file_stream, **kwargs) elif api_version == '2.1': return await mixin_instance.begin_analyze_layout_async(pages, language, reading_order, file_stream, **kwargs) + elif api_version == '2.1-preview.3': + return await mixin_instance.begin_analyze_layout_async(pages, language, reading_order, file_stream, **kwargs) async def begin_analyze_receipt_async( self, @@ -264,13 +274,13 @@ async def begin_analyze_receipt_async( :type include_text_details: bool :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default). - :type locale: str or ~azure.ai.formrecognizer.v2_1.models.Locale + :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response @@ -288,6 +298,8 @@ async def begin_analyze_receipt_async( from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_receipt_async'".format(api_version)) mixin_instance = OperationClass() @@ -301,6 +313,8 @@ async def begin_analyze_receipt_async( return await mixin_instance.begin_analyze_receipt_async(include_text_details, file_stream, **kwargs) elif api_version == '2.1': return await mixin_instance.begin_analyze_receipt_async(include_text_details, locale, pages, file_stream, **kwargs) + elif api_version == "2.1-preview.3": + return await mixin_instance.begin_analyze_receipt_async(include_text_details, locale, pages, file_stream, **kwargs) async def begin_analyze_with_custom_model( self, @@ -326,7 +340,7 @@ async def begin_analyze_with_custom_model( range with a comma. :type pages: list[str] :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. - :type file_stream: IO or ~azure.ai.formrecognizer.v2_1.models.SourcePath + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". :keyword callable cls: A custom type or function that will be passed the direct response @@ -344,6 +358,8 @@ async def begin_analyze_with_custom_model( from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_analyze_with_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -357,6 +373,8 @@ async def begin_analyze_with_custom_model( return await mixin_instance.begin_analyze_with_custom_model(model_id, include_text_details, file_stream, **kwargs) elif api_version == '2.1': return await mixin_instance.begin_analyze_with_custom_model(model_id, include_text_details, pages, file_stream, **kwargs) + elif api_version == '2.1-preview.3': + return await mixin_instance.begin_analyze_with_custom_model(model_id, include_text_details, pages, file_stream, **kwargs) async def begin_compose_custom_models_async( self, @@ -370,7 +388,7 @@ async def begin_compose_custom_models_async( It would validate limit of models put together. :param compose_request: Compose models. - :type compose_request: ~azure.ai.formrecognizer.v2_1.models.ComposeRequest + :type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncLROBasePolling. @@ -384,6 +402,8 @@ async def begin_compose_custom_models_async( api_version = self._get_api_version('begin_compose_custom_models_async') if api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_compose_custom_models_async'".format(api_version)) mixin_instance = OperationClass() @@ -408,7 +428,7 @@ async def begin_copy_custom_model( :param model_id: Model identifier. :type model_id: str :param copy_request: Copy request parameters. - :type copy_request: ~azure.ai.formrecognizer.v2_1.models.CopyRequest + :type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncLROBasePolling. @@ -424,6 +444,8 @@ async def begin_copy_custom_model( from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_copy_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -452,7 +474,7 @@ async def begin_train_custom_model_async( or 'image/bmp'. Other type of content is ignored. :param train_request: Training request parameters. - :type train_request: ~azure.ai.formrecognizer.v2_1.models.TrainRequest + :type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncLROBasePolling. @@ -466,6 +488,8 @@ async def begin_train_custom_model_async( api_version = self._get_api_version('begin_train_custom_model_async') if api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_train_custom_model_async'".format(api_version)) mixin_instance = OperationClass() @@ -498,6 +522,8 @@ async def delete_custom_model( from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'delete_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -518,7 +544,7 @@ async def generate_model_copy_authorization( :keyword callable cls: A custom type or function that will be passed the direct response :return: CopyAuthorizationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.CopyAuthorizationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('generate_model_copy_authorization') @@ -526,6 +552,8 @@ async def generate_model_copy_authorization( from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'generate_model_copy_authorization'".format(api_version)) mixin_instance = OperationClass() @@ -549,12 +577,14 @@ async def get_analyze_business_card_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_business_card_result') if api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_business_card_result'".format(api_version)) mixin_instance = OperationClass() @@ -581,7 +611,7 @@ async def get_analyze_form_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_form_result') @@ -589,6 +619,8 @@ async def get_analyze_form_result( from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_form_result'".format(api_version)) mixin_instance = OperationClass() @@ -612,12 +644,14 @@ async def get_analyze_id_document_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_id_document_result') if api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_id_document_result'".format(api_version)) mixin_instance = OperationClass() @@ -641,12 +675,14 @@ async def get_analyze_invoice_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_invoice_result') if api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_invoice_result'".format(api_version)) mixin_instance = OperationClass() @@ -670,7 +706,7 @@ async def get_analyze_layout_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_layout_result') @@ -678,6 +714,8 @@ async def get_analyze_layout_result( from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_layout_result'".format(api_version)) mixin_instance = OperationClass() @@ -701,7 +739,7 @@ async def get_analyze_receipt_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.AnalyzeOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_analyze_receipt_result') @@ -709,6 +747,8 @@ async def get_analyze_receipt_result( from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_analyze_receipt_result'".format(api_version)) mixin_instance = OperationClass() @@ -735,7 +775,7 @@ async def get_custom_model( :type include_keys: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: Model, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.Model + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_custom_model') @@ -743,6 +783,8 @@ async def get_custom_model( from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_custom_model'".format(api_version)) mixin_instance = OperationClass() @@ -769,7 +811,7 @@ async def get_custom_model_copy_result( :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CopyOperationResult, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.CopyOperationResult + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_custom_model_copy_result') @@ -777,6 +819,8 @@ async def get_custom_model_copy_result( from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_custom_model_copy_result'".format(api_version)) mixin_instance = OperationClass() @@ -797,7 +841,7 @@ async def get_custom_models( :keyword callable cls: A custom type or function that will be passed the direct response :return: Models, or the result of cls(response) - :rtype: ~azure.ai.formrecognizer.v2_1.models.Models + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Models :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_custom_models') @@ -805,6 +849,8 @@ async def get_custom_models( from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_custom_models'".format(api_version)) mixin_instance = OperationClass() @@ -825,7 +871,7 @@ def list_custom_models( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Models or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.formrecognizer.v2_1.models.Models] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.formrecognizer.v2_1_preview_3.models.Models] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_custom_models') @@ -833,6 +879,8 @@ def list_custom_models( from ..v2_0.aio.operations import FormRecognizerClientOperationsMixin as OperationClass elif api_version == '2.1': from ..v2_1.aio.operations import FormRecognizerClientOperationsMixin as OperationClass + elif api_version == '2.1-preview.3': + from ..v2_1_preview_3.aio.operations import FormRecognizerClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_custom_models'".format(api_version)) mixin_instance = OperationClass() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/models.py index 5b454eea28d5..6c7122cc10ed 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/models.py @@ -4,5 +4,4 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from .v2_0.models import * -from .v2_1.models import * +from .v2_1_preview_3.models import * diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/__init__.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/__init__.py new file mode 100644 index 000000000000..d4be1e681b60 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._form_recognizer_client import FormRecognizerClient +__all__ = ['FormRecognizerClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_configuration.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_configuration.py new file mode 100644 index 000000000000..e835a903b4f3 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_configuration.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class FormRecognizerClientConfiguration(Configuration): + """Configuration for FormRecognizerClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). + :type endpoint: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + endpoint, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + super(FormRecognizerClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.endpoint = endpoint + self.credential_scopes = kwargs.pop('credential_scopes', ['https://cognitiveservices.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'ai-formrecognizer/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_form_recognizer_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_form_recognizer_client.py new file mode 100644 index 000000000000..5ab44db519d4 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_form_recognizer_client.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core import PipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import FormRecognizerClientConfiguration +from .operations import FormRecognizerClientOperationsMixin +from . import models + + +class FormRecognizerClient(FormRecognizerClientOperationsMixin): + """Extracts information from forms and images into structured data. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). + :type endpoint: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + endpoint, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + base_url = '{endpoint}/formrecognizer/v2.1-preview.3' + self._config = FormRecognizerClientConfiguration(credential, endpoint, **kwargs) + self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> FormRecognizerClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_metadata.json b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_metadata.json new file mode 100644 index 000000000000..d99f04b0bb0e --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/_metadata.json @@ -0,0 +1,456 @@ +{ + "chosen_version": "2.1-preview.3", + "total_api_version_list": ["2.1-preview.3"], + "client": { + "name": "FormRecognizerClient", + "filename": "_form_recognizer_client", + "description": "Extracts information from forms and images into structured data.", + "base_url": null, + "custom_base_url": "\u0027{endpoint}/formrecognizer/v2.1-preview.3\u0027", + "azure_arm": false, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"PipelineClient\"]}, \"local\": {\"._configuration\": [\"FormRecognizerClientConfiguration\"], \"._operations_mixin\": [\"FormRecognizerClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"AsyncPipelineClient\"]}, \"local\": {\"._configuration\": [\"FormRecognizerClientConfiguration\"], \"._operations_mixin\": [\"FormRecognizerClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "endpoint": { + "signature": "endpoint, # type: str", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "endpoint": { + "signature": "endpoint: str,", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, endpoint", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://cognitiveservices.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + }, + "operation_mixins": { + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.polling\": [\"LROPoller\", \"NoPolling\", \"PollingMethod\"], \"azure.core.polling.base_polling\": [\"LROBasePolling\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"IO\", \"Iterable\", \"List\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.polling\": [\"AsyncLROPoller\", \"AsyncNoPolling\", \"AsyncPollingMethod\"], \"azure.core.polling.async_base_polling\": [\"AsyncLROBasePolling\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"IO\", \"List\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "operations": { + "_train_custom_model_async_initial" : { + "sync": { + "signature": "def _train_custom_model_async_initial(\n self,\n train_request, # type: \"_models.TrainRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param train_request: Training request parameters.\n:type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _train_custom_model_async_initial(\n self,\n train_request: \"_models.TrainRequest\",\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param train_request: Training request parameters.\n:type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "train_request" + }, + "begin_train_custom_model_async" : { + "sync": { + "signature": "def begin_train_custom_model_async(\n self,\n train_request, # type: \"_models.TrainRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Train Custom Model.\n\nCreate and train a custom model. The request must include a source parameter that is either an\nexternally accessible Azure storage blob container Uri (preferably a Shared Access Signature\nUri) or valid path to a data folder in a locally mounted drive. When local paths are specified,\nthey must follow the Linux/Unix path format and be an absolute path rooted to the input mount\nconfiguration setting value e.g., if \u0027{Mounts:Input}\u0027 configuration setting value is \u0027/input\u0027\nthen a valid source path would be \u0027/input/contosodataset\u0027. All data to be trained is expected\nto be under the source folder or sub folders under it. Models are trained using documents that\nare of the following content type - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027\nor \u0027image/bmp\u0027. Other type of content is ignored.\n\n:param train_request: Training request parameters.\n:type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_train_custom_model_async(\n self,\n train_request: \"_models.TrainRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Train Custom Model.\n\nCreate and train a custom model. The request must include a source parameter that is either an\nexternally accessible Azure storage blob container Uri (preferably a Shared Access Signature\nUri) or valid path to a data folder in a locally mounted drive. When local paths are specified,\nthey must follow the Linux/Unix path format and be an absolute path rooted to the input mount\nconfiguration setting value e.g., if \u0027{Mounts:Input}\u0027 configuration setting value is \u0027/input\u0027\nthen a valid source path would be \u0027/input/contosodataset\u0027. All data to be trained is expected\nto be under the source folder or sub folders under it. Models are trained using documents that\nare of the following content type - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027\nor \u0027image/bmp\u0027. Other type of content is ignored.\n\n:param train_request: Training request parameters.\n:type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "train_request" + }, + "get_custom_model" : { + "sync": { + "signature": "def get_custom_model(\n self,\n model_id, # type: str\n include_keys=False, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get Custom Model.\n\nGet detailed information about a custom model.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_keys: Include list of extracted keys in model information.\n:type include_keys: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Model, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Model\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_custom_model(\n self,\n model_id: str,\n include_keys: Optional[bool] = False,\n **kwargs\n) -\u003e \"_models.Model\":\n", + "doc": "\"\"\"Get Custom Model.\n\nGet detailed information about a custom model.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_keys: Include list of extracted keys in model information.\n:type include_keys: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Model, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Model\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "model_id, include_keys" + }, + "delete_custom_model" : { + "sync": { + "signature": "def delete_custom_model(\n self,\n model_id, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Delete Custom Model.\n\nMark model for deletion. Model artifacts will be permanently removed within a predetermined\nperiod.\n\n:param model_id: Model identifier.\n:type model_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def delete_custom_model(\n self,\n model_id: str,\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"Delete Custom Model.\n\nMark model for deletion. Model artifacts will be permanently removed within a predetermined\nperiod.\n\n:param model_id: Model identifier.\n:type model_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "model_id" + }, + "_analyze_with_custom_model_initial" : { + "sync": { + "signature": "def _analyze_with_custom_model_initial(\n self,\n model_id, # type: str\n include_text_details=False, # type: Optional[bool]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _analyze_with_custom_model_initial(\n self,\n model_id: str,\n include_text_details: Optional[bool] = False,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "model_id, include_text_details, pages, file_stream" + }, + "begin_analyze_with_custom_model" : { + "sync": { + "signature": "def begin_analyze_with_custom_model(\n self,\n model_id, # type: str\n include_text_details=False, # type: Optional[bool]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Analyze Form.\n\nExtract key-value pairs, tables, and semantic values from a given document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri or local path) of the document to be analyzed.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_analyze_with_custom_model(\n self,\n model_id: str,\n include_text_details: Optional[bool] = False,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Analyze Form.\n\nExtract key-value pairs, tables, and semantic values from a given document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri or local path) of the document to be analyzed.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "model_id, include_text_details, pages, file_stream" + }, + "get_analyze_form_result" : { + "sync": { + "signature": "def get_analyze_form_result(\n self,\n model_id, # type: str\n result_id, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get Analyze Form Result.\n\nObtain current status and the result of the analyze form operation.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_analyze_form_result(\n self,\n model_id: str,\n result_id: str,\n **kwargs\n) -\u003e \"_models.AnalyzeOperationResult\":\n", + "doc": "\"\"\"Get Analyze Form Result.\n\nObtain current status and the result of the analyze form operation.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "model_id, result_id" + }, + "_copy_custom_model_initial" : { + "sync": { + "signature": "def _copy_custom_model_initial(\n self,\n model_id, # type: str\n copy_request, # type: \"_models.CopyRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _copy_custom_model_initial(\n self,\n model_id: str,\n copy_request: \"_models.CopyRequest\",\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "model_id, copy_request" + }, + "begin_copy_custom_model" : { + "sync": { + "signature": "def begin_copy_custom_model(\n self,\n model_id, # type: str\n copy_request, # type: \"_models.CopyRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Copy Custom Model.\n\nCopy custom model stored in this resource (the source) to user specified target Form Recognizer\nresource.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_copy_custom_model(\n self,\n model_id: str,\n copy_request: \"_models.CopyRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Copy Custom Model.\n\nCopy custom model stored in this resource (the source) to user specified target Form Recognizer\nresource.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param copy_request: Copy request parameters.\n:type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "model_id, copy_request" + }, + "get_custom_model_copy_result" : { + "sync": { + "signature": "def get_custom_model_copy_result(\n self,\n model_id, # type: str\n result_id, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get Custom Model Copy Result.\n\nObtain current status and the result of a custom model copy operation.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param result_id: Copy operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_custom_model_copy_result(\n self,\n model_id: str,\n result_id: str,\n **kwargs\n) -\u003e \"_models.CopyOperationResult\":\n", + "doc": "\"\"\"Get Custom Model Copy Result.\n\nObtain current status and the result of a custom model copy operation.\n\n:param model_id: Model identifier.\n:type model_id: str\n:param result_id: Copy operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "model_id, result_id" + }, + "generate_model_copy_authorization" : { + "sync": { + "signature": "def generate_model_copy_authorization(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Generate Copy Authorization.\n\nGenerate authorization to copy a model into the target Form Recognizer resource.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyAuthorizationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def generate_model_copy_authorization(\n self,\n **kwargs\n) -\u003e \"_models.CopyAuthorizationResult\":\n", + "doc": "\"\"\"Generate Copy Authorization.\n\nGenerate authorization to copy a model into the target Form Recognizer resource.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyAuthorizationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "_compose_custom_models_async_initial" : { + "sync": { + "signature": "def _compose_custom_models_async_initial(\n self,\n compose_request, # type: \"_models.ComposeRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param compose_request: Compose models.\n:type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _compose_custom_models_async_initial(\n self,\n compose_request: \"_models.ComposeRequest\",\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param compose_request: Compose models.\n:type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "compose_request" + }, + "begin_compose_custom_models_async" : { + "sync": { + "signature": "def begin_compose_custom_models_async(\n self,\n compose_request, # type: \"_models.ComposeRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Compose trained with labels models into one composed model.\n\nCompose request would include list of models ids.\nIt would validate what all models either trained with labels model or composed model.\nIt would validate limit of models put together.\n\n:param compose_request: Compose models.\n:type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_compose_custom_models_async(\n self,\n compose_request: \"_models.ComposeRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Compose trained with labels models into one composed model.\n\nCompose request would include list of models ids.\nIt would validate what all models either trained with labels model or composed model.\nIt would validate limit of models put together.\n\n:param compose_request: Compose models.\n:type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "compose_request" + }, + "_analyze_business_card_async_initial" : { + "sync": { + "signature": "def _analyze_business_card_async_initial(\n self,\n include_text_details=False, # type: Optional[bool]\n locale=None, # type: Optional[Union[str, \"_models.Locale\"]]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _analyze_business_card_async_initial(\n self,\n include_text_details: Optional[bool] = False,\n locale: Optional[Union[str, \"_models.Locale\"]] = None,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "include_text_details, locale, pages, file_stream" + }, + "begin_analyze_business_card_async" : { + "sync": { + "signature": "def begin_analyze_business_card_async(\n self,\n include_text_details=False, # type: Optional[bool]\n locale=None, # type: Optional[Union[str, \"_models.Locale\"]]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Analyze Business Card.\n\nExtract field text and semantic values from a given business card document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_analyze_business_card_async(\n self,\n include_text_details: Optional[bool] = False,\n locale: Optional[Union[str, \"_models.Locale\"]] = None,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Analyze Business Card.\n\nExtract field text and semantic values from a given business card document. The input document\nmust be of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "include_text_details, locale, pages, file_stream" + }, + "get_analyze_business_card_result" : { + "sync": { + "signature": "def get_analyze_business_card_result(\n self,\n result_id, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get Analyze Business Card Result.\n\nTrack the progress and obtain the result of the analyze business card operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_analyze_business_card_result(\n self,\n result_id: str,\n **kwargs\n) -\u003e \"_models.AnalyzeOperationResult\":\n", + "doc": "\"\"\"Get Analyze Business Card Result.\n\nTrack the progress and obtain the result of the analyze business card operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "result_id" + }, + "_analyze_invoice_async_initial" : { + "sync": { + "signature": "def _analyze_invoice_async_initial(\n self,\n include_text_details=False, # type: Optional[bool]\n locale=None, # type: Optional[Union[str, \"_models.Locale\"]]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _analyze_invoice_async_initial(\n self,\n include_text_details: Optional[bool] = False,\n locale: Optional[Union[str, \"_models.Locale\"]] = None,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "include_text_details, locale, pages, file_stream" + }, + "begin_analyze_invoice_async" : { + "sync": { + "signature": "def begin_analyze_invoice_async(\n self,\n include_text_details=False, # type: Optional[bool]\n locale=None, # type: Optional[Union[str, \"_models.Locale\"]]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Analyze Invoice Document.\n\nExtract field text and semantic values from a given invoice document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_analyze_invoice_async(\n self,\n include_text_details: Optional[bool] = False,\n locale: Optional[Union[str, \"_models.Locale\"]] = None,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Analyze Invoice Document.\n\nExtract field text and semantic values from a given invoice document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "include_text_details, locale, pages, file_stream" + }, + "get_analyze_invoice_result" : { + "sync": { + "signature": "def get_analyze_invoice_result(\n self,\n result_id, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get Analyze Invoice Result.\n\nTrack the progress and obtain the result of the analyze invoice operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_analyze_invoice_result(\n self,\n result_id: str,\n **kwargs\n) -\u003e \"_models.AnalyzeOperationResult\":\n", + "doc": "\"\"\"Get Analyze Invoice Result.\n\nTrack the progress and obtain the result of the analyze invoice operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "result_id" + }, + "_analyze_id_document_async_initial" : { + "sync": { + "signature": "def _analyze_id_document_async_initial(\n self,\n include_text_details=False, # type: Optional[bool]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _analyze_id_document_async_initial(\n self,\n include_text_details: Optional[bool] = False,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "include_text_details, pages, file_stream" + }, + "begin_analyze_id_document_async" : { + "sync": { + "signature": "def begin_analyze_id_document_async(\n self,\n include_text_details=False, # type: Optional[bool]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Analyze ID Document.\n\nExtract field text and semantic values from a given ID document. The input document must be of\none of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027\nor \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri) of the\ndocument to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_analyze_id_document_async(\n self,\n include_text_details: Optional[bool] = False,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Analyze ID Document.\n\nExtract field text and semantic values from a given ID document. The input document must be of\none of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027\nor \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri) of the\ndocument to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "include_text_details, pages, file_stream" + }, + "get_analyze_id_document_result" : { + "sync": { + "signature": "def get_analyze_id_document_result(\n self,\n result_id, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get Analyze ID Document Result.\n\nTrack the progress and obtain the result of the analyze ID operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_analyze_id_document_result(\n self,\n result_id: str,\n **kwargs\n) -\u003e \"_models.AnalyzeOperationResult\":\n", + "doc": "\"\"\"Get Analyze ID Document Result.\n\nTrack the progress and obtain the result of the analyze ID operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "result_id" + }, + "_analyze_receipt_async_initial" : { + "sync": { + "signature": "def _analyze_receipt_async_initial(\n self,\n include_text_details=False, # type: Optional[bool]\n locale=None, # type: Optional[Union[str, \"_models.Locale\"]]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _analyze_receipt_async_initial(\n self,\n include_text_details: Optional[bool] = False,\n locale: Optional[Union[str, \"_models.Locale\"]] = None,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "include_text_details, locale, pages, file_stream" + }, + "begin_analyze_receipt_async" : { + "sync": { + "signature": "def begin_analyze_receipt_async(\n self,\n include_text_details=False, # type: Optional[bool]\n locale=None, # type: Optional[Union[str, \"_models.Locale\"]]\n pages=None, # type: Optional[List[str]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Analyze Receipt.\n\nExtract field text and semantic values from a given receipt document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_analyze_receipt_async(\n self,\n include_text_details: Optional[bool] = False,\n locale: Optional[Union[str, \"_models.Locale\"]] = None,\n pages: Optional[List[str]] = None,\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Analyze Receipt.\n\nExtract field text and semantic values from a given receipt document. The input document must\nbe of one of the supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027,\n\u0027image/tiff\u0027 or \u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location\n(Uri) of the document to be analyzed.\n\n:param include_text_details: Include text lines and element references in the result.\n:type include_text_details: bool\n:param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB,\n en-IN, en-US(default).\n:type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "include_text_details, locale, pages, file_stream" + }, + "get_analyze_receipt_result" : { + "sync": { + "signature": "def get_analyze_receipt_result(\n self,\n result_id, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get Analyze Receipt Result.\n\nTrack the progress and obtain the result of the analyze receipt operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_analyze_receipt_result(\n self,\n result_id: str,\n **kwargs\n) -\u003e \"_models.AnalyzeOperationResult\":\n", + "doc": "\"\"\"Get Analyze Receipt Result.\n\nTrack the progress and obtain the result of the analyze receipt operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "result_id" + }, + "_analyze_layout_async_initial" : { + "sync": { + "signature": "def _analyze_layout_async_initial(\n self,\n pages=None, # type: Optional[List[str]]\n language=None, # type: Optional[Union[str, \"_models.Language\"]]\n reading_order=\"basic\", # type: Optional[Union[str, \"_models.ReadingOrder\"]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param language: Currently, only Afrikaans (\u2018af\u2019), Albanian (\u2018sq\u2019), Asturian (\u2018ast\u2019), Basque\n (\u2018eu\u2019), Bislama (\u2018bi\u2019), Breton (\u2018br\u2019), Catalan (\u2018ca\u2019), Cebuano (\u2018ceb\u2019), Chamorro (\u2018ch\u2019),\n Cornish (\u2018kw\u2019), Corsican (\u2018co\u2019), Crimean Tatar - Latin script(\u2018crh\u2019), Czech (\u2018cs\u2019), Danish\n (\u2018da\u2019), Dutch (\u2018nl\u2019), English (\u0027en\u0027), Estonian (\u2018et\u2019), Fijian (\u2018fj\u2019), Filipino (\u2018fil\u2019), Finnish\n (\u2018fi\u2019), French (\u2018fr\u2019), Friulian (\u2018fur\u2019), Galician (\u2018gl\u2019), German (\u2018de\u2019), Gilbertese (\u2018gil\u2019),\n Greenlandic (\u2018kl\u2019), Haitian Creole (\u2018ht\u2019), Hani (\u2018hni\u2019), Hmong Daw (\u2018mww\u2019), Hungarian (\u2018hu\u2019),\n Indonesian (\u2018id\u2019), Interlingua (\u2018ia\u2019), Inuktitut (\u2018iu\u2019), Irish (\u2018ga\u2019), Italian (\u2018it\u2019), Japanese\n (\u2018ja\u2019), Javanese (\u2018jv\u2019), Kabuverdianu (\u2018kea\u2019), Kachin (\u2018kac\u2019), Kara-Kalpak (\u2018kaa\u2019), Kashubian\n (\u2018csb\u2019), Khasi (\u2018kha\u2019), Korean (\u2018ko\u2019), Kurdish - Latin script (\u2018ku\u2019), K\u2019iche\u2019 (\u2018quc\u2019),\n Luxembourgish (\u2018lb\u2019), Malay (\u2018ms\u2019), Manx (\u2018gv\u2019), Neapolitan (\u2018nap\u2019), Norwegian (\u2018no\u2019), Occitan\n (\u2018oc\u2019), Polish (\u2018pl\u2019), Portuguese (\u2018pt\u2019), Romansh (\u2018rm\u2019), Scots (\u2018sco\u2019), Scottish Gaelic\n (\u2018gd\u2019), simplified Chinese (\u2018zh-Hans\u2019), Slovenian (\u2018sl\u2019), Spanish (\u2018es\u2019), Swahili (\u2018sw\u2019),\n Swedish (\u2018sv\u2019), Tatar - Latin script (\u2018tt\u2019), Tetum (\u2018tet\u2019), traditional Chinese (\u2018zh-Hant\u2019),\n Turkish (\u2018tr\u2019), Upper Sorbian (\u2018hsb\u2019), Uzbek (\u2018uz\u2019), Volap\u00fck (\u2018vo\u2019), Walser (\u2018wae\u2019), Western\n Frisian (\u2018fy\u2019), Yucatec Maya (\u2018yua\u2019), Zhuang (\u2018za\u2019) and Zulu (\u2018zu\u2019) are supported (print \u2013\n seventy-three languages and handwritten \u2013 English only). Layout supports auto language\n identification and multi language documents, so only provide a language code if you would like\n to force the documented to be processed as that specific language.\n:type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language\n:param reading_order: Reading order algorithm to sort the text lines returned. Supported\n reading orders include: basic(default), natural.\n:type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _analyze_layout_async_initial(\n self,\n pages: Optional[List[str]] = None,\n language: Optional[Union[str, \"_models.Language\"]] = None,\n reading_order: Optional[Union[str, \"_models.ReadingOrder\"]] = \"basic\",\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param language: Currently, only Afrikaans (\u2018af\u2019), Albanian (\u2018sq\u2019), Asturian (\u2018ast\u2019), Basque\n (\u2018eu\u2019), Bislama (\u2018bi\u2019), Breton (\u2018br\u2019), Catalan (\u2018ca\u2019), Cebuano (\u2018ceb\u2019), Chamorro (\u2018ch\u2019),\n Cornish (\u2018kw\u2019), Corsican (\u2018co\u2019), Crimean Tatar - Latin script(\u2018crh\u2019), Czech (\u2018cs\u2019), Danish\n (\u2018da\u2019), Dutch (\u2018nl\u2019), English (\u0027en\u0027), Estonian (\u2018et\u2019), Fijian (\u2018fj\u2019), Filipino (\u2018fil\u2019), Finnish\n (\u2018fi\u2019), French (\u2018fr\u2019), Friulian (\u2018fur\u2019), Galician (\u2018gl\u2019), German (\u2018de\u2019), Gilbertese (\u2018gil\u2019),\n Greenlandic (\u2018kl\u2019), Haitian Creole (\u2018ht\u2019), Hani (\u2018hni\u2019), Hmong Daw (\u2018mww\u2019), Hungarian (\u2018hu\u2019),\n Indonesian (\u2018id\u2019), Interlingua (\u2018ia\u2019), Inuktitut (\u2018iu\u2019), Irish (\u2018ga\u2019), Italian (\u2018it\u2019), Japanese\n (\u2018ja\u2019), Javanese (\u2018jv\u2019), Kabuverdianu (\u2018kea\u2019), Kachin (\u2018kac\u2019), Kara-Kalpak (\u2018kaa\u2019), Kashubian\n (\u2018csb\u2019), Khasi (\u2018kha\u2019), Korean (\u2018ko\u2019), Kurdish - Latin script (\u2018ku\u2019), K\u2019iche\u2019 (\u2018quc\u2019),\n Luxembourgish (\u2018lb\u2019), Malay (\u2018ms\u2019), Manx (\u2018gv\u2019), Neapolitan (\u2018nap\u2019), Norwegian (\u2018no\u2019), Occitan\n (\u2018oc\u2019), Polish (\u2018pl\u2019), Portuguese (\u2018pt\u2019), Romansh (\u2018rm\u2019), Scots (\u2018sco\u2019), Scottish Gaelic\n (\u2018gd\u2019), simplified Chinese (\u2018zh-Hans\u2019), Slovenian (\u2018sl\u2019), Spanish (\u2018es\u2019), Swahili (\u2018sw\u2019),\n Swedish (\u2018sv\u2019), Tatar - Latin script (\u2018tt\u2019), Tetum (\u2018tet\u2019), traditional Chinese (\u2018zh-Hant\u2019),\n Turkish (\u2018tr\u2019), Upper Sorbian (\u2018hsb\u2019), Uzbek (\u2018uz\u2019), Volap\u00fck (\u2018vo\u2019), Walser (\u2018wae\u2019), Western\n Frisian (\u2018fy\u2019), Yucatec Maya (\u2018yua\u2019), Zhuang (\u2018za\u2019) and Zulu (\u2018zu\u2019) are supported (print \u2013\n seventy-three languages and handwritten \u2013 English only). Layout supports auto language\n identification and multi language documents, so only provide a language code if you would like\n to force the documented to be processed as that specific language.\n:type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language\n:param reading_order: Reading order algorithm to sort the text lines returned. Supported\n reading orders include: basic(default), natural.\n:type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "pages, language, reading_order, file_stream" + }, + "begin_analyze_layout_async" : { + "sync": { + "signature": "def begin_analyze_layout_async(\n self,\n pages=None, # type: Optional[List[str]]\n language=None, # type: Optional[Union[str, \"_models.Language\"]]\n reading_order=\"basic\", # type: Optional[Union[str, \"_models.ReadingOrder\"]]\n file_stream=None, # type: Optional[Union[IO, \"_models.SourcePath\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Analyze Layout.\n\nExtract text and layout information from a given document. The input document must be of one of\nthe supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027 or\n\u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param language: Currently, only Afrikaans (\u2018af\u2019), Albanian (\u2018sq\u2019), Asturian (\u2018ast\u2019), Basque\n (\u2018eu\u2019), Bislama (\u2018bi\u2019), Breton (\u2018br\u2019), Catalan (\u2018ca\u2019), Cebuano (\u2018ceb\u2019), Chamorro (\u2018ch\u2019),\n Cornish (\u2018kw\u2019), Corsican (\u2018co\u2019), Crimean Tatar - Latin script(\u2018crh\u2019), Czech (\u2018cs\u2019), Danish\n (\u2018da\u2019), Dutch (\u2018nl\u2019), English (\u0027en\u0027), Estonian (\u2018et\u2019), Fijian (\u2018fj\u2019), Filipino (\u2018fil\u2019), Finnish\n (\u2018fi\u2019), French (\u2018fr\u2019), Friulian (\u2018fur\u2019), Galician (\u2018gl\u2019), German (\u2018de\u2019), Gilbertese (\u2018gil\u2019),\n Greenlandic (\u2018kl\u2019), Haitian Creole (\u2018ht\u2019), Hani (\u2018hni\u2019), Hmong Daw (\u2018mww\u2019), Hungarian (\u2018hu\u2019),\n Indonesian (\u2018id\u2019), Interlingua (\u2018ia\u2019), Inuktitut (\u2018iu\u2019), Irish (\u2018ga\u2019), Italian (\u2018it\u2019), Japanese\n (\u2018ja\u2019), Javanese (\u2018jv\u2019), Kabuverdianu (\u2018kea\u2019), Kachin (\u2018kac\u2019), Kara-Kalpak (\u2018kaa\u2019), Kashubian\n (\u2018csb\u2019), Khasi (\u2018kha\u2019), Korean (\u2018ko\u2019), Kurdish - Latin script (\u2018ku\u2019), K\u2019iche\u2019 (\u2018quc\u2019),\n Luxembourgish (\u2018lb\u2019), Malay (\u2018ms\u2019), Manx (\u2018gv\u2019), Neapolitan (\u2018nap\u2019), Norwegian (\u2018no\u2019), Occitan\n (\u2018oc\u2019), Polish (\u2018pl\u2019), Portuguese (\u2018pt\u2019), Romansh (\u2018rm\u2019), Scots (\u2018sco\u2019), Scottish Gaelic\n (\u2018gd\u2019), simplified Chinese (\u2018zh-Hans\u2019), Slovenian (\u2018sl\u2019), Spanish (\u2018es\u2019), Swahili (\u2018sw\u2019),\n Swedish (\u2018sv\u2019), Tatar - Latin script (\u2018tt\u2019), Tetum (\u2018tet\u2019), traditional Chinese (\u2018zh-Hant\u2019),\n Turkish (\u2018tr\u2019), Upper Sorbian (\u2018hsb\u2019), Uzbek (\u2018uz\u2019), Volap\u00fck (\u2018vo\u2019), Walser (\u2018wae\u2019), Western\n Frisian (\u2018fy\u2019), Yucatec Maya (\u2018yua\u2019), Zhuang (\u2018za\u2019) and Zulu (\u2018zu\u2019) are supported (print \u2013\n seventy-three languages and handwritten \u2013 English only). Layout supports auto language\n identification and multi language documents, so only provide a language code if you would like\n to force the documented to be processed as that specific language.\n:type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language\n:param reading_order: Reading order algorithm to sort the text lines returned. Supported\n reading orders include: basic(default), natural.\n:type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_analyze_layout_async(\n self,\n pages: Optional[List[str]] = None,\n language: Optional[Union[str, \"_models.Language\"]] = None,\n reading_order: Optional[Union[str, \"_models.ReadingOrder\"]] = \"basic\",\n file_stream: Optional[Union[IO, \"_models.SourcePath\"]] = None,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Analyze Layout.\n\nExtract text and layout information from a given document. The input document must be of one of\nthe supported content types - \u0027application/pdf\u0027, \u0027image/jpeg\u0027, \u0027image/png\u0027, \u0027image/tiff\u0027 or\n\u0027image/bmp\u0027. Alternatively, use \u0027application/json\u0027 type to specify the location (Uri or local\npath) of the document to be analyzed.\n\n:param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the\n pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or\n range with a comma.\n:type pages: list[str]\n:param language: Currently, only Afrikaans (\u2018af\u2019), Albanian (\u2018sq\u2019), Asturian (\u2018ast\u2019), Basque\n (\u2018eu\u2019), Bislama (\u2018bi\u2019), Breton (\u2018br\u2019), Catalan (\u2018ca\u2019), Cebuano (\u2018ceb\u2019), Chamorro (\u2018ch\u2019),\n Cornish (\u2018kw\u2019), Corsican (\u2018co\u2019), Crimean Tatar - Latin script(\u2018crh\u2019), Czech (\u2018cs\u2019), Danish\n (\u2018da\u2019), Dutch (\u2018nl\u2019), English (\u0027en\u0027), Estonian (\u2018et\u2019), Fijian (\u2018fj\u2019), Filipino (\u2018fil\u2019), Finnish\n (\u2018fi\u2019), French (\u2018fr\u2019), Friulian (\u2018fur\u2019), Galician (\u2018gl\u2019), German (\u2018de\u2019), Gilbertese (\u2018gil\u2019),\n Greenlandic (\u2018kl\u2019), Haitian Creole (\u2018ht\u2019), Hani (\u2018hni\u2019), Hmong Daw (\u2018mww\u2019), Hungarian (\u2018hu\u2019),\n Indonesian (\u2018id\u2019), Interlingua (\u2018ia\u2019), Inuktitut (\u2018iu\u2019), Irish (\u2018ga\u2019), Italian (\u2018it\u2019), Japanese\n (\u2018ja\u2019), Javanese (\u2018jv\u2019), Kabuverdianu (\u2018kea\u2019), Kachin (\u2018kac\u2019), Kara-Kalpak (\u2018kaa\u2019), Kashubian\n (\u2018csb\u2019), Khasi (\u2018kha\u2019), Korean (\u2018ko\u2019), Kurdish - Latin script (\u2018ku\u2019), K\u2019iche\u2019 (\u2018quc\u2019),\n Luxembourgish (\u2018lb\u2019), Malay (\u2018ms\u2019), Manx (\u2018gv\u2019), Neapolitan (\u2018nap\u2019), Norwegian (\u2018no\u2019), Occitan\n (\u2018oc\u2019), Polish (\u2018pl\u2019), Portuguese (\u2018pt\u2019), Romansh (\u2018rm\u2019), Scots (\u2018sco\u2019), Scottish Gaelic\n (\u2018gd\u2019), simplified Chinese (\u2018zh-Hans\u2019), Slovenian (\u2018sl\u2019), Spanish (\u2018es\u2019), Swahili (\u2018sw\u2019),\n Swedish (\u2018sv\u2019), Tatar - Latin script (\u2018tt\u2019), Tetum (\u2018tet\u2019), traditional Chinese (\u2018zh-Hant\u2019),\n Turkish (\u2018tr\u2019), Upper Sorbian (\u2018hsb\u2019), Uzbek (\u2018uz\u2019), Volap\u00fck (\u2018vo\u2019), Walser (\u2018wae\u2019), Western\n Frisian (\u2018fy\u2019), Yucatec Maya (\u2018yua\u2019), Zhuang (\u2018za\u2019) and Zulu (\u2018zu\u2019) are supported (print \u2013\n seventy-three languages and handwritten \u2013 English only). Layout supports auto language\n identification and multi language documents, so only provide a language code if you would like\n to force the documented to be processed as that specific language.\n:type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language\n:param reading_order: Reading order algorithm to sort the text lines returned. Supported\n reading orders include: basic(default), natural.\n:type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder\n:param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream.\n:type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath\n:keyword str content_type: Media type of the body sent to the API. Default value is \"application/json\".\n Allowed values are: \"application/pdf\", \"image/bmp\", \"image/jpeg\", \"image/png\", \"image/tiff\", \"application/json\".\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "pages, language, reading_order, file_stream" + }, + "get_analyze_layout_result" : { + "sync": { + "signature": "def get_analyze_layout_result(\n self,\n result_id, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get Analyze Layout Result.\n\nTrack the progress and obtain the result of the analyze layout operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_analyze_layout_result(\n self,\n result_id: str,\n **kwargs\n) -\u003e \"_models.AnalyzeOperationResult\":\n", + "doc": "\"\"\"Get Analyze Layout Result.\n\nTrack the progress and obtain the result of the analyze layout operation.\n\n:param result_id: Analyze operation result identifier.\n:type result_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeOperationResult, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "result_id" + }, + "list_custom_models" : { + "sync": { + "signature": "def list_custom_models(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"List Custom Models.\n\nGet information about all custom models.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Models or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.ai.formrecognizer.v2_1_preview_3.models.Models]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_custom_models(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.Models\"]:\n", + "doc": "\"\"\"List Custom Models.\n\nGet information about all custom models.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Models or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.formrecognizer.v2_1_preview_3.models.Models]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "get_custom_models" : { + "sync": { + "signature": "def get_custom_models(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get Custom Models.\n\nGet information about all custom models.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Models, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Models\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_custom_models(\n self,\n **kwargs\n) -\u003e \"_models.Models\":\n", + "doc": "\"\"\"Get Custom Models.\n\nGet information about all custom models.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Models, or the result of cls(response)\n:rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Models\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + } + } + } +} \ No newline at end of file diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/__init__.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/__init__.py new file mode 100644 index 000000000000..69eccfa9e16e --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._form_recognizer_client import FormRecognizerClient +__all__ = ['FormRecognizerClient'] diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/_configuration.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/_configuration.py new file mode 100644 index 000000000000..7a4589348bec --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/_configuration.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class FormRecognizerClientConfiguration(Configuration): + """Configuration for FormRecognizerClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). + :type endpoint: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + endpoint: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + super(FormRecognizerClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.endpoint = endpoint + self.credential_scopes = kwargs.pop('credential_scopes', ['https://cognitiveservices.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'ai-formrecognizer/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/_form_recognizer_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/_form_recognizer_client.py new file mode 100644 index 000000000000..b7244d5e518b --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/_form_recognizer_client.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core import AsyncPipelineClient +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import FormRecognizerClientConfiguration +from .operations import FormRecognizerClientOperationsMixin +from .. import models + + +class FormRecognizerClient(FormRecognizerClientOperationsMixin): + """Extracts information from forms and images into structured data. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). + :type endpoint: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + endpoint: str, + **kwargs: Any + ) -> None: + base_url = '{endpoint}/formrecognizer/v2.1-preview.3' + self._config = FormRecognizerClientConfiguration(credential, endpoint, **kwargs) + self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "FormRecognizerClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/operations/__init__.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/operations/__init__.py new file mode 100644 index 000000000000..f2f858714054 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._form_recognizer_client_operations import FormRecognizerClientOperationsMixin + +__all__ = [ + 'FormRecognizerClientOperationsMixin', +] diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/operations/_form_recognizer_client_operations.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/operations/_form_recognizer_client_operations.py new file mode 100644 index 000000000000..d4cf0e46a432 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/aio/operations/_form_recognizer_client_operations.py @@ -0,0 +1,1946 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, IO, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling.async_base_polling import AsyncLROBasePolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class FormRecognizerClientOperationsMixin: + + async def _train_custom_model_async_initial( + self, + train_request: "_models.TrainRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._train_custom_model_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(train_request, 'TrainRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _train_custom_model_async_initial.metadata = {'url': '/custom/models'} # type: ignore + + async def begin_train_custom_model_async( + self, + train_request: "_models.TrainRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Train Custom Model. + + Create and train a custom model. The request must include a source parameter that is either an + externally accessible Azure storage blob container Uri (preferably a Shared Access Signature + Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, + they must follow the Linux/Unix path format and be an absolute path rooted to the input mount + configuration setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' + then a valid source path would be '/input/contosodataset'. All data to be trained is expected + to be under the source folder or sub folders under it. Models are trained using documents that + are of the following content type - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' + or 'image/bmp'. Other type of content is ignored. + + :param train_request: Training request parameters. + :type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._train_custom_model_async_initial( + train_request=train_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_train_custom_model_async.metadata = {'url': '/custom/models'} # type: ignore + + async def get_custom_model( + self, + model_id: str, + include_keys: Optional[bool] = False, + **kwargs + ) -> "_models.Model": + """Get Custom Model. + + Get detailed information about a custom model. + + :param model_id: Model identifier. + :type model_id: str + :param include_keys: Include list of extracted keys in model information. + :type include_keys: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Model, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Model + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_custom_model.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_keys is not None: + query_parameters['includeKeys'] = self._serialize.query("include_keys", include_keys, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Model', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_custom_model.metadata = {'url': '/custom/models/{modelId}'} # type: ignore + + async def delete_custom_model( + self, + model_id: str, + **kwargs + ) -> None: + """Delete Custom Model. + + Mark model for deletion. Model artifacts will be permanently removed within a predetermined + period. + + :param model_id: Model identifier. + :type model_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.delete_custom_model.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete_custom_model.metadata = {'url': '/custom/models/{modelId}'} # type: ignore + + async def _analyze_with_custom_model_initial( + self, + model_id: str, + include_text_details: Optional[bool] = False, + pages: Optional[List[str]] = None, + file_stream: Optional[Union[IO, "_models.SourcePath"]] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._analyze_with_custom_model_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_text_details is not None: + query_parameters['includeTextDetails'] = self._serialize.query("include_text_details", include_text_details, 'bool') + if pages is not None: + query_parameters['pages'] = self._serialize.query("pages", pages, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff']: + body_content_kwargs['stream_content'] = file_stream + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: + if file_stream is not None: + body_content = self._serialize.body(file_stream, 'SourcePath') + else: + body_content = None + body_content_kwargs['content'] = body_content + else: + raise ValueError( + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) + ) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _analyze_with_custom_model_initial.metadata = {'url': '/custom/models/{modelId}/analyze'} # type: ignore + + async def begin_analyze_with_custom_model( + self, + model_id: str, + include_text_details: Optional[bool] = False, + pages: Optional[List[str]] = None, + file_stream: Optional[Union[IO, "_models.SourcePath"]] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Analyze Form. + + Extract key-value pairs, tables, and semantic values from a given document. The input document + must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', + 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location + (Uri or local path) of the document to be analyzed. + + :param model_id: Model identifier. + :type model_id: str + :param include_text_details: Include text lines and element references in the result. + :type include_text_details: bool + :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the + pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or + range with a comma. + :type pages: list[str] + :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". + Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._analyze_with_custom_model_initial( + model_id=model_id, + include_text_details=include_text_details, + pages=pages, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_with_custom_model.metadata = {'url': '/custom/models/{modelId}/analyze'} # type: ignore + + async def get_analyze_form_result( + self, + model_id: str, + result_id: str, + **kwargs + ) -> "_models.AnalyzeOperationResult": + """Get Analyze Form Result. + + Obtain current status and the result of the analyze form operation. + + :param model_id: Model identifier. + :type model_id: str + :param result_id: Analyze operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalyzeOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_analyze_form_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_analyze_form_result.metadata = {'url': '/custom/models/{modelId}/analyzeResults/{resultId}'} # type: ignore + + async def _copy_custom_model_initial( + self, + model_id: str, + copy_request: "_models.CopyRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._copy_custom_model_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(copy_request, 'CopyRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _copy_custom_model_initial.metadata = {'url': '/custom/models/{modelId}/copy'} # type: ignore + + async def begin_copy_custom_model( + self, + model_id: str, + copy_request: "_models.CopyRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Copy Custom Model. + + Copy custom model stored in this resource (the source) to user specified target Form Recognizer + resource. + + :param model_id: Model identifier. + :type model_id: str + :param copy_request: Copy request parameters. + :type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._copy_custom_model_initial( + model_id=model_id, + copy_request=copy_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_copy_custom_model.metadata = {'url': '/custom/models/{modelId}/copy'} # type: ignore + + async def get_custom_model_copy_result( + self, + model_id: str, + result_id: str, + **kwargs + ) -> "_models.CopyOperationResult": + """Get Custom Model Copy Result. + + Obtain current status and the result of a custom model copy operation. + + :param model_id: Model identifier. + :type model_id: str + :param result_id: Copy operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CopyOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CopyOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_custom_model_copy_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('CopyOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_custom_model_copy_result.metadata = {'url': '/custom/models/{modelId}/copyResults/{resultId}'} # type: ignore + + async def generate_model_copy_authorization( + self, + **kwargs + ) -> "_models.CopyAuthorizationResult": + """Generate Copy Authorization. + + Generate authorization to copy a model into the target Form Recognizer resource. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CopyAuthorizationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CopyAuthorizationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.generate_model_copy_authorization.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('CopyAuthorizationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + generate_model_copy_authorization.metadata = {'url': '/custom/models/copyAuthorization'} # type: ignore + + async def _compose_custom_models_async_initial( + self, + compose_request: "_models.ComposeRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._compose_custom_models_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(compose_request, 'ComposeRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _compose_custom_models_async_initial.metadata = {'url': '/custom/models/compose'} # type: ignore + + async def begin_compose_custom_models_async( + self, + compose_request: "_models.ComposeRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Compose trained with labels models into one composed model. + + Compose request would include list of models ids. + It would validate what all models either trained with labels model or composed model. + It would validate limit of models put together. + + :param compose_request: Compose models. + :type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._compose_custom_models_async_initial( + compose_request=compose_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_compose_custom_models_async.metadata = {'url': '/custom/models/compose'} # type: ignore + + async def _analyze_business_card_async_initial( + self, + include_text_details: Optional[bool] = False, + locale: Optional[Union[str, "_models.Locale"]] = None, + pages: Optional[List[str]] = None, + file_stream: Optional[Union[IO, "_models.SourcePath"]] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._analyze_business_card_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_text_details is not None: + query_parameters['includeTextDetails'] = self._serialize.query("include_text_details", include_text_details, 'bool') + if locale is not None: + query_parameters['locale'] = self._serialize.query("locale", locale, 'str') + if pages is not None: + query_parameters['pages'] = self._serialize.query("pages", pages, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff']: + body_content_kwargs['stream_content'] = file_stream + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: + if file_stream is not None: + body_content = self._serialize.body(file_stream, 'SourcePath') + else: + body_content = None + body_content_kwargs['content'] = body_content + else: + raise ValueError( + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) + ) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _analyze_business_card_async_initial.metadata = {'url': '/prebuilt/businessCard/analyze'} # type: ignore + + async def begin_analyze_business_card_async( + self, + include_text_details: Optional[bool] = False, + locale: Optional[Union[str, "_models.Locale"]] = None, + pages: Optional[List[str]] = None, + file_stream: Optional[Union[IO, "_models.SourcePath"]] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Analyze Business Card. + + Extract field text and semantic values from a given business card document. The input document + must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', + 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location + (Uri) of the document to be analyzed. + + :param include_text_details: Include text lines and element references in the result. + :type include_text_details: bool + :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, + en-IN, en-US(default). + :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the + pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or + range with a comma. + :type pages: list[str] + :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". + Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._analyze_business_card_async_initial( + include_text_details=include_text_details, + locale=locale, + pages=pages, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_business_card_async.metadata = {'url': '/prebuilt/businessCard/analyze'} # type: ignore + + async def get_analyze_business_card_result( + self, + result_id: str, + **kwargs + ) -> "_models.AnalyzeOperationResult": + """Get Analyze Business Card Result. + + Track the progress and obtain the result of the analyze business card operation. + + :param result_id: Analyze operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalyzeOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_analyze_business_card_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_analyze_business_card_result.metadata = {'url': '/prebuilt/businessCard/analyzeResults/{resultId}'} # type: ignore + + async def _analyze_invoice_async_initial( + self, + include_text_details: Optional[bool] = False, + locale: Optional[Union[str, "_models.Locale"]] = None, + pages: Optional[List[str]] = None, + file_stream: Optional[Union[IO, "_models.SourcePath"]] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._analyze_invoice_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_text_details is not None: + query_parameters['includeTextDetails'] = self._serialize.query("include_text_details", include_text_details, 'bool') + if locale is not None: + query_parameters['locale'] = self._serialize.query("locale", locale, 'str') + if pages is not None: + query_parameters['pages'] = self._serialize.query("pages", pages, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff']: + body_content_kwargs['stream_content'] = file_stream + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: + if file_stream is not None: + body_content = self._serialize.body(file_stream, 'SourcePath') + else: + body_content = None + body_content_kwargs['content'] = body_content + else: + raise ValueError( + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) + ) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _analyze_invoice_async_initial.metadata = {'url': '/prebuilt/invoice/analyze'} # type: ignore + + async def begin_analyze_invoice_async( + self, + include_text_details: Optional[bool] = False, + locale: Optional[Union[str, "_models.Locale"]] = None, + pages: Optional[List[str]] = None, + file_stream: Optional[Union[IO, "_models.SourcePath"]] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Analyze Invoice Document. + + Extract field text and semantic values from a given invoice document. The input document must + be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', + 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location + (Uri) of the document to be analyzed. + + :param include_text_details: Include text lines and element references in the result. + :type include_text_details: bool + :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, + en-IN, en-US(default). + :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the + pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or + range with a comma. + :type pages: list[str] + :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". + Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._analyze_invoice_async_initial( + include_text_details=include_text_details, + locale=locale, + pages=pages, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_invoice_async.metadata = {'url': '/prebuilt/invoice/analyze'} # type: ignore + + async def get_analyze_invoice_result( + self, + result_id: str, + **kwargs + ) -> "_models.AnalyzeOperationResult": + """Get Analyze Invoice Result. + + Track the progress and obtain the result of the analyze invoice operation. + + :param result_id: Analyze operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalyzeOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_analyze_invoice_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_analyze_invoice_result.metadata = {'url': '/prebuilt/invoice/analyzeResults/{resultId}'} # type: ignore + + async def _analyze_id_document_async_initial( + self, + include_text_details: Optional[bool] = False, + pages: Optional[List[str]] = None, + file_stream: Optional[Union[IO, "_models.SourcePath"]] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._analyze_id_document_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_text_details is not None: + query_parameters['includeTextDetails'] = self._serialize.query("include_text_details", include_text_details, 'bool') + if pages is not None: + query_parameters['pages'] = self._serialize.query("pages", pages, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff']: + body_content_kwargs['stream_content'] = file_stream + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: + if file_stream is not None: + body_content = self._serialize.body(file_stream, 'SourcePath') + else: + body_content = None + body_content_kwargs['content'] = body_content + else: + raise ValueError( + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) + ) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _analyze_id_document_async_initial.metadata = {'url': '/prebuilt/idDocument/analyze'} # type: ignore + + async def begin_analyze_id_document_async( + self, + include_text_details: Optional[bool] = False, + pages: Optional[List[str]] = None, + file_stream: Optional[Union[IO, "_models.SourcePath"]] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Analyze ID Document. + + Extract field text and semantic values from a given ID document. The input document must be of + one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' + or 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri) of the + document to be analyzed. + + :param include_text_details: Include text lines and element references in the result. + :type include_text_details: bool + :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the + pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or + range with a comma. + :type pages: list[str] + :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". + Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._analyze_id_document_async_initial( + include_text_details=include_text_details, + pages=pages, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_id_document_async.metadata = {'url': '/prebuilt/idDocument/analyze'} # type: ignore + + async def get_analyze_id_document_result( + self, + result_id: str, + **kwargs + ) -> "_models.AnalyzeOperationResult": + """Get Analyze ID Document Result. + + Track the progress and obtain the result of the analyze ID operation. + + :param result_id: Analyze operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalyzeOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_analyze_id_document_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_analyze_id_document_result.metadata = {'url': '/prebuilt/idDocument/analyzeResults/{resultId}'} # type: ignore + + async def _analyze_receipt_async_initial( + self, + include_text_details: Optional[bool] = False, + locale: Optional[Union[str, "_models.Locale"]] = None, + pages: Optional[List[str]] = None, + file_stream: Optional[Union[IO, "_models.SourcePath"]] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._analyze_receipt_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_text_details is not None: + query_parameters['includeTextDetails'] = self._serialize.query("include_text_details", include_text_details, 'bool') + if locale is not None: + query_parameters['locale'] = self._serialize.query("locale", locale, 'str') + if pages is not None: + query_parameters['pages'] = self._serialize.query("pages", pages, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff']: + body_content_kwargs['stream_content'] = file_stream + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: + if file_stream is not None: + body_content = self._serialize.body(file_stream, 'SourcePath') + else: + body_content = None + body_content_kwargs['content'] = body_content + else: + raise ValueError( + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) + ) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _analyze_receipt_async_initial.metadata = {'url': '/prebuilt/receipt/analyze'} # type: ignore + + async def begin_analyze_receipt_async( + self, + include_text_details: Optional[bool] = False, + locale: Optional[Union[str, "_models.Locale"]] = None, + pages: Optional[List[str]] = None, + file_stream: Optional[Union[IO, "_models.SourcePath"]] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Analyze Receipt. + + Extract field text and semantic values from a given receipt document. The input document must + be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', + 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location + (Uri) of the document to be analyzed. + + :param include_text_details: Include text lines and element references in the result. + :type include_text_details: bool + :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, + en-IN, en-US(default). + :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the + pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or + range with a comma. + :type pages: list[str] + :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". + Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._analyze_receipt_async_initial( + include_text_details=include_text_details, + locale=locale, + pages=pages, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_receipt_async.metadata = {'url': '/prebuilt/receipt/analyze'} # type: ignore + + async def get_analyze_receipt_result( + self, + result_id: str, + **kwargs + ) -> "_models.AnalyzeOperationResult": + """Get Analyze Receipt Result. + + Track the progress and obtain the result of the analyze receipt operation. + + :param result_id: Analyze operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalyzeOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_analyze_receipt_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_analyze_receipt_result.metadata = {'url': '/prebuilt/receipt/analyzeResults/{resultId}'} # type: ignore + + async def _analyze_layout_async_initial( + self, + pages: Optional[List[str]] = None, + language: Optional[Union[str, "_models.Language"]] = None, + reading_order: Optional[Union[str, "_models.ReadingOrder"]] = "basic", + file_stream: Optional[Union[IO, "_models.SourcePath"]] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._analyze_layout_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if pages is not None: + query_parameters['pages'] = self._serialize.query("pages", pages, '[str]', div=',') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if reading_order is not None: + query_parameters['readingOrder'] = self._serialize.query("reading_order", reading_order, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff']: + body_content_kwargs['stream_content'] = file_stream + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: + if file_stream is not None: + body_content = self._serialize.body(file_stream, 'SourcePath') + else: + body_content = None + body_content_kwargs['content'] = body_content + else: + raise ValueError( + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) + ) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _analyze_layout_async_initial.metadata = {'url': '/layout/analyze'} # type: ignore + + async def begin_analyze_layout_async( + self, + pages: Optional[List[str]] = None, + language: Optional[Union[str, "_models.Language"]] = None, + reading_order: Optional[Union[str, "_models.ReadingOrder"]] = "basic", + file_stream: Optional[Union[IO, "_models.SourcePath"]] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Analyze Layout. + + Extract text and layout information from a given document. The input document must be of one of + the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or + 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri or local + path) of the document to be analyzed. + + :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the + pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or + range with a comma. + :type pages: list[str] + :param language: Currently, only Afrikaans (‘af’), Albanian (‘sq’), Asturian (‘ast’), Basque + (‘eu’), Bislama (‘bi’), Breton (‘br’), Catalan (‘ca’), Cebuano (‘ceb’), Chamorro (‘ch’), + Cornish (‘kw’), Corsican (‘co’), Crimean Tatar - Latin script(‘crh’), Czech (‘cs’), Danish + (‘da’), Dutch (‘nl’), English ('en'), Estonian (‘et’), Fijian (‘fj’), Filipino (‘fil’), Finnish + (‘fi’), French (‘fr’), Friulian (‘fur’), Galician (‘gl’), German (‘de’), Gilbertese (‘gil’), + Greenlandic (‘kl’), Haitian Creole (‘ht’), Hani (‘hni’), Hmong Daw (‘mww’), Hungarian (‘hu’), + Indonesian (‘id’), Interlingua (‘ia’), Inuktitut (‘iu’), Irish (‘ga’), Italian (‘it’), Japanese + (‘ja’), Javanese (‘jv’), Kabuverdianu (‘kea’), Kachin (‘kac’), Kara-Kalpak (‘kaa’), Kashubian + (‘csb’), Khasi (‘kha’), Korean (‘ko’), Kurdish - Latin script (‘ku’), K’iche’ (‘quc’), + Luxembourgish (‘lb’), Malay (‘ms’), Manx (‘gv’), Neapolitan (‘nap’), Norwegian (‘no’), Occitan + (‘oc’), Polish (‘pl’), Portuguese (‘pt’), Romansh (‘rm’), Scots (‘sco’), Scottish Gaelic + (‘gd’), simplified Chinese (‘zh-Hans’), Slovenian (‘sl’), Spanish (‘es’), Swahili (‘sw’), + Swedish (‘sv’), Tatar - Latin script (‘tt’), Tetum (‘tet’), traditional Chinese (‘zh-Hant’), + Turkish (‘tr’), Upper Sorbian (‘hsb’), Uzbek (‘uz’), Volapük (‘vo’), Walser (‘wae’), Western + Frisian (‘fy’), Yucatec Maya (‘yua’), Zhuang (‘za’) and Zulu (‘zu’) are supported (print – + seventy-three languages and handwritten – English only). Layout supports auto language + identification and multi language documents, so only provide a language code if you would like + to force the documented to be processed as that specific language. + :type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language + :param reading_order: Reading order algorithm to sort the text lines returned. Supported + reading orders include: basic(default), natural. + :type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder + :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". + Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._analyze_layout_async_initial( + pages=pages, + language=language, + reading_order=reading_order, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_layout_async.metadata = {'url': '/layout/analyze'} # type: ignore + + async def get_analyze_layout_result( + self, + result_id: str, + **kwargs + ) -> "_models.AnalyzeOperationResult": + """Get Analyze Layout Result. + + Track the progress and obtain the result of the analyze layout operation. + + :param result_id: Analyze operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalyzeOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_analyze_layout_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_analyze_layout_result.metadata = {'url': '/layout/analyzeResults/{resultId}'} # type: ignore + + def list_custom_models( + self, + **kwargs + ) -> AsyncIterable["_models.Models"]: + """List Custom Models. + + Get information about all custom models. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Models or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.formrecognizer.v2_1_preview_3.models.Models] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Models"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + op = "full" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_custom_models.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['op'] = self._serialize.query("op", op, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('Models', pipeline_response) + list_of_elem = deserialized.model_list + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_custom_models.metadata = {'url': '/custom/models'} # type: ignore + + async def get_custom_models( + self, + **kwargs + ) -> "_models.Models": + """Get Custom Models. + + Get information about all custom models. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Models, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Models + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Models"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + op = "summary" + accept = "application/json" + + # Construct URL + url = self.get_custom_models.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['op'] = self._serialize.query("op", op, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Models', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_custom_models.metadata = {'url': '/custom/models'} # type: ignore diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/__init__.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/__init__.py new file mode 100644 index 000000000000..36591d89593a --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/__init__.py @@ -0,0 +1,146 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AnalyzeOperationResult + from ._models_py3 import AnalyzeResult + from ._models_py3 import Appearance + from ._models_py3 import Attributes + from ._models_py3 import ComposeRequest + from ._models_py3 import CopyAuthorizationResult + from ._models_py3 import CopyOperationResult + from ._models_py3 import CopyRequest + from ._models_py3 import CopyResult + from ._models_py3 import DataTable + from ._models_py3 import DataTableCell + from ._models_py3 import DocumentResult + from ._models_py3 import ErrorInformation + from ._models_py3 import ErrorResponse + from ._models_py3 import FieldValue + from ._models_py3 import FormFieldsReport + from ._models_py3 import KeyValueElement + from ._models_py3 import KeyValuePair + from ._models_py3 import KeysResult + from ._models_py3 import Model + from ._models_py3 import ModelInfo + from ._models_py3 import Models + from ._models_py3 import ModelsSummary + from ._models_py3 import PageResult + from ._models_py3 import ReadResult + from ._models_py3 import SelectionMark + from ._models_py3 import SourcePath + from ._models_py3 import Style + from ._models_py3 import TextLine + from ._models_py3 import TextWord + from ._models_py3 import TrainRequest + from ._models_py3 import TrainResult + from ._models_py3 import TrainSourceFilter + from ._models_py3 import TrainingDocumentInfo +except (SyntaxError, ImportError): + from ._models import AnalyzeOperationResult # type: ignore + from ._models import AnalyzeResult # type: ignore + from ._models import Appearance # type: ignore + from ._models import Attributes # type: ignore + from ._models import ComposeRequest # type: ignore + from ._models import CopyAuthorizationResult # type: ignore + from ._models import CopyOperationResult # type: ignore + from ._models import CopyRequest # type: ignore + from ._models import CopyResult # type: ignore + from ._models import DataTable # type: ignore + from ._models import DataTableCell # type: ignore + from ._models import DocumentResult # type: ignore + from ._models import ErrorInformation # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import FieldValue # type: ignore + from ._models import FormFieldsReport # type: ignore + from ._models import KeyValueElement # type: ignore + from ._models import KeyValuePair # type: ignore + from ._models import KeysResult # type: ignore + from ._models import Model # type: ignore + from ._models import ModelInfo # type: ignore + from ._models import Models # type: ignore + from ._models import ModelsSummary # type: ignore + from ._models import PageResult # type: ignore + from ._models import ReadResult # type: ignore + from ._models import SelectionMark # type: ignore + from ._models import SourcePath # type: ignore + from ._models import Style # type: ignore + from ._models import TextLine # type: ignore + from ._models import TextWord # type: ignore + from ._models import TrainRequest # type: ignore + from ._models import TrainResult # type: ignore + from ._models import TrainSourceFilter # type: ignore + from ._models import TrainingDocumentInfo # type: ignore + +from ._form_recognizer_client_enums import ( + ContentType, + FieldValueGender, + FieldValueSelectionMark, + FieldValueType, + KeyValueType, + Language, + LengthUnit, + Locale, + ModelStatus, + OperationStatus, + ReadingOrder, + SelectionMarkState, + TextStyle, + TrainStatus, +) + +__all__ = [ + 'AnalyzeOperationResult', + 'AnalyzeResult', + 'Appearance', + 'Attributes', + 'ComposeRequest', + 'CopyAuthorizationResult', + 'CopyOperationResult', + 'CopyRequest', + 'CopyResult', + 'DataTable', + 'DataTableCell', + 'DocumentResult', + 'ErrorInformation', + 'ErrorResponse', + 'FieldValue', + 'FormFieldsReport', + 'KeyValueElement', + 'KeyValuePair', + 'KeysResult', + 'Model', + 'ModelInfo', + 'Models', + 'ModelsSummary', + 'PageResult', + 'ReadResult', + 'SelectionMark', + 'SourcePath', + 'Style', + 'TextLine', + 'TextWord', + 'TrainRequest', + 'TrainResult', + 'TrainSourceFilter', + 'TrainingDocumentInfo', + 'ContentType', + 'FieldValueGender', + 'FieldValueSelectionMark', + 'FieldValueType', + 'KeyValueType', + 'Language', + 'LengthUnit', + 'Locale', + 'ModelStatus', + 'OperationStatus', + 'ReadingOrder', + 'SelectionMarkState', + 'TextStyle', + 'TrainStatus', +] diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_form_recognizer_client_enums.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_form_recognizer_client_enums.py new file mode 100644 index 000000000000..9a7bfe1bfed5 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_form_recognizer_client_enums.py @@ -0,0 +1,216 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ContentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Content type for upload + """ + + #: Content Type 'application/pdf'. + APPLICATION_PDF = "application/pdf" + #: Content Type 'image/bmp'. + IMAGE_BMP = "image/bmp" + #: Content Type 'image/jpeg'. + IMAGE_JPEG = "image/jpeg" + #: Content Type 'image/png'. + IMAGE_PNG = "image/png" + #: Content Type 'image/tiff'. + IMAGE_TIFF = "image/tiff" + +class FieldValueGender(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gender value: M, F, or X. + """ + + M = "M" + F = "F" + X = "X" + +class FieldValueSelectionMark(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Selection mark value. + """ + + SELECTED = "selected" + UNSELECTED = "unselected" + +class FieldValueType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Semantic data type of the field value. + """ + + STRING = "string" + DATE = "date" + TIME = "time" + PHONE_NUMBER = "phoneNumber" + NUMBER = "number" + INTEGER = "integer" + ARRAY = "array" + OBJECT = "object" + SELECTION_MARK = "selectionMark" + GENDER = "gender" + COUNTRY = "country" + +class KeyValueType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Semantic data type of the key value element. + """ + + STRING = "string" + SELECTION_MARK = "selectionMark" + +class Language(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + AF = "af" + AST = "ast" + BI = "bi" + BR = "br" + CA = "ca" + CEB = "ceb" + CH = "ch" + CO = "co" + CRH = "crh" + CS = "cs" + CSB = "csb" + DA = "da" + DE = "de" + EN = "en" + ES = "es" + ET = "et" + EU = "eu" + FI = "fi" + FIL = "fil" + FJ = "fj" + FR = "fr" + FUR = "fur" + FY = "fy" + GA = "ga" + GD = "gd" + GIL = "gil" + GL = "gl" + GV = "gv" + HNI = "hni" + HSB = "hsb" + HT = "ht" + HU = "hu" + IA = "ia" + ID = "id" + IT = "it" + IU = "iu" + JA = "ja" + JV = "jv" + KAA = "kaa" + KAC = "kac" + KEA = "kea" + KHA = "kha" + KL = "kl" + KO = "ko" + KU = "ku" + KW = "kw" + LB = "lb" + MS = "ms" + MWW = "mww" + NAP = "nap" + NL = "nl" + NO = "no" + OC = "oc" + PL = "pl" + PT = "pt" + QUC = "quc" + RM = "rm" + SCO = "sco" + SL = "sl" + SQ = "sq" + SV = "sv" + SW = "sw" + TET = "tet" + TR = "tr" + TT = "tt" + UZ = "uz" + VO = "vo" + WAE = "wae" + YUA = "yua" + ZA = "za" + ZH_HANS = "zh-Hans" + ZH_HANT = "zh-Hant" + ZU = "zu" + +class LengthUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The unit used by the width, height and boundingBox properties. For images, the unit is "pixel". + For PDF, the unit is "inch". + """ + + PIXEL = "pixel" + INCH = "inch" + +class Locale(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + EN_AU = "en-AU" + EN_CA = "en-CA" + EN_GB = "en-GB" + EN_IN = "en-IN" + EN_US = "en-US" + +class ModelStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the model. + """ + + CREATING = "creating" + READY = "ready" + INVALID = "invalid" + +class OperationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the queued operation. + """ + + NOT_STARTED = "notStarted" + RUNNING = "running" + SUCCEEDED = "succeeded" + FAILED = "failed" + +class ReadingOrder(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + BASIC = "basic" + NATURAL = "natural" + +class SelectionMarkState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of the selection mark. + """ + + SELECTED = "selected" + UNSELECTED = "unselected" + +class TextStyle(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The text line style name, including handwriting and other. + """ + + OTHER = "other" + HANDWRITING = "handwriting" + +class TrainStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the training operation. + """ + + SUCCEEDED = "succeeded" + PARTIALLY_SUCCEEDED = "partiallySucceeded" + FAILED = "failed" diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models.py new file mode 100644 index 000000000000..7490488d77be --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models.py @@ -0,0 +1,1308 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AnalyzeOperationResult(msrest.serialization.Model): + """Status and result of the queued analyze operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Operation status. Possible values include: "notStarted", "running", + "succeeded", "failed". + :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.OperationStatus + :param created_date_time: Required. Date and time (UTC) when the analyze operation was + submitted. + :type created_date_time: ~datetime.datetime + :param last_updated_date_time: Required. Date and time (UTC) when the status was last updated. + :type last_updated_date_time: ~datetime.datetime + :param analyze_result: Results of the analyze operation. + :type analyze_result: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeResult + """ + + _validation = { + 'status': {'required': True}, + 'created_date_time': {'required': True}, + 'last_updated_date_time': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_updated_date_time': {'key': 'lastUpdatedDateTime', 'type': 'iso-8601'}, + 'analyze_result': {'key': 'analyzeResult', 'type': 'AnalyzeResult'}, + } + + def __init__( + self, + **kwargs + ): + super(AnalyzeOperationResult, self).__init__(**kwargs) + self.status = kwargs['status'] + self.created_date_time = kwargs['created_date_time'] + self.last_updated_date_time = kwargs['last_updated_date_time'] + self.analyze_result = kwargs.get('analyze_result', None) + + +class AnalyzeResult(msrest.serialization.Model): + """Analyze operation result. + + All required parameters must be populated in order to send to Azure. + + :param version: Required. Version of schema used for this result. + :type version: str + :param read_results: Required. Text extracted from the input. + :type read_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ReadResult] + :param page_results: Page-level information extracted from the input. + :type page_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.PageResult] + :param document_results: Document-level information extracted from the input. + :type document_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.DocumentResult] + :param errors: List of errors reported during the analyze operation. + :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + """ + + _validation = { + 'version': {'required': True}, + 'read_results': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'read_results': {'key': 'readResults', 'type': '[ReadResult]'}, + 'page_results': {'key': 'pageResults', 'type': '[PageResult]'}, + 'document_results': {'key': 'documentResults', 'type': '[DocumentResult]'}, + 'errors': {'key': 'errors', 'type': '[ErrorInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(AnalyzeResult, self).__init__(**kwargs) + self.version = kwargs['version'] + self.read_results = kwargs['read_results'] + self.page_results = kwargs.get('page_results', None) + self.document_results = kwargs.get('document_results', None) + self.errors = kwargs.get('errors', None) + + +class Appearance(msrest.serialization.Model): + """An object representing the appearance of the text line. + + All required parameters must be populated in order to send to Azure. + + :param style: Required. An object representing the style of the text line. + :type style: ~azure.ai.formrecognizer.v2_1_preview_3.models.Style + """ + + _validation = { + 'style': {'required': True}, + } + + _attribute_map = { + 'style': {'key': 'style', 'type': 'Style'}, + } + + def __init__( + self, + **kwargs + ): + super(Appearance, self).__init__(**kwargs) + self.style = kwargs['style'] + + +class Attributes(msrest.serialization.Model): + """Optional model attributes. + + :param is_composed: Is this model composed? (default: false). + :type is_composed: bool + """ + + _attribute_map = { + 'is_composed': {'key': 'isComposed', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Attributes, self).__init__(**kwargs) + self.is_composed = kwargs.get('is_composed', False) + + +class ComposeRequest(msrest.serialization.Model): + """Request contract for compose operation. + + All required parameters must be populated in order to send to Azure. + + :param model_ids: Required. List of model ids to compose. + :type model_ids: list[str] + :param model_name: Optional user defined model name (max length: 1024). + :type model_name: str + """ + + _validation = { + 'model_ids': {'required': True}, + } + + _attribute_map = { + 'model_ids': {'key': 'modelIds', 'type': '[str]'}, + 'model_name': {'key': 'modelName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComposeRequest, self).__init__(**kwargs) + self.model_ids = kwargs['model_ids'] + self.model_name = kwargs.get('model_name', None) + + +class CopyAuthorizationResult(msrest.serialization.Model): + """Request parameter that contains authorization claims for copy operation. + + All required parameters must be populated in order to send to Azure. + + :param model_id: Required. Model identifier. + :type model_id: str + :param access_token: Required. Token claim used to authorize the request. + :type access_token: str + :param expiration_date_time_ticks: Required. The time when the access token expires. The date + is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time. + :type expiration_date_time_ticks: long + """ + + _validation = { + 'model_id': {'required': True}, + 'access_token': {'required': True}, + 'expiration_date_time_ticks': {'required': True}, + } + + _attribute_map = { + 'model_id': {'key': 'modelId', 'type': 'str'}, + 'access_token': {'key': 'accessToken', 'type': 'str'}, + 'expiration_date_time_ticks': {'key': 'expirationDateTimeTicks', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(CopyAuthorizationResult, self).__init__(**kwargs) + self.model_id = kwargs['model_id'] + self.access_token = kwargs['access_token'] + self.expiration_date_time_ticks = kwargs['expiration_date_time_ticks'] + + +class CopyOperationResult(msrest.serialization.Model): + """Status and result of the queued copy operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Operation status. Possible values include: "notStarted", "running", + "succeeded", "failed". + :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.OperationStatus + :param created_date_time: Required. Date and time (UTC) when the copy operation was submitted. + :type created_date_time: ~datetime.datetime + :param last_updated_date_time: Required. Date and time (UTC) when the status was last updated. + :type last_updated_date_time: ~datetime.datetime + :param copy_result: Results of the copy operation. + :type copy_result: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyResult + """ + + _validation = { + 'status': {'required': True}, + 'created_date_time': {'required': True}, + 'last_updated_date_time': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_updated_date_time': {'key': 'lastUpdatedDateTime', 'type': 'iso-8601'}, + 'copy_result': {'key': 'copyResult', 'type': 'CopyResult'}, + } + + def __init__( + self, + **kwargs + ): + super(CopyOperationResult, self).__init__(**kwargs) + self.status = kwargs['status'] + self.created_date_time = kwargs['created_date_time'] + self.last_updated_date_time = kwargs['last_updated_date_time'] + self.copy_result = kwargs.get('copy_result', None) + + +class CopyRequest(msrest.serialization.Model): + """Request parameter to copy an existing custom model from the source resource to a target resource referenced by the resource ID. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. Azure Resource Id of the target Form Recognizer resource + where the model is copied to. + :type target_resource_id: str + :param target_resource_region: Required. Location of the target Azure resource. A valid Azure + region name supported by Cognitive Services. + :type target_resource_region: str + :param copy_authorization: Required. Entity that encodes claims to authorize the copy request. + :type copy_authorization: + ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult + """ + + _validation = { + 'target_resource_id': {'required': True, 'max_length': 1024, 'min_length': 0, 'pattern': r'^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.CognitiveServices/accounts/[^/]*$'}, + 'target_resource_region': {'required': True, 'max_length': 24, 'min_length': 1, 'pattern': r'^[a-z0-9]+$'}, + 'copy_authorization': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'target_resource_region': {'key': 'targetResourceRegion', 'type': 'str'}, + 'copy_authorization': {'key': 'copyAuthorization', 'type': 'CopyAuthorizationResult'}, + } + + def __init__( + self, + **kwargs + ): + super(CopyRequest, self).__init__(**kwargs) + self.target_resource_id = kwargs['target_resource_id'] + self.target_resource_region = kwargs['target_resource_region'] + self.copy_authorization = kwargs['copy_authorization'] + + +class CopyResult(msrest.serialization.Model): + """Custom model copy result. + + All required parameters must be populated in order to send to Azure. + + :param model_id: Required. Identifier of the target model. + :type model_id: str + :param errors: Errors returned during the copy operation. + :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + """ + + _validation = { + 'model_id': {'required': True}, + } + + _attribute_map = { + 'model_id': {'key': 'modelId', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[ErrorInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(CopyResult, self).__init__(**kwargs) + self.model_id = kwargs['model_id'] + self.errors = kwargs.get('errors', None) + + +class DataTable(msrest.serialization.Model): + """Information about the extracted table contained in a page. + + All required parameters must be populated in order to send to Azure. + + :param rows: Required. Number of rows. + :type rows: int + :param columns: Required. Number of columns. + :type columns: int + :param cells: Required. List of cells contained in the table. + :type cells: list[~azure.ai.formrecognizer.v2_1_preview_3.models.DataTableCell] + :param bounding_box: Required. Bounding box of the table. + :type bounding_box: list[float] + """ + + _validation = { + 'rows': {'required': True, 'minimum': 1}, + 'columns': {'required': True, 'minimum': 1}, + 'cells': {'required': True}, + 'bounding_box': {'required': True, 'max_items': 8, 'min_items': 8}, + } + + _attribute_map = { + 'rows': {'key': 'rows', 'type': 'int'}, + 'columns': {'key': 'columns', 'type': 'int'}, + 'cells': {'key': 'cells', 'type': '[DataTableCell]'}, + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataTable, self).__init__(**kwargs) + self.rows = kwargs['rows'] + self.columns = kwargs['columns'] + self.cells = kwargs['cells'] + self.bounding_box = kwargs['bounding_box'] + + +class DataTableCell(msrest.serialization.Model): + """Information about the extracted cell in a table. + + All required parameters must be populated in order to send to Azure. + + :param row_index: Required. Row index of the cell. + :type row_index: int + :param column_index: Required. Column index of the cell. + :type column_index: int + :param row_span: Number of rows spanned by this cell. + :type row_span: int + :param column_span: Number of columns spanned by this cell. + :type column_span: int + :param text: Required. Text content of the cell. + :type text: str + :param bounding_box: Required. Bounding box of the cell. + :type bounding_box: list[float] + :param confidence: Required. Confidence value. + :type confidence: float + :param elements: When includeTextDetails is set to true, a list of references to the text + elements constituting this table cell. + :type elements: list[str] + :param is_header: Is the current cell a header cell?. + :type is_header: bool + :param is_footer: Is the current cell a footer cell?. + :type is_footer: bool + """ + + _validation = { + 'row_index': {'required': True, 'minimum': 0}, + 'column_index': {'required': True, 'minimum': 0}, + 'row_span': {'minimum': 1}, + 'column_span': {'minimum': 1}, + 'text': {'required': True}, + 'bounding_box': {'required': True, 'max_items': 8, 'min_items': 8}, + 'confidence': {'required': True, 'maximum': 1, 'minimum': 0}, + } + + _attribute_map = { + 'row_index': {'key': 'rowIndex', 'type': 'int'}, + 'column_index': {'key': 'columnIndex', 'type': 'int'}, + 'row_span': {'key': 'rowSpan', 'type': 'int'}, + 'column_span': {'key': 'columnSpan', 'type': 'int'}, + 'text': {'key': 'text', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + 'elements': {'key': 'elements', 'type': '[str]'}, + 'is_header': {'key': 'isHeader', 'type': 'bool'}, + 'is_footer': {'key': 'isFooter', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DataTableCell, self).__init__(**kwargs) + self.row_index = kwargs['row_index'] + self.column_index = kwargs['column_index'] + self.row_span = kwargs.get('row_span', 1) + self.column_span = kwargs.get('column_span', 1) + self.text = kwargs['text'] + self.bounding_box = kwargs['bounding_box'] + self.confidence = kwargs['confidence'] + self.elements = kwargs.get('elements', None) + self.is_header = kwargs.get('is_header', False) + self.is_footer = kwargs.get('is_footer', False) + + +class DocumentResult(msrest.serialization.Model): + """A set of extracted fields corresponding to the input document. + + All required parameters must be populated in order to send to Azure. + + :param doc_type: Required. Document type. + :type doc_type: str + :param model_id: Model identifier. + :type model_id: str + :param page_range: Required. First and last page number where the document is found. + :type page_range: list[int] + :param doc_type_confidence: Predicted document type confidence. + :type doc_type_confidence: float + :param fields: Required. Dictionary of named field values. + :type fields: dict[str, ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValue] + """ + + _validation = { + 'doc_type': {'required': True}, + 'page_range': {'required': True, 'max_items': 2, 'min_items': 2}, + 'doc_type_confidence': {'maximum': 1, 'minimum': 0}, + 'fields': {'required': True}, + } + + _attribute_map = { + 'doc_type': {'key': 'docType', 'type': 'str'}, + 'model_id': {'key': 'modelId', 'type': 'str'}, + 'page_range': {'key': 'pageRange', 'type': '[int]'}, + 'doc_type_confidence': {'key': 'docTypeConfidence', 'type': 'float'}, + 'fields': {'key': 'fields', 'type': '{FieldValue}'}, + } + + def __init__( + self, + **kwargs + ): + super(DocumentResult, self).__init__(**kwargs) + self.doc_type = kwargs['doc_type'] + self.model_id = kwargs.get('model_id', None) + self.page_range = kwargs['page_range'] + self.doc_type_confidence = kwargs.get('doc_type_confidence', None) + self.fields = kwargs['fields'] + + +class ErrorInformation(msrest.serialization.Model): + """ErrorInformation. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. + :type code: str + :param message: Required. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorInformation, self).__init__(**kwargs) + self.code = kwargs['code'] + self.message = kwargs['message'] + + +class ErrorResponse(msrest.serialization.Model): + """ErrorResponse. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. + :type error: ~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorInformation'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs['error'] + + +class FieldValue(msrest.serialization.Model): + """Recognized field value. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Type of field value. Possible values include: "string", "date", "time", + "phoneNumber", "number", "integer", "array", "object", "selectionMark", "gender", "country". + :type type: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValueType + :param value_string: String value. + :type value_string: str + :param value_date: Date value. + :type value_date: ~datetime.date + :param value_time: Time value. + :type value_time: ~datetime.time + :param value_phone_number: Phone number value. + :type value_phone_number: str + :param value_number: Floating point value. + :type value_number: float + :param value_integer: Integer value. + :type value_integer: int + :param value_array: Array of field values. + :type value_array: list[~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValue] + :param value_object: Dictionary of named field values. + :type value_object: dict[str, ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValue] + :param value_selection_mark: Selection mark value. Possible values include: "selected", + "unselected". + :type value_selection_mark: str or + ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValueSelectionMark + :param value_gender: Gender value: M, F, or X. Possible values include: "M", "F", "X". + :type value_gender: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValueGender + :param value_country: 3-letter country code (ISO 3166-1 alpha-3). + :type value_country: str + :param text: Text content of the extracted field. + :type text: str + :param bounding_box: Bounding box of the field value, if appropriate. + :type bounding_box: list[float] + :param confidence: Confidence score. + :type confidence: float + :param elements: When includeTextDetails is set to true, a list of references to the text + elements constituting this field. + :type elements: list[str] + :param page: The 1-based page number in the input document. + :type page: int + """ + + _validation = { + 'type': {'required': True}, + 'bounding_box': {'max_items': 8, 'min_items': 8}, + 'confidence': {'maximum': 1, 'minimum': 0}, + 'page': {'minimum': 1}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value_string': {'key': 'valueString', 'type': 'str'}, + 'value_date': {'key': 'valueDate', 'type': 'date'}, + 'value_time': {'key': 'valueTime', 'type': 'time'}, + 'value_phone_number': {'key': 'valuePhoneNumber', 'type': 'str'}, + 'value_number': {'key': 'valueNumber', 'type': 'float'}, + 'value_integer': {'key': 'valueInteger', 'type': 'int'}, + 'value_array': {'key': 'valueArray', 'type': '[FieldValue]'}, + 'value_object': {'key': 'valueObject', 'type': '{FieldValue}'}, + 'value_selection_mark': {'key': 'valueSelectionMark', 'type': 'str'}, + 'value_gender': {'key': 'valueGender', 'type': 'str'}, + 'value_country': {'key': 'valueCountry', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + 'elements': {'key': 'elements', 'type': '[str]'}, + 'page': {'key': 'page', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(FieldValue, self).__init__(**kwargs) + self.type = kwargs['type'] + self.value_string = kwargs.get('value_string', None) + self.value_date = kwargs.get('value_date', None) + self.value_time = kwargs.get('value_time', None) + self.value_phone_number = kwargs.get('value_phone_number', None) + self.value_number = kwargs.get('value_number', None) + self.value_integer = kwargs.get('value_integer', None) + self.value_array = kwargs.get('value_array', None) + self.value_object = kwargs.get('value_object', None) + self.value_selection_mark = kwargs.get('value_selection_mark', None) + self.value_gender = kwargs.get('value_gender', None) + self.value_country = kwargs.get('value_country', None) + self.text = kwargs.get('text', None) + self.bounding_box = kwargs.get('bounding_box', None) + self.confidence = kwargs.get('confidence', None) + self.elements = kwargs.get('elements', None) + self.page = kwargs.get('page', None) + + +class FormFieldsReport(msrest.serialization.Model): + """Report for a custom model training field. + + All required parameters must be populated in order to send to Azure. + + :param field_name: Required. Training field name. + :type field_name: str + :param accuracy: Required. Estimated extraction accuracy for this field. + :type accuracy: float + """ + + _validation = { + 'field_name': {'required': True}, + 'accuracy': {'required': True}, + } + + _attribute_map = { + 'field_name': {'key': 'fieldName', 'type': 'str'}, + 'accuracy': {'key': 'accuracy', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(FormFieldsReport, self).__init__(**kwargs) + self.field_name = kwargs['field_name'] + self.accuracy = kwargs['accuracy'] + + +class KeysResult(msrest.serialization.Model): + """Keys extracted by the custom model. + + All required parameters must be populated in order to send to Azure. + + :param clusters: Required. Object mapping clusterIds to a list of keys. + :type clusters: dict[str, list[str]] + """ + + _validation = { + 'clusters': {'required': True}, + } + + _attribute_map = { + 'clusters': {'key': 'clusters', 'type': '{[str]}'}, + } + + def __init__( + self, + **kwargs + ): + super(KeysResult, self).__init__(**kwargs) + self.clusters = kwargs['clusters'] + + +class KeyValueElement(msrest.serialization.Model): + """Information about the extracted key or value in a key-value pair. + + All required parameters must be populated in order to send to Azure. + + :param type: Semantic data type of the key value element. Possible values include: "string", + "selectionMark". + :type type: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValueType + :param text: Required. The text content of the key or value. + :type text: str + :param bounding_box: Bounding box of the key or value. + :type bounding_box: list[float] + :param elements: When includeTextDetails is set to true, a list of references to the text + elements constituting this key or value. + :type elements: list[str] + """ + + _validation = { + 'text': {'required': True}, + 'bounding_box': {'max_items': 8, 'min_items': 8}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + 'elements': {'key': 'elements', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyValueElement, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.text = kwargs['text'] + self.bounding_box = kwargs.get('bounding_box', None) + self.elements = kwargs.get('elements', None) + + +class KeyValuePair(msrest.serialization.Model): + """Information about the extracted key-value pair. + + All required parameters must be populated in order to send to Azure. + + :param label: A user defined label for the key/value pair entry. + :type label: str + :param key: Required. Information about the extracted key in a key-value pair. + :type key: ~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValueElement + :param value: Required. Information about the extracted value in a key-value pair. + :type value: ~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValueElement + :param confidence: Required. Confidence value. + :type confidence: float + """ + + _validation = { + 'key': {'required': True}, + 'value': {'required': True}, + 'confidence': {'required': True, 'maximum': 1, 'minimum': 0}, + } + + _attribute_map = { + 'label': {'key': 'label', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'KeyValueElement'}, + 'value': {'key': 'value', 'type': 'KeyValueElement'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyValuePair, self).__init__(**kwargs) + self.label = kwargs.get('label', None) + self.key = kwargs['key'] + self.value = kwargs['value'] + self.confidence = kwargs['confidence'] + + +class Model(msrest.serialization.Model): + """Response to the get custom model operation. + + All required parameters must be populated in order to send to Azure. + + :param model_info: Required. Basic custom model information. + :type model_info: ~azure.ai.formrecognizer.v2_1_preview_3.models.ModelInfo + :param keys: Keys extracted by the custom model. + :type keys: ~azure.ai.formrecognizer.v2_1_preview_3.models.KeysResult + :param train_result: Training result for custom model. + :type train_result: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainResult + :param composed_train_results: Training result for composed model. + :type composed_train_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.TrainResult] + """ + + _validation = { + 'model_info': {'required': True}, + } + + _attribute_map = { + 'model_info': {'key': 'modelInfo', 'type': 'ModelInfo'}, + 'keys': {'key': 'keys', 'type': 'KeysResult'}, + 'train_result': {'key': 'trainResult', 'type': 'TrainResult'}, + 'composed_train_results': {'key': 'composedTrainResults', 'type': '[TrainResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(Model, self).__init__(**kwargs) + self.model_info = kwargs['model_info'] + self.keys = kwargs.get('keys', None) + self.train_result = kwargs.get('train_result', None) + self.composed_train_results = kwargs.get('composed_train_results', None) + + +class ModelInfo(msrest.serialization.Model): + """Basic custom model information. + + All required parameters must be populated in order to send to Azure. + + :param model_id: Required. Model identifier. + :type model_id: str + :param status: Required. Status of the model. Possible values include: "creating", "ready", + "invalid". + :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ModelStatus + :param created_date_time: Required. Date and time (UTC) when the model was created. + :type created_date_time: ~datetime.datetime + :param last_updated_date_time: Required. Date and time (UTC) when the status was last updated. + :type last_updated_date_time: ~datetime.datetime + :param model_name: Optional user defined model name (max length: 1024). + :type model_name: str + :param attributes: Optional model attributes. + :type attributes: ~azure.ai.formrecognizer.v2_1_preview_3.models.Attributes + """ + + _validation = { + 'model_id': {'required': True}, + 'status': {'required': True}, + 'created_date_time': {'required': True}, + 'last_updated_date_time': {'required': True}, + } + + _attribute_map = { + 'model_id': {'key': 'modelId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_updated_date_time': {'key': 'lastUpdatedDateTime', 'type': 'iso-8601'}, + 'model_name': {'key': 'modelName', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'Attributes'}, + } + + def __init__( + self, + **kwargs + ): + super(ModelInfo, self).__init__(**kwargs) + self.model_id = kwargs['model_id'] + self.status = kwargs['status'] + self.created_date_time = kwargs['created_date_time'] + self.last_updated_date_time = kwargs['last_updated_date_time'] + self.model_name = kwargs.get('model_name', None) + self.attributes = kwargs.get('attributes', None) + + +class Models(msrest.serialization.Model): + """Response to the list custom models operation. + + :param summary: Summary of all trained custom models. + :type summary: ~azure.ai.formrecognizer.v2_1_preview_3.models.ModelsSummary + :param model_list: Collection of trained custom models. + :type model_list: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ModelInfo] + :param next_link: Link to the next page of custom models. + :type next_link: str + """ + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'ModelsSummary'}, + 'model_list': {'key': 'modelList', 'type': '[ModelInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Models, self).__init__(**kwargs) + self.summary = kwargs.get('summary', None) + self.model_list = kwargs.get('model_list', None) + self.next_link = kwargs.get('next_link', None) + + +class ModelsSummary(msrest.serialization.Model): + """Summary of all trained custom models. + + All required parameters must be populated in order to send to Azure. + + :param count: Required. Current count of trained custom models. + :type count: int + :param limit: Required. Max number of models that can be trained for this account. + :type limit: int + :param last_updated_date_time: Required. Date and time (UTC) when the summary was last updated. + :type last_updated_date_time: ~datetime.datetime + """ + + _validation = { + 'count': {'required': True}, + 'limit': {'required': True}, + 'last_updated_date_time': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'last_updated_date_time': {'key': 'lastUpdatedDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(ModelsSummary, self).__init__(**kwargs) + self.count = kwargs['count'] + self.limit = kwargs['limit'] + self.last_updated_date_time = kwargs['last_updated_date_time'] + + +class PageResult(msrest.serialization.Model): + """Extracted information from a single page. + + All required parameters must be populated in order to send to Azure. + + :param page: Required. Page number. + :type page: int + :param cluster_id: Cluster identifier. + :type cluster_id: int + :param key_value_pairs: List of key-value pairs extracted from the page. + :type key_value_pairs: list[~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValuePair] + :param tables: List of data tables extracted from the page. + :type tables: list[~azure.ai.formrecognizer.v2_1_preview_3.models.DataTable] + """ + + _validation = { + 'page': {'required': True, 'minimum': 1}, + 'cluster_id': {'minimum': 0}, + } + + _attribute_map = { + 'page': {'key': 'page', 'type': 'int'}, + 'cluster_id': {'key': 'clusterId', 'type': 'int'}, + 'key_value_pairs': {'key': 'keyValuePairs', 'type': '[KeyValuePair]'}, + 'tables': {'key': 'tables', 'type': '[DataTable]'}, + } + + def __init__( + self, + **kwargs + ): + super(PageResult, self).__init__(**kwargs) + self.page = kwargs['page'] + self.cluster_id = kwargs.get('cluster_id', None) + self.key_value_pairs = kwargs.get('key_value_pairs', None) + self.tables = kwargs.get('tables', None) + + +class ReadResult(msrest.serialization.Model): + """Text extracted from a page in the input document. + + All required parameters must be populated in order to send to Azure. + + :param page: Required. The 1-based page number in the input document. + :type page: int + :param angle: Required. The general orientation of the text in clockwise direction, measured in + degrees between (-180, 180]. + :type angle: float + :param width: Required. The width of the image/PDF in pixels/inches, respectively. + :type width: float + :param height: Required. The height of the image/PDF in pixels/inches, respectively. + :type height: float + :param unit: Required. The unit used by the width, height and boundingBox properties. For + images, the unit is "pixel". For PDF, the unit is "inch". Possible values include: "pixel", + "inch". + :type unit: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.LengthUnit + :param lines: When includeTextDetails is set to true, a list of recognized text lines. The + maximum number of lines returned is 300 per page. The lines are sorted top to bottom, left to + right, although in certain cases proximity is treated with higher priority. As the sorting + order depends on the detected text, it may change across images and OCR version updates. Thus, + business logic should be built upon the actual line location instead of order. + :type lines: list[~azure.ai.formrecognizer.v2_1_preview_3.models.TextLine] + :param selection_marks: List of selection marks extracted from the page. + :type selection_marks: list[~azure.ai.formrecognizer.v2_1_preview_3.models.SelectionMark] + """ + + _validation = { + 'page': {'required': True, 'minimum': 1}, + 'angle': {'required': True, 'maximum': 180, 'minimum_ex': -180}, + 'width': {'required': True, 'minimum': 0}, + 'height': {'required': True, 'minimum': 0}, + 'unit': {'required': True}, + } + + _attribute_map = { + 'page': {'key': 'page', 'type': 'int'}, + 'angle': {'key': 'angle', 'type': 'float'}, + 'width': {'key': 'width', 'type': 'float'}, + 'height': {'key': 'height', 'type': 'float'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'lines': {'key': 'lines', 'type': '[TextLine]'}, + 'selection_marks': {'key': 'selectionMarks', 'type': '[SelectionMark]'}, + } + + def __init__( + self, + **kwargs + ): + super(ReadResult, self).__init__(**kwargs) + self.page = kwargs['page'] + self.angle = kwargs['angle'] + self.width = kwargs['width'] + self.height = kwargs['height'] + self.unit = kwargs['unit'] + self.lines = kwargs.get('lines', None) + self.selection_marks = kwargs.get('selection_marks', None) + + +class SelectionMark(msrest.serialization.Model): + """Information about the extracted selection mark. + + All required parameters must be populated in order to send to Azure. + + :param bounding_box: Required. Bounding box of the selection mark. + :type bounding_box: list[float] + :param confidence: Required. Confidence value. + :type confidence: float + :param state: Required. State of the selection mark. Possible values include: "selected", + "unselected". + :type state: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.SelectionMarkState + """ + + _validation = { + 'bounding_box': {'required': True, 'max_items': 8, 'min_items': 8}, + 'confidence': {'required': True, 'maximum': 1, 'minimum': 0}, + 'state': {'required': True}, + } + + _attribute_map = { + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SelectionMark, self).__init__(**kwargs) + self.bounding_box = kwargs['bounding_box'] + self.confidence = kwargs['confidence'] + self.state = kwargs['state'] + + +class SourcePath(msrest.serialization.Model): + """Uri or local path to source data. + + :param source: File source path. + :type source: str + """ + + _validation = { + 'source': {'max_length': 2048, 'min_length': 0}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourcePath, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + + +class Style(msrest.serialization.Model): + """An object representing the style of the text line. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The text line style name, including handwriting and other. Possible + values include: "other", "handwriting". + :type name: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.TextStyle + :param confidence: Required. The confidence of text line style. + :type confidence: float + """ + + _validation = { + 'name': {'required': True}, + 'confidence': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(Style, self).__init__(**kwargs) + self.name = kwargs['name'] + self.confidence = kwargs['confidence'] + + +class TextLine(msrest.serialization.Model): + """An object representing an extracted text line. + + All required parameters must be populated in order to send to Azure. + + :param text: Required. The text content of the line. + :type text: str + :param bounding_box: Required. Bounding box of an extracted line. + :type bounding_box: list[float] + :param words: Required. List of words in the text line. + :type words: list[~azure.ai.formrecognizer.v2_1_preview_3.models.TextWord] + :param appearance: Text appearance properties. + :type appearance: ~azure.ai.formrecognizer.v2_1_preview_3.models.Appearance + """ + + _validation = { + 'text': {'required': True}, + 'bounding_box': {'required': True, 'max_items': 8, 'min_items': 8}, + 'words': {'required': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + 'words': {'key': 'words', 'type': '[TextWord]'}, + 'appearance': {'key': 'appearance', 'type': 'Appearance'}, + } + + def __init__( + self, + **kwargs + ): + super(TextLine, self).__init__(**kwargs) + self.text = kwargs['text'] + self.bounding_box = kwargs['bounding_box'] + self.words = kwargs['words'] + self.appearance = kwargs.get('appearance', None) + + +class TextWord(msrest.serialization.Model): + """An object representing a word. + + All required parameters must be populated in order to send to Azure. + + :param text: Required. The text content of the word. + :type text: str + :param bounding_box: Required. Bounding box of an extracted word. + :type bounding_box: list[float] + :param confidence: Confidence value. + :type confidence: float + """ + + _validation = { + 'text': {'required': True}, + 'bounding_box': {'required': True, 'max_items': 8, 'min_items': 8}, + 'confidence': {'maximum': 1, 'minimum': 0}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(TextWord, self).__init__(**kwargs) + self.text = kwargs['text'] + self.bounding_box = kwargs['bounding_box'] + self.confidence = kwargs.get('confidence', None) + + +class TrainingDocumentInfo(msrest.serialization.Model): + """Report for a custom model training document. + + All required parameters must be populated in order to send to Azure. + + :param document_name: Required. Training document name. + :type document_name: str + :param pages: Required. Total number of pages trained. + :type pages: int + :param errors: Required. List of errors. + :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + :param status: Required. Status of the training operation. Possible values include: + "succeeded", "partiallySucceeded", "failed". + :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainStatus + """ + + _validation = { + 'document_name': {'required': True}, + 'pages': {'required': True}, + 'errors': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'document_name': {'key': 'documentName', 'type': 'str'}, + 'pages': {'key': 'pages', 'type': 'int'}, + 'errors': {'key': 'errors', 'type': '[ErrorInformation]'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrainingDocumentInfo, self).__init__(**kwargs) + self.document_name = kwargs['document_name'] + self.pages = kwargs['pages'] + self.errors = kwargs['errors'] + self.status = kwargs['status'] + + +class TrainRequest(msrest.serialization.Model): + """Request parameter to train a new custom model. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. Source path containing the training documents. + :type source: str + :param source_filter: Filter to apply to the documents in the source path for training. + :type source_filter: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainSourceFilter + :param use_label_file: Use label file for training a model. + :type use_label_file: bool + :param model_name: Optional user defined model name (max length: 1024). + :type model_name: str + """ + + _validation = { + 'source': {'required': True, 'max_length': 2048, 'min_length': 0}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'source_filter': {'key': 'sourceFilter', 'type': 'TrainSourceFilter'}, + 'use_label_file': {'key': 'useLabelFile', 'type': 'bool'}, + 'model_name': {'key': 'modelName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrainRequest, self).__init__(**kwargs) + self.source = kwargs['source'] + self.source_filter = kwargs.get('source_filter', None) + self.use_label_file = kwargs.get('use_label_file', False) + self.model_name = kwargs.get('model_name', None) + + +class TrainResult(msrest.serialization.Model): + """Custom model training result. + + All required parameters must be populated in order to send to Azure. + + :param training_documents: Required. List of the documents used to train the model and any + errors reported in each document. + :type training_documents: + list[~azure.ai.formrecognizer.v2_1_preview_3.models.TrainingDocumentInfo] + :param fields: List of fields used to train the model and the train operation error reported by + each. + :type fields: list[~azure.ai.formrecognizer.v2_1_preview_3.models.FormFieldsReport] + :param average_model_accuracy: Average accuracy. + :type average_model_accuracy: float + :param model_id: Model identifier. + :type model_id: str + :param errors: Errors returned during the training operation. + :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + """ + + _validation = { + 'training_documents': {'required': True}, + } + + _attribute_map = { + 'training_documents': {'key': 'trainingDocuments', 'type': '[TrainingDocumentInfo]'}, + 'fields': {'key': 'fields', 'type': '[FormFieldsReport]'}, + 'average_model_accuracy': {'key': 'averageModelAccuracy', 'type': 'float'}, + 'model_id': {'key': 'modelId', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[ErrorInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(TrainResult, self).__init__(**kwargs) + self.training_documents = kwargs['training_documents'] + self.fields = kwargs.get('fields', None) + self.average_model_accuracy = kwargs.get('average_model_accuracy', None) + self.model_id = kwargs.get('model_id', None) + self.errors = kwargs.get('errors', None) + + +class TrainSourceFilter(msrest.serialization.Model): + """Filter to apply to the documents in the source path for training. + + :param prefix: A case-sensitive prefix string to filter documents in the source path for + training. For example, when using a Azure storage blob Uri, use the prefix to restrict sub + folders for training. + :type prefix: str + :param include_sub_folders: A flag to indicate if sub folders within the set of prefix folders + will also need to be included when searching for content to be preprocessed. + :type include_sub_folders: bool + """ + + _validation = { + 'prefix': {'max_length': 1024, 'min_length': 0}, + } + + _attribute_map = { + 'prefix': {'key': 'prefix', 'type': 'str'}, + 'include_sub_folders': {'key': 'includeSubFolders', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(TrainSourceFilter, self).__init__(**kwargs) + self.prefix = kwargs.get('prefix', None) + self.include_sub_folders = kwargs.get('include_sub_folders', False) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models_py3.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models_py3.py new file mode 100644 index 000000000000..a1ed52242c63 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/models/_models_py3.py @@ -0,0 +1,1477 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._form_recognizer_client_enums import * + + +class AnalyzeOperationResult(msrest.serialization.Model): + """Status and result of the queued analyze operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Operation status. Possible values include: "notStarted", "running", + "succeeded", "failed". + :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.OperationStatus + :param created_date_time: Required. Date and time (UTC) when the analyze operation was + submitted. + :type created_date_time: ~datetime.datetime + :param last_updated_date_time: Required. Date and time (UTC) when the status was last updated. + :type last_updated_date_time: ~datetime.datetime + :param analyze_result: Results of the analyze operation. + :type analyze_result: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeResult + """ + + _validation = { + 'status': {'required': True}, + 'created_date_time': {'required': True}, + 'last_updated_date_time': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_updated_date_time': {'key': 'lastUpdatedDateTime', 'type': 'iso-8601'}, + 'analyze_result': {'key': 'analyzeResult', 'type': 'AnalyzeResult'}, + } + + def __init__( + self, + *, + status: Union[str, "OperationStatus"], + created_date_time: datetime.datetime, + last_updated_date_time: datetime.datetime, + analyze_result: Optional["AnalyzeResult"] = None, + **kwargs + ): + super(AnalyzeOperationResult, self).__init__(**kwargs) + self.status = status + self.created_date_time = created_date_time + self.last_updated_date_time = last_updated_date_time + self.analyze_result = analyze_result + + +class AnalyzeResult(msrest.serialization.Model): + """Analyze operation result. + + All required parameters must be populated in order to send to Azure. + + :param version: Required. Version of schema used for this result. + :type version: str + :param read_results: Required. Text extracted from the input. + :type read_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ReadResult] + :param page_results: Page-level information extracted from the input. + :type page_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.PageResult] + :param document_results: Document-level information extracted from the input. + :type document_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.DocumentResult] + :param errors: List of errors reported during the analyze operation. + :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + """ + + _validation = { + 'version': {'required': True}, + 'read_results': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'read_results': {'key': 'readResults', 'type': '[ReadResult]'}, + 'page_results': {'key': 'pageResults', 'type': '[PageResult]'}, + 'document_results': {'key': 'documentResults', 'type': '[DocumentResult]'}, + 'errors': {'key': 'errors', 'type': '[ErrorInformation]'}, + } + + def __init__( + self, + *, + version: str, + read_results: List["ReadResult"], + page_results: Optional[List["PageResult"]] = None, + document_results: Optional[List["DocumentResult"]] = None, + errors: Optional[List["ErrorInformation"]] = None, + **kwargs + ): + super(AnalyzeResult, self).__init__(**kwargs) + self.version = version + self.read_results = read_results + self.page_results = page_results + self.document_results = document_results + self.errors = errors + + +class Appearance(msrest.serialization.Model): + """An object representing the appearance of the text line. + + All required parameters must be populated in order to send to Azure. + + :param style: Required. An object representing the style of the text line. + :type style: ~azure.ai.formrecognizer.v2_1_preview_3.models.Style + """ + + _validation = { + 'style': {'required': True}, + } + + _attribute_map = { + 'style': {'key': 'style', 'type': 'Style'}, + } + + def __init__( + self, + *, + style: "Style", + **kwargs + ): + super(Appearance, self).__init__(**kwargs) + self.style = style + + +class Attributes(msrest.serialization.Model): + """Optional model attributes. + + :param is_composed: Is this model composed? (default: false). + :type is_composed: bool + """ + + _attribute_map = { + 'is_composed': {'key': 'isComposed', 'type': 'bool'}, + } + + def __init__( + self, + *, + is_composed: Optional[bool] = False, + **kwargs + ): + super(Attributes, self).__init__(**kwargs) + self.is_composed = is_composed + + +class ComposeRequest(msrest.serialization.Model): + """Request contract for compose operation. + + All required parameters must be populated in order to send to Azure. + + :param model_ids: Required. List of model ids to compose. + :type model_ids: list[str] + :param model_name: Optional user defined model name (max length: 1024). + :type model_name: str + """ + + _validation = { + 'model_ids': {'required': True}, + } + + _attribute_map = { + 'model_ids': {'key': 'modelIds', 'type': '[str]'}, + 'model_name': {'key': 'modelName', 'type': 'str'}, + } + + def __init__( + self, + *, + model_ids: List[str], + model_name: Optional[str] = None, + **kwargs + ): + super(ComposeRequest, self).__init__(**kwargs) + self.model_ids = model_ids + self.model_name = model_name + + +class CopyAuthorizationResult(msrest.serialization.Model): + """Request parameter that contains authorization claims for copy operation. + + All required parameters must be populated in order to send to Azure. + + :param model_id: Required. Model identifier. + :type model_id: str + :param access_token: Required. Token claim used to authorize the request. + :type access_token: str + :param expiration_date_time_ticks: Required. The time when the access token expires. The date + is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time. + :type expiration_date_time_ticks: long + """ + + _validation = { + 'model_id': {'required': True}, + 'access_token': {'required': True}, + 'expiration_date_time_ticks': {'required': True}, + } + + _attribute_map = { + 'model_id': {'key': 'modelId', 'type': 'str'}, + 'access_token': {'key': 'accessToken', 'type': 'str'}, + 'expiration_date_time_ticks': {'key': 'expirationDateTimeTicks', 'type': 'long'}, + } + + def __init__( + self, + *, + model_id: str, + access_token: str, + expiration_date_time_ticks: int, + **kwargs + ): + super(CopyAuthorizationResult, self).__init__(**kwargs) + self.model_id = model_id + self.access_token = access_token + self.expiration_date_time_ticks = expiration_date_time_ticks + + +class CopyOperationResult(msrest.serialization.Model): + """Status and result of the queued copy operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Operation status. Possible values include: "notStarted", "running", + "succeeded", "failed". + :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.OperationStatus + :param created_date_time: Required. Date and time (UTC) when the copy operation was submitted. + :type created_date_time: ~datetime.datetime + :param last_updated_date_time: Required. Date and time (UTC) when the status was last updated. + :type last_updated_date_time: ~datetime.datetime + :param copy_result: Results of the copy operation. + :type copy_result: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyResult + """ + + _validation = { + 'status': {'required': True}, + 'created_date_time': {'required': True}, + 'last_updated_date_time': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_updated_date_time': {'key': 'lastUpdatedDateTime', 'type': 'iso-8601'}, + 'copy_result': {'key': 'copyResult', 'type': 'CopyResult'}, + } + + def __init__( + self, + *, + status: Union[str, "OperationStatus"], + created_date_time: datetime.datetime, + last_updated_date_time: datetime.datetime, + copy_result: Optional["CopyResult"] = None, + **kwargs + ): + super(CopyOperationResult, self).__init__(**kwargs) + self.status = status + self.created_date_time = created_date_time + self.last_updated_date_time = last_updated_date_time + self.copy_result = copy_result + + +class CopyRequest(msrest.serialization.Model): + """Request parameter to copy an existing custom model from the source resource to a target resource referenced by the resource ID. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. Azure Resource Id of the target Form Recognizer resource + where the model is copied to. + :type target_resource_id: str + :param target_resource_region: Required. Location of the target Azure resource. A valid Azure + region name supported by Cognitive Services. + :type target_resource_region: str + :param copy_authorization: Required. Entity that encodes claims to authorize the copy request. + :type copy_authorization: + ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult + """ + + _validation = { + 'target_resource_id': {'required': True, 'max_length': 1024, 'min_length': 0, 'pattern': r'^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.CognitiveServices/accounts/[^/]*$'}, + 'target_resource_region': {'required': True, 'max_length': 24, 'min_length': 1, 'pattern': r'^[a-z0-9]+$'}, + 'copy_authorization': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'target_resource_region': {'key': 'targetResourceRegion', 'type': 'str'}, + 'copy_authorization': {'key': 'copyAuthorization', 'type': 'CopyAuthorizationResult'}, + } + + def __init__( + self, + *, + target_resource_id: str, + target_resource_region: str, + copy_authorization: "CopyAuthorizationResult", + **kwargs + ): + super(CopyRequest, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.target_resource_region = target_resource_region + self.copy_authorization = copy_authorization + + +class CopyResult(msrest.serialization.Model): + """Custom model copy result. + + All required parameters must be populated in order to send to Azure. + + :param model_id: Required. Identifier of the target model. + :type model_id: str + :param errors: Errors returned during the copy operation. + :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + """ + + _validation = { + 'model_id': {'required': True}, + } + + _attribute_map = { + 'model_id': {'key': 'modelId', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[ErrorInformation]'}, + } + + def __init__( + self, + *, + model_id: str, + errors: Optional[List["ErrorInformation"]] = None, + **kwargs + ): + super(CopyResult, self).__init__(**kwargs) + self.model_id = model_id + self.errors = errors + + +class DataTable(msrest.serialization.Model): + """Information about the extracted table contained in a page. + + All required parameters must be populated in order to send to Azure. + + :param rows: Required. Number of rows. + :type rows: int + :param columns: Required. Number of columns. + :type columns: int + :param cells: Required. List of cells contained in the table. + :type cells: list[~azure.ai.formrecognizer.v2_1_preview_3.models.DataTableCell] + :param bounding_box: Required. Bounding box of the table. + :type bounding_box: list[float] + """ + + _validation = { + 'rows': {'required': True, 'minimum': 1}, + 'columns': {'required': True, 'minimum': 1}, + 'cells': {'required': True}, + 'bounding_box': {'required': True, 'max_items': 8, 'min_items': 8}, + } + + _attribute_map = { + 'rows': {'key': 'rows', 'type': 'int'}, + 'columns': {'key': 'columns', 'type': 'int'}, + 'cells': {'key': 'cells', 'type': '[DataTableCell]'}, + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + } + + def __init__( + self, + *, + rows: int, + columns: int, + cells: List["DataTableCell"], + bounding_box: List[float], + **kwargs + ): + super(DataTable, self).__init__(**kwargs) + self.rows = rows + self.columns = columns + self.cells = cells + self.bounding_box = bounding_box + + +class DataTableCell(msrest.serialization.Model): + """Information about the extracted cell in a table. + + All required parameters must be populated in order to send to Azure. + + :param row_index: Required. Row index of the cell. + :type row_index: int + :param column_index: Required. Column index of the cell. + :type column_index: int + :param row_span: Number of rows spanned by this cell. + :type row_span: int + :param column_span: Number of columns spanned by this cell. + :type column_span: int + :param text: Required. Text content of the cell. + :type text: str + :param bounding_box: Required. Bounding box of the cell. + :type bounding_box: list[float] + :param confidence: Required. Confidence value. + :type confidence: float + :param elements: When includeTextDetails is set to true, a list of references to the text + elements constituting this table cell. + :type elements: list[str] + :param is_header: Is the current cell a header cell?. + :type is_header: bool + :param is_footer: Is the current cell a footer cell?. + :type is_footer: bool + """ + + _validation = { + 'row_index': {'required': True, 'minimum': 0}, + 'column_index': {'required': True, 'minimum': 0}, + 'row_span': {'minimum': 1}, + 'column_span': {'minimum': 1}, + 'text': {'required': True}, + 'bounding_box': {'required': True, 'max_items': 8, 'min_items': 8}, + 'confidence': {'required': True, 'maximum': 1, 'minimum': 0}, + } + + _attribute_map = { + 'row_index': {'key': 'rowIndex', 'type': 'int'}, + 'column_index': {'key': 'columnIndex', 'type': 'int'}, + 'row_span': {'key': 'rowSpan', 'type': 'int'}, + 'column_span': {'key': 'columnSpan', 'type': 'int'}, + 'text': {'key': 'text', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + 'elements': {'key': 'elements', 'type': '[str]'}, + 'is_header': {'key': 'isHeader', 'type': 'bool'}, + 'is_footer': {'key': 'isFooter', 'type': 'bool'}, + } + + def __init__( + self, + *, + row_index: int, + column_index: int, + text: str, + bounding_box: List[float], + confidence: float, + row_span: Optional[int] = 1, + column_span: Optional[int] = 1, + elements: Optional[List[str]] = None, + is_header: Optional[bool] = False, + is_footer: Optional[bool] = False, + **kwargs + ): + super(DataTableCell, self).__init__(**kwargs) + self.row_index = row_index + self.column_index = column_index + self.row_span = row_span + self.column_span = column_span + self.text = text + self.bounding_box = bounding_box + self.confidence = confidence + self.elements = elements + self.is_header = is_header + self.is_footer = is_footer + + +class DocumentResult(msrest.serialization.Model): + """A set of extracted fields corresponding to the input document. + + All required parameters must be populated in order to send to Azure. + + :param doc_type: Required. Document type. + :type doc_type: str + :param model_id: Model identifier. + :type model_id: str + :param page_range: Required. First and last page number where the document is found. + :type page_range: list[int] + :param doc_type_confidence: Predicted document type confidence. + :type doc_type_confidence: float + :param fields: Required. Dictionary of named field values. + :type fields: dict[str, ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValue] + """ + + _validation = { + 'doc_type': {'required': True}, + 'page_range': {'required': True, 'max_items': 2, 'min_items': 2}, + 'doc_type_confidence': {'maximum': 1, 'minimum': 0}, + 'fields': {'required': True}, + } + + _attribute_map = { + 'doc_type': {'key': 'docType', 'type': 'str'}, + 'model_id': {'key': 'modelId', 'type': 'str'}, + 'page_range': {'key': 'pageRange', 'type': '[int]'}, + 'doc_type_confidence': {'key': 'docTypeConfidence', 'type': 'float'}, + 'fields': {'key': 'fields', 'type': '{FieldValue}'}, + } + + def __init__( + self, + *, + doc_type: str, + page_range: List[int], + fields: Dict[str, "FieldValue"], + model_id: Optional[str] = None, + doc_type_confidence: Optional[float] = None, + **kwargs + ): + super(DocumentResult, self).__init__(**kwargs) + self.doc_type = doc_type + self.model_id = model_id + self.page_range = page_range + self.doc_type_confidence = doc_type_confidence + self.fields = fields + + +class ErrorInformation(msrest.serialization.Model): + """ErrorInformation. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. + :type code: str + :param message: Required. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: str, + message: str, + **kwargs + ): + super(ErrorInformation, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorResponse(msrest.serialization.Model): + """ErrorResponse. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. + :type error: ~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorInformation'}, + } + + def __init__( + self, + *, + error: "ErrorInformation", + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class FieldValue(msrest.serialization.Model): + """Recognized field value. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Type of field value. Possible values include: "string", "date", "time", + "phoneNumber", "number", "integer", "array", "object", "selectionMark", "gender", "country". + :type type: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValueType + :param value_string: String value. + :type value_string: str + :param value_date: Date value. + :type value_date: ~datetime.date + :param value_time: Time value. + :type value_time: ~datetime.time + :param value_phone_number: Phone number value. + :type value_phone_number: str + :param value_number: Floating point value. + :type value_number: float + :param value_integer: Integer value. + :type value_integer: int + :param value_array: Array of field values. + :type value_array: list[~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValue] + :param value_object: Dictionary of named field values. + :type value_object: dict[str, ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValue] + :param value_selection_mark: Selection mark value. Possible values include: "selected", + "unselected". + :type value_selection_mark: str or + ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValueSelectionMark + :param value_gender: Gender value: M, F, or X. Possible values include: "M", "F", "X". + :type value_gender: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.FieldValueGender + :param value_country: 3-letter country code (ISO 3166-1 alpha-3). + :type value_country: str + :param text: Text content of the extracted field. + :type text: str + :param bounding_box: Bounding box of the field value, if appropriate. + :type bounding_box: list[float] + :param confidence: Confidence score. + :type confidence: float + :param elements: When includeTextDetails is set to true, a list of references to the text + elements constituting this field. + :type elements: list[str] + :param page: The 1-based page number in the input document. + :type page: int + """ + + _validation = { + 'type': {'required': True}, + 'bounding_box': {'max_items': 8, 'min_items': 8}, + 'confidence': {'maximum': 1, 'minimum': 0}, + 'page': {'minimum': 1}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value_string': {'key': 'valueString', 'type': 'str'}, + 'value_date': {'key': 'valueDate', 'type': 'date'}, + 'value_time': {'key': 'valueTime', 'type': 'time'}, + 'value_phone_number': {'key': 'valuePhoneNumber', 'type': 'str'}, + 'value_number': {'key': 'valueNumber', 'type': 'float'}, + 'value_integer': {'key': 'valueInteger', 'type': 'int'}, + 'value_array': {'key': 'valueArray', 'type': '[FieldValue]'}, + 'value_object': {'key': 'valueObject', 'type': '{FieldValue}'}, + 'value_selection_mark': {'key': 'valueSelectionMark', 'type': 'str'}, + 'value_gender': {'key': 'valueGender', 'type': 'str'}, + 'value_country': {'key': 'valueCountry', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + 'elements': {'key': 'elements', 'type': '[str]'}, + 'page': {'key': 'page', 'type': 'int'}, + } + + def __init__( + self, + *, + type: Union[str, "FieldValueType"], + value_string: Optional[str] = None, + value_date: Optional[datetime.date] = None, + value_time: Optional[datetime.time] = None, + value_phone_number: Optional[str] = None, + value_number: Optional[float] = None, + value_integer: Optional[int] = None, + value_array: Optional[List["FieldValue"]] = None, + value_object: Optional[Dict[str, "FieldValue"]] = None, + value_selection_mark: Optional[Union[str, "FieldValueSelectionMark"]] = None, + value_gender: Optional[Union[str, "FieldValueGender"]] = None, + value_country: Optional[str] = None, + text: Optional[str] = None, + bounding_box: Optional[List[float]] = None, + confidence: Optional[float] = None, + elements: Optional[List[str]] = None, + page: Optional[int] = None, + **kwargs + ): + super(FieldValue, self).__init__(**kwargs) + self.type = type + self.value_string = value_string + self.value_date = value_date + self.value_time = value_time + self.value_phone_number = value_phone_number + self.value_number = value_number + self.value_integer = value_integer + self.value_array = value_array + self.value_object = value_object + self.value_selection_mark = value_selection_mark + self.value_gender = value_gender + self.value_country = value_country + self.text = text + self.bounding_box = bounding_box + self.confidence = confidence + self.elements = elements + self.page = page + + +class FormFieldsReport(msrest.serialization.Model): + """Report for a custom model training field. + + All required parameters must be populated in order to send to Azure. + + :param field_name: Required. Training field name. + :type field_name: str + :param accuracy: Required. Estimated extraction accuracy for this field. + :type accuracy: float + """ + + _validation = { + 'field_name': {'required': True}, + 'accuracy': {'required': True}, + } + + _attribute_map = { + 'field_name': {'key': 'fieldName', 'type': 'str'}, + 'accuracy': {'key': 'accuracy', 'type': 'float'}, + } + + def __init__( + self, + *, + field_name: str, + accuracy: float, + **kwargs + ): + super(FormFieldsReport, self).__init__(**kwargs) + self.field_name = field_name + self.accuracy = accuracy + + +class KeysResult(msrest.serialization.Model): + """Keys extracted by the custom model. + + All required parameters must be populated in order to send to Azure. + + :param clusters: Required. Object mapping clusterIds to a list of keys. + :type clusters: dict[str, list[str]] + """ + + _validation = { + 'clusters': {'required': True}, + } + + _attribute_map = { + 'clusters': {'key': 'clusters', 'type': '{[str]}'}, + } + + def __init__( + self, + *, + clusters: Dict[str, List[str]], + **kwargs + ): + super(KeysResult, self).__init__(**kwargs) + self.clusters = clusters + + +class KeyValueElement(msrest.serialization.Model): + """Information about the extracted key or value in a key-value pair. + + All required parameters must be populated in order to send to Azure. + + :param type: Semantic data type of the key value element. Possible values include: "string", + "selectionMark". + :type type: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValueType + :param text: Required. The text content of the key or value. + :type text: str + :param bounding_box: Bounding box of the key or value. + :type bounding_box: list[float] + :param elements: When includeTextDetails is set to true, a list of references to the text + elements constituting this key or value. + :type elements: list[str] + """ + + _validation = { + 'text': {'required': True}, + 'bounding_box': {'max_items': 8, 'min_items': 8}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + 'elements': {'key': 'elements', 'type': '[str]'}, + } + + def __init__( + self, + *, + text: str, + type: Optional[Union[str, "KeyValueType"]] = None, + bounding_box: Optional[List[float]] = None, + elements: Optional[List[str]] = None, + **kwargs + ): + super(KeyValueElement, self).__init__(**kwargs) + self.type = type + self.text = text + self.bounding_box = bounding_box + self.elements = elements + + +class KeyValuePair(msrest.serialization.Model): + """Information about the extracted key-value pair. + + All required parameters must be populated in order to send to Azure. + + :param label: A user defined label for the key/value pair entry. + :type label: str + :param key: Required. Information about the extracted key in a key-value pair. + :type key: ~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValueElement + :param value: Required. Information about the extracted value in a key-value pair. + :type value: ~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValueElement + :param confidence: Required. Confidence value. + :type confidence: float + """ + + _validation = { + 'key': {'required': True}, + 'value': {'required': True}, + 'confidence': {'required': True, 'maximum': 1, 'minimum': 0}, + } + + _attribute_map = { + 'label': {'key': 'label', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'KeyValueElement'}, + 'value': {'key': 'value', 'type': 'KeyValueElement'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + } + + def __init__( + self, + *, + key: "KeyValueElement", + value: "KeyValueElement", + confidence: float, + label: Optional[str] = None, + **kwargs + ): + super(KeyValuePair, self).__init__(**kwargs) + self.label = label + self.key = key + self.value = value + self.confidence = confidence + + +class Model(msrest.serialization.Model): + """Response to the get custom model operation. + + All required parameters must be populated in order to send to Azure. + + :param model_info: Required. Basic custom model information. + :type model_info: ~azure.ai.formrecognizer.v2_1_preview_3.models.ModelInfo + :param keys: Keys extracted by the custom model. + :type keys: ~azure.ai.formrecognizer.v2_1_preview_3.models.KeysResult + :param train_result: Training result for custom model. + :type train_result: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainResult + :param composed_train_results: Training result for composed model. + :type composed_train_results: list[~azure.ai.formrecognizer.v2_1_preview_3.models.TrainResult] + """ + + _validation = { + 'model_info': {'required': True}, + } + + _attribute_map = { + 'model_info': {'key': 'modelInfo', 'type': 'ModelInfo'}, + 'keys': {'key': 'keys', 'type': 'KeysResult'}, + 'train_result': {'key': 'trainResult', 'type': 'TrainResult'}, + 'composed_train_results': {'key': 'composedTrainResults', 'type': '[TrainResult]'}, + } + + def __init__( + self, + *, + model_info: "ModelInfo", + keys: Optional["KeysResult"] = None, + train_result: Optional["TrainResult"] = None, + composed_train_results: Optional[List["TrainResult"]] = None, + **kwargs + ): + super(Model, self).__init__(**kwargs) + self.model_info = model_info + self.keys = keys + self.train_result = train_result + self.composed_train_results = composed_train_results + + +class ModelInfo(msrest.serialization.Model): + """Basic custom model information. + + All required parameters must be populated in order to send to Azure. + + :param model_id: Required. Model identifier. + :type model_id: str + :param status: Required. Status of the model. Possible values include: "creating", "ready", + "invalid". + :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ModelStatus + :param created_date_time: Required. Date and time (UTC) when the model was created. + :type created_date_time: ~datetime.datetime + :param last_updated_date_time: Required. Date and time (UTC) when the status was last updated. + :type last_updated_date_time: ~datetime.datetime + :param model_name: Optional user defined model name (max length: 1024). + :type model_name: str + :param attributes: Optional model attributes. + :type attributes: ~azure.ai.formrecognizer.v2_1_preview_3.models.Attributes + """ + + _validation = { + 'model_id': {'required': True}, + 'status': {'required': True}, + 'created_date_time': {'required': True}, + 'last_updated_date_time': {'required': True}, + } + + _attribute_map = { + 'model_id': {'key': 'modelId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_updated_date_time': {'key': 'lastUpdatedDateTime', 'type': 'iso-8601'}, + 'model_name': {'key': 'modelName', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'Attributes'}, + } + + def __init__( + self, + *, + model_id: str, + status: Union[str, "ModelStatus"], + created_date_time: datetime.datetime, + last_updated_date_time: datetime.datetime, + model_name: Optional[str] = None, + attributes: Optional["Attributes"] = None, + **kwargs + ): + super(ModelInfo, self).__init__(**kwargs) + self.model_id = model_id + self.status = status + self.created_date_time = created_date_time + self.last_updated_date_time = last_updated_date_time + self.model_name = model_name + self.attributes = attributes + + +class Models(msrest.serialization.Model): + """Response to the list custom models operation. + + :param summary: Summary of all trained custom models. + :type summary: ~azure.ai.formrecognizer.v2_1_preview_3.models.ModelsSummary + :param model_list: Collection of trained custom models. + :type model_list: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ModelInfo] + :param next_link: Link to the next page of custom models. + :type next_link: str + """ + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'ModelsSummary'}, + 'model_list': {'key': 'modelList', 'type': '[ModelInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + summary: Optional["ModelsSummary"] = None, + model_list: Optional[List["ModelInfo"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(Models, self).__init__(**kwargs) + self.summary = summary + self.model_list = model_list + self.next_link = next_link + + +class ModelsSummary(msrest.serialization.Model): + """Summary of all trained custom models. + + All required parameters must be populated in order to send to Azure. + + :param count: Required. Current count of trained custom models. + :type count: int + :param limit: Required. Max number of models that can be trained for this account. + :type limit: int + :param last_updated_date_time: Required. Date and time (UTC) when the summary was last updated. + :type last_updated_date_time: ~datetime.datetime + """ + + _validation = { + 'count': {'required': True}, + 'limit': {'required': True}, + 'last_updated_date_time': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'last_updated_date_time': {'key': 'lastUpdatedDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + count: int, + limit: int, + last_updated_date_time: datetime.datetime, + **kwargs + ): + super(ModelsSummary, self).__init__(**kwargs) + self.count = count + self.limit = limit + self.last_updated_date_time = last_updated_date_time + + +class PageResult(msrest.serialization.Model): + """Extracted information from a single page. + + All required parameters must be populated in order to send to Azure. + + :param page: Required. Page number. + :type page: int + :param cluster_id: Cluster identifier. + :type cluster_id: int + :param key_value_pairs: List of key-value pairs extracted from the page. + :type key_value_pairs: list[~azure.ai.formrecognizer.v2_1_preview_3.models.KeyValuePair] + :param tables: List of data tables extracted from the page. + :type tables: list[~azure.ai.formrecognizer.v2_1_preview_3.models.DataTable] + """ + + _validation = { + 'page': {'required': True, 'minimum': 1}, + 'cluster_id': {'minimum': 0}, + } + + _attribute_map = { + 'page': {'key': 'page', 'type': 'int'}, + 'cluster_id': {'key': 'clusterId', 'type': 'int'}, + 'key_value_pairs': {'key': 'keyValuePairs', 'type': '[KeyValuePair]'}, + 'tables': {'key': 'tables', 'type': '[DataTable]'}, + } + + def __init__( + self, + *, + page: int, + cluster_id: Optional[int] = None, + key_value_pairs: Optional[List["KeyValuePair"]] = None, + tables: Optional[List["DataTable"]] = None, + **kwargs + ): + super(PageResult, self).__init__(**kwargs) + self.page = page + self.cluster_id = cluster_id + self.key_value_pairs = key_value_pairs + self.tables = tables + + +class ReadResult(msrest.serialization.Model): + """Text extracted from a page in the input document. + + All required parameters must be populated in order to send to Azure. + + :param page: Required. The 1-based page number in the input document. + :type page: int + :param angle: Required. The general orientation of the text in clockwise direction, measured in + degrees between (-180, 180]. + :type angle: float + :param width: Required. The width of the image/PDF in pixels/inches, respectively. + :type width: float + :param height: Required. The height of the image/PDF in pixels/inches, respectively. + :type height: float + :param unit: Required. The unit used by the width, height and boundingBox properties. For + images, the unit is "pixel". For PDF, the unit is "inch". Possible values include: "pixel", + "inch". + :type unit: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.LengthUnit + :param lines: When includeTextDetails is set to true, a list of recognized text lines. The + maximum number of lines returned is 300 per page. The lines are sorted top to bottom, left to + right, although in certain cases proximity is treated with higher priority. As the sorting + order depends on the detected text, it may change across images and OCR version updates. Thus, + business logic should be built upon the actual line location instead of order. + :type lines: list[~azure.ai.formrecognizer.v2_1_preview_3.models.TextLine] + :param selection_marks: List of selection marks extracted from the page. + :type selection_marks: list[~azure.ai.formrecognizer.v2_1_preview_3.models.SelectionMark] + """ + + _validation = { + 'page': {'required': True, 'minimum': 1}, + 'angle': {'required': True, 'maximum': 180, 'minimum_ex': -180}, + 'width': {'required': True, 'minimum': 0}, + 'height': {'required': True, 'minimum': 0}, + 'unit': {'required': True}, + } + + _attribute_map = { + 'page': {'key': 'page', 'type': 'int'}, + 'angle': {'key': 'angle', 'type': 'float'}, + 'width': {'key': 'width', 'type': 'float'}, + 'height': {'key': 'height', 'type': 'float'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'lines': {'key': 'lines', 'type': '[TextLine]'}, + 'selection_marks': {'key': 'selectionMarks', 'type': '[SelectionMark]'}, + } + + def __init__( + self, + *, + page: int, + angle: float, + width: float, + height: float, + unit: Union[str, "LengthUnit"], + lines: Optional[List["TextLine"]] = None, + selection_marks: Optional[List["SelectionMark"]] = None, + **kwargs + ): + super(ReadResult, self).__init__(**kwargs) + self.page = page + self.angle = angle + self.width = width + self.height = height + self.unit = unit + self.lines = lines + self.selection_marks = selection_marks + + +class SelectionMark(msrest.serialization.Model): + """Information about the extracted selection mark. + + All required parameters must be populated in order to send to Azure. + + :param bounding_box: Required. Bounding box of the selection mark. + :type bounding_box: list[float] + :param confidence: Required. Confidence value. + :type confidence: float + :param state: Required. State of the selection mark. Possible values include: "selected", + "unselected". + :type state: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.SelectionMarkState + """ + + _validation = { + 'bounding_box': {'required': True, 'max_items': 8, 'min_items': 8}, + 'confidence': {'required': True, 'maximum': 1, 'minimum': 0}, + 'state': {'required': True}, + } + + _attribute_map = { + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + bounding_box: List[float], + confidence: float, + state: Union[str, "SelectionMarkState"], + **kwargs + ): + super(SelectionMark, self).__init__(**kwargs) + self.bounding_box = bounding_box + self.confidence = confidence + self.state = state + + +class SourcePath(msrest.serialization.Model): + """Uri or local path to source data. + + :param source: File source path. + :type source: str + """ + + _validation = { + 'source': {'max_length': 2048, 'min_length': 0}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + } + + def __init__( + self, + *, + source: Optional[str] = None, + **kwargs + ): + super(SourcePath, self).__init__(**kwargs) + self.source = source + + +class Style(msrest.serialization.Model): + """An object representing the style of the text line. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The text line style name, including handwriting and other. Possible + values include: "other", "handwriting". + :type name: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.TextStyle + :param confidence: Required. The confidence of text line style. + :type confidence: float + """ + + _validation = { + 'name': {'required': True}, + 'confidence': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + } + + def __init__( + self, + *, + name: Union[str, "TextStyle"], + confidence: float, + **kwargs + ): + super(Style, self).__init__(**kwargs) + self.name = name + self.confidence = confidence + + +class TextLine(msrest.serialization.Model): + """An object representing an extracted text line. + + All required parameters must be populated in order to send to Azure. + + :param text: Required. The text content of the line. + :type text: str + :param bounding_box: Required. Bounding box of an extracted line. + :type bounding_box: list[float] + :param words: Required. List of words in the text line. + :type words: list[~azure.ai.formrecognizer.v2_1_preview_3.models.TextWord] + :param appearance: Text appearance properties. + :type appearance: ~azure.ai.formrecognizer.v2_1_preview_3.models.Appearance + """ + + _validation = { + 'text': {'required': True}, + 'bounding_box': {'required': True, 'max_items': 8, 'min_items': 8}, + 'words': {'required': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + 'words': {'key': 'words', 'type': '[TextWord]'}, + 'appearance': {'key': 'appearance', 'type': 'Appearance'}, + } + + def __init__( + self, + *, + text: str, + bounding_box: List[float], + words: List["TextWord"], + appearance: Optional["Appearance"] = None, + **kwargs + ): + super(TextLine, self).__init__(**kwargs) + self.text = text + self.bounding_box = bounding_box + self.words = words + self.appearance = appearance + + +class TextWord(msrest.serialization.Model): + """An object representing a word. + + All required parameters must be populated in order to send to Azure. + + :param text: Required. The text content of the word. + :type text: str + :param bounding_box: Required. Bounding box of an extracted word. + :type bounding_box: list[float] + :param confidence: Confidence value. + :type confidence: float + """ + + _validation = { + 'text': {'required': True}, + 'bounding_box': {'required': True, 'max_items': 8, 'min_items': 8}, + 'confidence': {'maximum': 1, 'minimum': 0}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': '[float]'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + } + + def __init__( + self, + *, + text: str, + bounding_box: List[float], + confidence: Optional[float] = None, + **kwargs + ): + super(TextWord, self).__init__(**kwargs) + self.text = text + self.bounding_box = bounding_box + self.confidence = confidence + + +class TrainingDocumentInfo(msrest.serialization.Model): + """Report for a custom model training document. + + All required parameters must be populated in order to send to Azure. + + :param document_name: Required. Training document name. + :type document_name: str + :param pages: Required. Total number of pages trained. + :type pages: int + :param errors: Required. List of errors. + :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + :param status: Required. Status of the training operation. Possible values include: + "succeeded", "partiallySucceeded", "failed". + :type status: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainStatus + """ + + _validation = { + 'document_name': {'required': True}, + 'pages': {'required': True}, + 'errors': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'document_name': {'key': 'documentName', 'type': 'str'}, + 'pages': {'key': 'pages', 'type': 'int'}, + 'errors': {'key': 'errors', 'type': '[ErrorInformation]'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + document_name: str, + pages: int, + errors: List["ErrorInformation"], + status: Union[str, "TrainStatus"], + **kwargs + ): + super(TrainingDocumentInfo, self).__init__(**kwargs) + self.document_name = document_name + self.pages = pages + self.errors = errors + self.status = status + + +class TrainRequest(msrest.serialization.Model): + """Request parameter to train a new custom model. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. Source path containing the training documents. + :type source: str + :param source_filter: Filter to apply to the documents in the source path for training. + :type source_filter: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainSourceFilter + :param use_label_file: Use label file for training a model. + :type use_label_file: bool + :param model_name: Optional user defined model name (max length: 1024). + :type model_name: str + """ + + _validation = { + 'source': {'required': True, 'max_length': 2048, 'min_length': 0}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'source_filter': {'key': 'sourceFilter', 'type': 'TrainSourceFilter'}, + 'use_label_file': {'key': 'useLabelFile', 'type': 'bool'}, + 'model_name': {'key': 'modelName', 'type': 'str'}, + } + + def __init__( + self, + *, + source: str, + source_filter: Optional["TrainSourceFilter"] = None, + use_label_file: Optional[bool] = False, + model_name: Optional[str] = None, + **kwargs + ): + super(TrainRequest, self).__init__(**kwargs) + self.source = source + self.source_filter = source_filter + self.use_label_file = use_label_file + self.model_name = model_name + + +class TrainResult(msrest.serialization.Model): + """Custom model training result. + + All required parameters must be populated in order to send to Azure. + + :param training_documents: Required. List of the documents used to train the model and any + errors reported in each document. + :type training_documents: + list[~azure.ai.formrecognizer.v2_1_preview_3.models.TrainingDocumentInfo] + :param fields: List of fields used to train the model and the train operation error reported by + each. + :type fields: list[~azure.ai.formrecognizer.v2_1_preview_3.models.FormFieldsReport] + :param average_model_accuracy: Average accuracy. + :type average_model_accuracy: float + :param model_id: Model identifier. + :type model_id: str + :param errors: Errors returned during the training operation. + :type errors: list[~azure.ai.formrecognizer.v2_1_preview_3.models.ErrorInformation] + """ + + _validation = { + 'training_documents': {'required': True}, + } + + _attribute_map = { + 'training_documents': {'key': 'trainingDocuments', 'type': '[TrainingDocumentInfo]'}, + 'fields': {'key': 'fields', 'type': '[FormFieldsReport]'}, + 'average_model_accuracy': {'key': 'averageModelAccuracy', 'type': 'float'}, + 'model_id': {'key': 'modelId', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[ErrorInformation]'}, + } + + def __init__( + self, + *, + training_documents: List["TrainingDocumentInfo"], + fields: Optional[List["FormFieldsReport"]] = None, + average_model_accuracy: Optional[float] = None, + model_id: Optional[str] = None, + errors: Optional[List["ErrorInformation"]] = None, + **kwargs + ): + super(TrainResult, self).__init__(**kwargs) + self.training_documents = training_documents + self.fields = fields + self.average_model_accuracy = average_model_accuracy + self.model_id = model_id + self.errors = errors + + +class TrainSourceFilter(msrest.serialization.Model): + """Filter to apply to the documents in the source path for training. + + :param prefix: A case-sensitive prefix string to filter documents in the source path for + training. For example, when using a Azure storage blob Uri, use the prefix to restrict sub + folders for training. + :type prefix: str + :param include_sub_folders: A flag to indicate if sub folders within the set of prefix folders + will also need to be included when searching for content to be preprocessed. + :type include_sub_folders: bool + """ + + _validation = { + 'prefix': {'max_length': 1024, 'min_length': 0}, + } + + _attribute_map = { + 'prefix': {'key': 'prefix', 'type': 'str'}, + 'include_sub_folders': {'key': 'includeSubFolders', 'type': 'bool'}, + } + + def __init__( + self, + *, + prefix: Optional[str] = None, + include_sub_folders: Optional[bool] = False, + **kwargs + ): + super(TrainSourceFilter, self).__init__(**kwargs) + self.prefix = prefix + self.include_sub_folders = include_sub_folders diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/operations/__init__.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/operations/__init__.py new file mode 100644 index 000000000000..f2f858714054 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._form_recognizer_client_operations import FormRecognizerClientOperationsMixin + +__all__ = [ + 'FormRecognizerClientOperationsMixin', +] diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/operations/_form_recognizer_client_operations.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/operations/_form_recognizer_client_operations.py new file mode 100644 index 000000000000..44a62816c2e8 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/operations/_form_recognizer_client_operations.py @@ -0,0 +1,1980 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.polling.base_polling import LROBasePolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, IO, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class FormRecognizerClientOperationsMixin(object): + + def _train_custom_model_async_initial( + self, + train_request, # type: "_models.TrainRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._train_custom_model_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(train_request, 'TrainRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _train_custom_model_async_initial.metadata = {'url': '/custom/models'} # type: ignore + + def begin_train_custom_model_async( + self, + train_request, # type: "_models.TrainRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Train Custom Model. + + Create and train a custom model. The request must include a source parameter that is either an + externally accessible Azure storage blob container Uri (preferably a Shared Access Signature + Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, + they must follow the Linux/Unix path format and be an absolute path rooted to the input mount + configuration setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' + then a valid source path would be '/input/contosodataset'. All data to be trained is expected + to be under the source folder or sub folders under it. Models are trained using documents that + are of the following content type - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' + or 'image/bmp'. Other type of content is ignored. + + :param train_request: Training request parameters. + :type train_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.TrainRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._train_custom_model_async_initial( + train_request=train_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_train_custom_model_async.metadata = {'url': '/custom/models'} # type: ignore + + def get_custom_model( + self, + model_id, # type: str + include_keys=False, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "_models.Model" + """Get Custom Model. + + Get detailed information about a custom model. + + :param model_id: Model identifier. + :type model_id: str + :param include_keys: Include list of extracted keys in model information. + :type include_keys: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Model, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Model + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_custom_model.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_keys is not None: + query_parameters['includeKeys'] = self._serialize.query("include_keys", include_keys, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Model', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_custom_model.metadata = {'url': '/custom/models/{modelId}'} # type: ignore + + def delete_custom_model( + self, + model_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete Custom Model. + + Mark model for deletion. Model artifacts will be permanently removed within a predetermined + period. + + :param model_id: Model identifier. + :type model_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.delete_custom_model.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete_custom_model.metadata = {'url': '/custom/models/{modelId}'} # type: ignore + + def _analyze_with_custom_model_initial( + self, + model_id, # type: str + include_text_details=False, # type: Optional[bool] + pages=None, # type: Optional[List[str]] + file_stream=None, # type: Optional[Union[IO, "_models.SourcePath"]] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._analyze_with_custom_model_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_text_details is not None: + query_parameters['includeTextDetails'] = self._serialize.query("include_text_details", include_text_details, 'bool') + if pages is not None: + query_parameters['pages'] = self._serialize.query("pages", pages, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff']: + body_content_kwargs['stream_content'] = file_stream + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: + if file_stream is not None: + body_content = self._serialize.body(file_stream, 'SourcePath') + else: + body_content = None + body_content_kwargs['content'] = body_content + else: + raise ValueError( + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) + ) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _analyze_with_custom_model_initial.metadata = {'url': '/custom/models/{modelId}/analyze'} # type: ignore + + def begin_analyze_with_custom_model( + self, + model_id, # type: str + include_text_details=False, # type: Optional[bool] + pages=None, # type: Optional[List[str]] + file_stream=None, # type: Optional[Union[IO, "_models.SourcePath"]] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Analyze Form. + + Extract key-value pairs, tables, and semantic values from a given document. The input document + must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', + 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location + (Uri or local path) of the document to be analyzed. + + :param model_id: Model identifier. + :type model_id: str + :param include_text_details: Include text lines and element references in the result. + :type include_text_details: bool + :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the + pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or + range with a comma. + :type pages: list[str] + :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". + Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._analyze_with_custom_model_initial( + model_id=model_id, + include_text_details=include_text_details, + pages=pages, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_with_custom_model.metadata = {'url': '/custom/models/{modelId}/analyze'} # type: ignore + + def get_analyze_form_result( + self, + model_id, # type: str + result_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AnalyzeOperationResult" + """Get Analyze Form Result. + + Obtain current status and the result of the analyze form operation. + + :param model_id: Model identifier. + :type model_id: str + :param result_id: Analyze operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalyzeOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_analyze_form_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_analyze_form_result.metadata = {'url': '/custom/models/{modelId}/analyzeResults/{resultId}'} # type: ignore + + def _copy_custom_model_initial( + self, + model_id, # type: str + copy_request, # type: "_models.CopyRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._copy_custom_model_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(copy_request, 'CopyRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _copy_custom_model_initial.metadata = {'url': '/custom/models/{modelId}/copy'} # type: ignore + + def begin_copy_custom_model( + self, + model_id, # type: str + copy_request, # type: "_models.CopyRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Copy Custom Model. + + Copy custom model stored in this resource (the source) to user specified target Form Recognizer + resource. + + :param model_id: Model identifier. + :type model_id: str + :param copy_request: Copy request parameters. + :type copy_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._copy_custom_model_initial( + model_id=model_id, + copy_request=copy_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_copy_custom_model.metadata = {'url': '/custom/models/{modelId}/copy'} # type: ignore + + def get_custom_model_copy_result( + self, + model_id, # type: str + result_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CopyOperationResult" + """Get Custom Model Copy Result. + + Obtain current status and the result of a custom model copy operation. + + :param model_id: Model identifier. + :type model_id: str + :param result_id: Copy operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CopyOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CopyOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_custom_model_copy_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'modelId': self._serialize.url("model_id", model_id, 'str'), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('CopyOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_custom_model_copy_result.metadata = {'url': '/custom/models/{modelId}/copyResults/{resultId}'} # type: ignore + + def generate_model_copy_authorization( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.CopyAuthorizationResult" + """Generate Copy Authorization. + + Generate authorization to copy a model into the target Form Recognizer resource. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CopyAuthorizationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.CopyAuthorizationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CopyAuthorizationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.generate_model_copy_authorization.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('CopyAuthorizationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + generate_model_copy_authorization.metadata = {'url': '/custom/models/copyAuthorization'} # type: ignore + + def _compose_custom_models_async_initial( + self, + compose_request, # type: "_models.ComposeRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._compose_custom_models_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(compose_request, 'ComposeRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _compose_custom_models_async_initial.metadata = {'url': '/custom/models/compose'} # type: ignore + + def begin_compose_custom_models_async( + self, + compose_request, # type: "_models.ComposeRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Compose trained with labels models into one composed model. + + Compose request would include list of models ids. + It would validate what all models either trained with labels model or composed model. + It would validate limit of models put together. + + :param compose_request: Compose models. + :type compose_request: ~azure.ai.formrecognizer.v2_1_preview_3.models.ComposeRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._compose_custom_models_async_initial( + compose_request=compose_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_compose_custom_models_async.metadata = {'url': '/custom/models/compose'} # type: ignore + + def _analyze_business_card_async_initial( + self, + include_text_details=False, # type: Optional[bool] + locale=None, # type: Optional[Union[str, "_models.Locale"]] + pages=None, # type: Optional[List[str]] + file_stream=None, # type: Optional[Union[IO, "_models.SourcePath"]] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._analyze_business_card_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_text_details is not None: + query_parameters['includeTextDetails'] = self._serialize.query("include_text_details", include_text_details, 'bool') + if locale is not None: + query_parameters['locale'] = self._serialize.query("locale", locale, 'str') + if pages is not None: + query_parameters['pages'] = self._serialize.query("pages", pages, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff']: + body_content_kwargs['stream_content'] = file_stream + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: + if file_stream is not None: + body_content = self._serialize.body(file_stream, 'SourcePath') + else: + body_content = None + body_content_kwargs['content'] = body_content + else: + raise ValueError( + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) + ) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _analyze_business_card_async_initial.metadata = {'url': '/prebuilt/businessCard/analyze'} # type: ignore + + def begin_analyze_business_card_async( + self, + include_text_details=False, # type: Optional[bool] + locale=None, # type: Optional[Union[str, "_models.Locale"]] + pages=None, # type: Optional[List[str]] + file_stream=None, # type: Optional[Union[IO, "_models.SourcePath"]] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Analyze Business Card. + + Extract field text and semantic values from a given business card document. The input document + must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', + 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location + (Uri) of the document to be analyzed. + + :param include_text_details: Include text lines and element references in the result. + :type include_text_details: bool + :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, + en-IN, en-US(default). + :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the + pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or + range with a comma. + :type pages: list[str] + :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". + Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._analyze_business_card_async_initial( + include_text_details=include_text_details, + locale=locale, + pages=pages, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_business_card_async.metadata = {'url': '/prebuilt/businessCard/analyze'} # type: ignore + + def get_analyze_business_card_result( + self, + result_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AnalyzeOperationResult" + """Get Analyze Business Card Result. + + Track the progress and obtain the result of the analyze business card operation. + + :param result_id: Analyze operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalyzeOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_analyze_business_card_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_analyze_business_card_result.metadata = {'url': '/prebuilt/businessCard/analyzeResults/{resultId}'} # type: ignore + + def _analyze_invoice_async_initial( + self, + include_text_details=False, # type: Optional[bool] + locale=None, # type: Optional[Union[str, "_models.Locale"]] + pages=None, # type: Optional[List[str]] + file_stream=None, # type: Optional[Union[IO, "_models.SourcePath"]] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._analyze_invoice_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_text_details is not None: + query_parameters['includeTextDetails'] = self._serialize.query("include_text_details", include_text_details, 'bool') + if locale is not None: + query_parameters['locale'] = self._serialize.query("locale", locale, 'str') + if pages is not None: + query_parameters['pages'] = self._serialize.query("pages", pages, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff']: + body_content_kwargs['stream_content'] = file_stream + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: + if file_stream is not None: + body_content = self._serialize.body(file_stream, 'SourcePath') + else: + body_content = None + body_content_kwargs['content'] = body_content + else: + raise ValueError( + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) + ) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _analyze_invoice_async_initial.metadata = {'url': '/prebuilt/invoice/analyze'} # type: ignore + + def begin_analyze_invoice_async( + self, + include_text_details=False, # type: Optional[bool] + locale=None, # type: Optional[Union[str, "_models.Locale"]] + pages=None, # type: Optional[List[str]] + file_stream=None, # type: Optional[Union[IO, "_models.SourcePath"]] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Analyze Invoice Document. + + Extract field text and semantic values from a given invoice document. The input document must + be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', + 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location + (Uri) of the document to be analyzed. + + :param include_text_details: Include text lines and element references in the result. + :type include_text_details: bool + :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, + en-IN, en-US(default). + :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the + pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or + range with a comma. + :type pages: list[str] + :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". + Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._analyze_invoice_async_initial( + include_text_details=include_text_details, + locale=locale, + pages=pages, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_invoice_async.metadata = {'url': '/prebuilt/invoice/analyze'} # type: ignore + + def get_analyze_invoice_result( + self, + result_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AnalyzeOperationResult" + """Get Analyze Invoice Result. + + Track the progress and obtain the result of the analyze invoice operation. + + :param result_id: Analyze operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalyzeOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_analyze_invoice_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_analyze_invoice_result.metadata = {'url': '/prebuilt/invoice/analyzeResults/{resultId}'} # type: ignore + + def _analyze_id_document_async_initial( + self, + include_text_details=False, # type: Optional[bool] + pages=None, # type: Optional[List[str]] + file_stream=None, # type: Optional[Union[IO, "_models.SourcePath"]] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._analyze_id_document_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_text_details is not None: + query_parameters['includeTextDetails'] = self._serialize.query("include_text_details", include_text_details, 'bool') + if pages is not None: + query_parameters['pages'] = self._serialize.query("pages", pages, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff']: + body_content_kwargs['stream_content'] = file_stream + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: + if file_stream is not None: + body_content = self._serialize.body(file_stream, 'SourcePath') + else: + body_content = None + body_content_kwargs['content'] = body_content + else: + raise ValueError( + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) + ) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _analyze_id_document_async_initial.metadata = {'url': '/prebuilt/idDocument/analyze'} # type: ignore + + def begin_analyze_id_document_async( + self, + include_text_details=False, # type: Optional[bool] + pages=None, # type: Optional[List[str]] + file_stream=None, # type: Optional[Union[IO, "_models.SourcePath"]] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Analyze ID Document. + + Extract field text and semantic values from a given ID document. The input document must be of + one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' + or 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri) of the + document to be analyzed. + + :param include_text_details: Include text lines and element references in the result. + :type include_text_details: bool + :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the + pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or + range with a comma. + :type pages: list[str] + :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". + Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._analyze_id_document_async_initial( + include_text_details=include_text_details, + pages=pages, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_id_document_async.metadata = {'url': '/prebuilt/idDocument/analyze'} # type: ignore + + def get_analyze_id_document_result( + self, + result_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AnalyzeOperationResult" + """Get Analyze ID Document Result. + + Track the progress and obtain the result of the analyze ID operation. + + :param result_id: Analyze operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalyzeOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_analyze_id_document_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_analyze_id_document_result.metadata = {'url': '/prebuilt/idDocument/analyzeResults/{resultId}'} # type: ignore + + def _analyze_receipt_async_initial( + self, + include_text_details=False, # type: Optional[bool] + locale=None, # type: Optional[Union[str, "_models.Locale"]] + pages=None, # type: Optional[List[str]] + file_stream=None, # type: Optional[Union[IO, "_models.SourcePath"]] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._analyze_receipt_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_text_details is not None: + query_parameters['includeTextDetails'] = self._serialize.query("include_text_details", include_text_details, 'bool') + if locale is not None: + query_parameters['locale'] = self._serialize.query("locale", locale, 'str') + if pages is not None: + query_parameters['pages'] = self._serialize.query("pages", pages, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff']: + body_content_kwargs['stream_content'] = file_stream + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: + if file_stream is not None: + body_content = self._serialize.body(file_stream, 'SourcePath') + else: + body_content = None + body_content_kwargs['content'] = body_content + else: + raise ValueError( + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) + ) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _analyze_receipt_async_initial.metadata = {'url': '/prebuilt/receipt/analyze'} # type: ignore + + def begin_analyze_receipt_async( + self, + include_text_details=False, # type: Optional[bool] + locale=None, # type: Optional[Union[str, "_models.Locale"]] + pages=None, # type: Optional[List[str]] + file_stream=None, # type: Optional[Union[IO, "_models.SourcePath"]] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Analyze Receipt. + + Extract field text and semantic values from a given receipt document. The input document must + be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', + 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location + (Uri) of the document to be analyzed. + + :param include_text_details: Include text lines and element references in the result. + :type include_text_details: bool + :param locale: Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, + en-IN, en-US(default). + :type locale: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Locale + :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the + pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or + range with a comma. + :type pages: list[str] + :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". + Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._analyze_receipt_async_initial( + include_text_details=include_text_details, + locale=locale, + pages=pages, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_receipt_async.metadata = {'url': '/prebuilt/receipt/analyze'} # type: ignore + + def get_analyze_receipt_result( + self, + result_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AnalyzeOperationResult" + """Get Analyze Receipt Result. + + Track the progress and obtain the result of the analyze receipt operation. + + :param result_id: Analyze operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalyzeOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_analyze_receipt_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_analyze_receipt_result.metadata = {'url': '/prebuilt/receipt/analyzeResults/{resultId}'} # type: ignore + + def _analyze_layout_async_initial( + self, + pages=None, # type: Optional[List[str]] + language=None, # type: Optional[Union[str, "_models.Language"]] + reading_order="basic", # type: Optional[Union[str, "_models.ReadingOrder"]] + file_stream=None, # type: Optional[Union[IO, "_models.SourcePath"]] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._analyze_layout_async_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if pages is not None: + query_parameters['pages'] = self._serialize.query("pages", pages, '[str]', div=',') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if reading_order is not None: + query_parameters['readingOrder'] = self._serialize.query("reading_order", reading_order, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff']: + body_content_kwargs['stream_content'] = file_stream + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: + if file_stream is not None: + body_content = self._serialize.body(file_stream, 'SourcePath') + else: + body_content = None + body_content_kwargs['content'] = body_content + else: + raise ValueError( + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/bmp', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) + ) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _analyze_layout_async_initial.metadata = {'url': '/layout/analyze'} # type: ignore + + def begin_analyze_layout_async( + self, + pages=None, # type: Optional[List[str]] + language=None, # type: Optional[Union[str, "_models.Language"]] + reading_order="basic", # type: Optional[Union[str, "_models.ReadingOrder"]] + file_stream=None, # type: Optional[Union[IO, "_models.SourcePath"]] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Analyze Layout. + + Extract text and layout information from a given document. The input document must be of one of + the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or + 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri or local + path) of the document to be analyzed. + + :param pages: Custom page numbers for multi-page documents(PDF/TIFF), input the number of the + pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or + range with a comma. + :type pages: list[str] + :param language: Currently, only Afrikaans (‘af’), Albanian (‘sq’), Asturian (‘ast’), Basque + (‘eu’), Bislama (‘bi’), Breton (‘br’), Catalan (‘ca’), Cebuano (‘ceb’), Chamorro (‘ch’), + Cornish (‘kw’), Corsican (‘co’), Crimean Tatar - Latin script(‘crh’), Czech (‘cs’), Danish + (‘da’), Dutch (‘nl’), English ('en'), Estonian (‘et’), Fijian (‘fj’), Filipino (‘fil’), Finnish + (‘fi’), French (‘fr’), Friulian (‘fur’), Galician (‘gl’), German (‘de’), Gilbertese (‘gil’), + Greenlandic (‘kl’), Haitian Creole (‘ht’), Hani (‘hni’), Hmong Daw (‘mww’), Hungarian (‘hu’), + Indonesian (‘id’), Interlingua (‘ia’), Inuktitut (‘iu’), Irish (‘ga’), Italian (‘it’), Japanese + (‘ja’), Javanese (‘jv’), Kabuverdianu (‘kea’), Kachin (‘kac’), Kara-Kalpak (‘kaa’), Kashubian + (‘csb’), Khasi (‘kha’), Korean (‘ko’), Kurdish - Latin script (‘ku’), K’iche’ (‘quc’), + Luxembourgish (‘lb’), Malay (‘ms’), Manx (‘gv’), Neapolitan (‘nap’), Norwegian (‘no’), Occitan + (‘oc’), Polish (‘pl’), Portuguese (‘pt’), Romansh (‘rm’), Scots (‘sco’), Scottish Gaelic + (‘gd’), simplified Chinese (‘zh-Hans’), Slovenian (‘sl’), Spanish (‘es’), Swahili (‘sw’), + Swedish (‘sv’), Tatar - Latin script (‘tt’), Tetum (‘tet’), traditional Chinese (‘zh-Hant’), + Turkish (‘tr’), Upper Sorbian (‘hsb’), Uzbek (‘uz’), Volapük (‘vo’), Walser (‘wae’), Western + Frisian (‘fy’), Yucatec Maya (‘yua’), Zhuang (‘za’) and Zulu (‘zu’) are supported (print – + seventy-three languages and handwritten – English only). Layout supports auto language + identification and multi language documents, so only provide a language code if you would like + to force the documented to be processed as that specific language. + :type language: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.Language + :param reading_order: Reading order algorithm to sort the text lines returned. Supported + reading orders include: basic(default), natural. + :type reading_order: str or ~azure.ai.formrecognizer.v2_1_preview_3.models.ReadingOrder + :param file_stream: .json, .pdf, .jpg, .png, .tiff or .bmp type file stream. + :type file_stream: IO or ~azure.ai.formrecognizer.v2_1_preview_3.models.SourcePath + :keyword str content_type: Media type of the body sent to the API. Default value is "application/json". + Allowed values are: "application/pdf", "image/bmp", "image/jpeg", "image/png", "image/tiff", "application/json". + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._analyze_layout_async_initial( + pages=pages, + language=language, + reading_order=reading_order, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_layout_async.metadata = {'url': '/layout/analyze'} # type: ignore + + def get_analyze_layout_result( + self, + result_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AnalyzeOperationResult" + """Get Analyze Layout Result. + + Track the progress and obtain the result of the analyze layout operation. + + :param result_id: Analyze operation result identifier. + :type result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalyzeOperationResult, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.AnalyzeOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + accept = "application/json" + + # Construct URL + url = self.get_analyze_layout_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'resultId': self._serialize.url("result_id", result_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_analyze_layout_result.metadata = {'url': '/layout/analyzeResults/{resultId}'} # type: ignore + + def list_custom_models( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.Models"] + """List Custom Models. + + Get information about all custom models. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Models or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.formrecognizer.v2_1_preview_3.models.Models] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Models"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + op = "full" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_custom_models.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['op'] = self._serialize.query("op", op, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('Models', pipeline_response) + list_of_elem = deserialized.model_list + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_custom_models.metadata = {'url': '/custom/models'} # type: ignore + + def get_custom_models( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.Models" + """Get Custom Models. + + Get information about all custom models. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Models, or the result of cls(response) + :rtype: ~azure.ai.formrecognizer.v2_1_preview_3.models.Models + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Models"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + op = "summary" + accept = "application/json" + + # Construct URL + url = self.get_custom_models.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['op'] = self._serialize.query("op", op, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Models', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_custom_models.metadata = {'url': '/custom/models'} # type: ignore diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/py.typed b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/v2_1_preview_3/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_helpers.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_helpers.py index ea79ed9ac1c5..10ac89a614a3 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_helpers.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_helpers.py @@ -17,8 +17,10 @@ def _get_deserialize(api_version): if api_version == "2.0": from ._generated.v2_0 import FormRecognizerClient - else: + elif api_version == "2.1": from ._generated.v2_1 import FormRecognizerClient + elif api_version == "2.1-preview.3": + from ._generated.v2_1_preview_3 import FormRecognizerClient return FormRecognizerClient( # pylint: disable=protected-access "dummy", "dummy" )._deserialize diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_base_client_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_base_client_async.py index c9575f2687eb..6186a7815255 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_base_client_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_base_client_async.py @@ -32,7 +32,7 @@ def __init__( self._endpoint = endpoint self._credential = credential self._api_version = kwargs.pop( - "api_version", FormRecognizerApiVersion.V2_1 + "api_version", FormRecognizerApiVersion.V2_1_PREVIEW ) validate_api_version(self._api_version) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py index 2d2a8dca4f64..cc54926d7504 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py @@ -124,11 +124,11 @@ async def begin_recognize_receipts( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if locale: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"locale": locale}) else: raise ValueError( - "'locale' is only available for API version V2_1 and up" + "'locale' is only available for API version V2_1_PREVIEW and up" ) pages = kwargs.pop("pages", None) @@ -136,11 +136,11 @@ async def begin_recognize_receipts( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1 and up" + "'pages' is only available for API version V2_1_PREVIEW and up" ) return await self._client.begin_analyze_receipt_async( # type: ignore @@ -199,11 +199,11 @@ async def begin_recognize_receipts_from_url( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if locale: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"locale": locale}) else: raise ValueError( - "'locale' is only available for API version V2_1 and up" + "'locale' is only available for API version V2_1_PREVIEW and up" ) pages = kwargs.pop("pages", None) @@ -211,11 +211,11 @@ async def begin_recognize_receipts_from_url( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1 and up" + "'pages' is only available for API version V2_1_PREVIEW and up" ) return await self._client.begin_analyze_receipt_async( # type: ignore @@ -294,7 +294,7 @@ async def begin_recognize_business_cards( except ValueError as e: if "begin_analyze_business_card_async" in str(e): raise ValueError( - "Method 'begin_recognize_business_cards' is only available for API version V2_1 and up" + "Method 'begin_recognize_business_cards' is only available for API version V2_1_PREVIEW and up" ) raise e @@ -344,7 +344,7 @@ async def begin_recognize_business_cards_from_url( if "begin_analyze_business_card_async" in str(e): raise ValueError( "Method 'begin_recognize_business_cards_from_url' is only available for " - "API version V2_1 and up" + "API version V2_1_PREVIEW and up" ) raise e @@ -414,7 +414,7 @@ async def begin_recognize_id_documents( except ValueError as e: if "begin_analyze_id_document_async" in str(e): raise ValueError( - "Method 'begin_recognize_id_documents' is only available for API version V2_1 and up" + "Method 'begin_recognize_id_documents' is only available for API version V2_1_PREVIEW and up" ) raise e @@ -462,7 +462,7 @@ async def begin_recognize_id_documents_from_url( if "begin_analyze_id_document_async" in str(e): raise ValueError( "Method 'begin_recognize_id_documents_from_url' is " - "only available for API version V2_1 and up" + "only available for API version V2_1_PREVIEW and up" ) raise e @@ -533,7 +533,7 @@ async def begin_recognize_invoices( except ValueError as e: if "begin_analyze_invoice_async" in str(e): raise ValueError( - "Method 'begin_recognize_invoices' is only available for API version V2_1 and up" + "Method 'begin_recognize_invoices' is only available for API version V2_1_PREVIEW and up" ) raise e @@ -582,7 +582,7 @@ async def begin_recognize_invoices_from_url( if "begin_analyze_invoice_async" in str(e): raise ValueError( "Method 'begin_recognize_invoices_from_url' is " - "only available for API version V2_1 and up" + "only available for API version V2_1_PREVIEW and up" ) raise e @@ -656,27 +656,27 @@ async def begin_recognize_content( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1 and up" + "'pages' is only available for API version V2_1_PREVIEW and up" ) if reading_order: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"reading_order": reading_order}) else: raise ValueError( - "'reading_order' is only available for API version V2_1 and up" + "'reading_order' is only available for API version V2_1_PREVIEW and up" ) if language: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"language": language}) else: raise ValueError( - "'language' is only available for API version V2_1 and up" + "'language' is only available for API version V2_1_PREVIEW and up" ) return await self._client.begin_analyze_layout_async( # type: ignore @@ -727,27 +727,27 @@ async def begin_recognize_content_from_url( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1 and up" + "'pages' is only available for API version V2_1_PREVIEW and up" ) if reading_order: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"reading_order": reading_order}) else: raise ValueError( - "'reading_order' is only available for API version V2_1 and up" + "'reading_order' is only available for API version V2_1_PREVIEW and up" ) if language: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"language": language}) else: raise ValueError( - "'language' is only available for API version V2_1 and up" + "'language' is only available for API version V2_1_PREVIEW and up" ) return await self._client.begin_analyze_layout_async( # type: ignore @@ -831,11 +831,11 @@ def analyze_callback( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1 and up" + "'pages' is only available for API version V2_1_PREVIEW and up" ) return await self._client.begin_analyze_with_custom_model( # type: ignore @@ -901,11 +901,11 @@ def analyze_callback( # FIXME: part of this code will be removed once autorest can handle diff mixin # signatures across API versions if pages: - if self._api_version == FormRecognizerApiVersion.V2_1: + if self._api_version in [FormRecognizerApiVersion.V2_1, FormRecognizerApiVersion.V2_1_PREVIEW]: kwargs.update({"pages": pages}) else: raise ValueError( - "'pages' is only available for API version V2_1 and up" + "'pages' is only available for API version V2_1_PREVIEW and up" ) return await self._client.begin_analyze_with_custom_model( # type: ignore diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py index 42c035730e2b..1fb0e25dca90 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py @@ -129,7 +129,7 @@ def callback_v2_1(raw_response, _, headers): # pylint: disable=unused-argument model_name = kwargs.pop("model_name", None) if model_name and self._api_version == "2.0": raise ValueError( - "'model_name' is only available for API version V2_1 and up" + "'model_name' is only available for API version V2_1_PREVIEW and up" ) continuation_token = kwargs.pop("continuation_token", None) polling_interval = kwargs.pop( @@ -481,7 +481,7 @@ def _compose_callback( ) except ValueError: raise ValueError( - "Method 'begin_create_composed_model' is only available for API version V2_1 and up" + "Method 'begin_create_composed_model' is only available for API version V2_1_PREVIEW and up" ) def get_form_recognizer_client(self, **kwargs: Any) -> FormRecognizerClient: diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py index 4c98bf4d5193..614b6e40c1ea 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py @@ -420,7 +420,7 @@ def test_business_card_v2(self, client): business_card = fd.read() with pytest.raises(ValueError) as e: client.begin_recognize_business_cards(business_card) - assert "Method 'begin_recognize_business_cards' is only available for API version V2_1 and up" in str(e.value) + assert "Method 'begin_recognize_business_cards' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py index f5ad4e2266a2..d25faa9aeb55 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py @@ -437,7 +437,7 @@ async def test_business_card_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_business_cards(business_card) - assert "Method 'begin_recognize_business_cards' is only available for API version V2_1 and up" in str(e.value) + assert "Method 'begin_recognize_business_cards' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py index f20a6c99804a..fa5cd66a6d45 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py @@ -342,7 +342,7 @@ def test_business_card_continuation_token(self, client): def test_business_card_v2(self, client): with pytest.raises(ValueError) as e: client.begin_recognize_business_cards_from_url(self.business_card_url_jpg) - assert "Method 'begin_recognize_business_cards_from_url' is only available for API version V2_1 and up" in str(e.value) + assert "Method 'begin_recognize_business_cards_from_url' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py index c0cfafa6ded9..eb1259a9a344 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py @@ -356,7 +356,7 @@ async def test_business_card_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_business_cards_from_url(self.business_card_url_jpg) - assert "Method 'begin_recognize_business_cards_from_url' is only available for API version V2_1 and up" in str(e.value) + assert "Method 'begin_recognize_business_cards_from_url' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model.py index 5f8c22ab8454..0972c6558b61 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model.py @@ -91,4 +91,4 @@ def test_compose_model_bad_api_version(self, client, formrecognizer_storage_cont with pytest.raises(ValueError) as excinfo: poller = client.begin_create_composed_model(["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"]) result = poller.result() - assert "Method 'begin_create_composed_model' is only available for API version V2_1 and up" in str(excinfo.value) + assert "Method 'begin_create_composed_model' is only available for API version V2_1_PREVIEW and up" in str(excinfo.value) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model_async.py index 2f751f4c1bd3..053bc0e66890 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model_async.py @@ -92,4 +92,4 @@ async def test_compose_model_bad_api_version(self, client, formrecognizer_storag with pytest.raises(ValueError) as excinfo: poller = await client.begin_create_composed_model(["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"]) result = await poller.result() - assert "Method 'begin_create_composed_model' is only available for API version V2_1 and up" in str(excinfo.value) + assert "Method 'begin_create_composed_model' is only available for API version V2_1_PREVIEW and up" in str(excinfo.value) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py index 0f5e4b126f0d..f13df5fae9dc 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py @@ -387,4 +387,4 @@ def test_content_language_v2(self, client): myfile = fd.read() with pytest.raises(ValueError) as e: client.begin_recognize_content(myfile, language="en") - assert "'language' is only available for API version V2_1 and up" in str(e.value) + assert "'language' is only available for API version V2_1_PREVIEW and up" in str(e.value) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py index 23a57445ddd2..67c51378a982 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py @@ -426,4 +426,4 @@ async def test_content_language_v2(self, client): async with client: with pytest.raises(ValueError) as e: await client.begin_recognize_content(myfile, language="en") - assert "'language' is only available for API version V2_1 and up" in str(e.value) + assert "'language' is only available for API version V2_1_PREVIEW and up" in str(e.value) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py index 9208694394f2..54c833b7ff87 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py @@ -279,7 +279,7 @@ def test_content_language_error(self, client): def test_content_language_v2(self, client): with pytest.raises(ValueError) as e: client.begin_recognize_content_from_url(self.form_url_jpg, language="en") - assert "'language' is only available for API version V2_1 and up" in str(e.value) + assert "'language' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py index 249adabef930..5ccb7059eaf6 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py @@ -305,7 +305,7 @@ async def test_content_language_v2(self, client): async with client: with pytest.raises(ValueError) as e: await client.begin_recognize_content_from_url(self.form_url_jpg, language="en") - assert "'language' is only available for API version V2_1 and up" in str(e.value) + assert "'language' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents.py index 1e7c06ed017e..f2c665d1c3ed 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents.py @@ -250,7 +250,7 @@ def test_id_document_v2(self, client): id_document = fd.read() with pytest.raises(ValueError) as e: client.begin_recognize_id_documents(id_document) - assert "Method 'begin_recognize_id_documents' is only available for API version V2_1 and up" in str(e.value) + assert "Method 'begin_recognize_id_documents' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_async.py index 92c91d477959..912459acacd9 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_async.py @@ -269,7 +269,7 @@ async def test_id_document_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_id_documents(id_document) - assert "Method 'begin_recognize_id_documents' is only available for API version V2_1 and up" in str(e.value) + assert "Method 'begin_recognize_id_documents' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url.py index cc04fffda8da..ad8829113037 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url.py @@ -173,7 +173,7 @@ def test_id_document_continuation_token(self, client): def test_id_document_v2(self, client): with pytest.raises(ValueError) as e: client.begin_recognize_id_documents_from_url(self.id_document_url_jpg) - assert "Method 'begin_recognize_id_documents_from_url' is only available for API version V2_1 and up" in str(e.value) + assert "Method 'begin_recognize_id_documents_from_url' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url_async.py index 3512454e2879..ddf9da2f5be5 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_id_documents_from_url_async.py @@ -187,7 +187,7 @@ async def test_id_document_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_id_documents_from_url(self.id_document_url_jpg) - assert "Method 'begin_recognize_id_documents_from_url' is only available for API version V2_1 and up" in str(e.value) + assert "Method 'begin_recognize_id_documents_from_url' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py index c8e044bdc114..80002bf1835d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py @@ -345,7 +345,7 @@ def test_invoice_v2(self, client): invoice = fd.read() with pytest.raises(ValueError) as e: client.begin_recognize_invoices(invoice) - assert "Method 'begin_recognize_invoices' is only available for API version V2_1 and up" in str(e.value) + assert "Method 'begin_recognize_invoices' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py index 97fc01514d63..315fb5730168 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py @@ -382,7 +382,7 @@ async def test_invoice_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_invoices(invoice) - assert "Method 'begin_recognize_invoices' is only available for API version V2_1 and up" in str(e.value) + assert "Method 'begin_recognize_invoices' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py index 4dda52e3a396..61259ff7c79c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py @@ -267,7 +267,7 @@ def test_invoice_continuation_token(self, client): def test_invoice_v2(self, client): with pytest.raises(ValueError) as e: client.begin_recognize_invoices_from_url(self.invoice_url_tiff) - assert "Method 'begin_recognize_invoices_from_url' is only available for API version V2_1 and up" in str(e.value) + assert "Method 'begin_recognize_invoices_from_url' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py index 41fed55447f6..3f4204f29490 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py @@ -282,7 +282,7 @@ async def test_invoice_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_invoices_from_url(self.invoice_url_tiff) - assert "Method 'begin_recognize_invoices_from_url' is only available for API version V2_1 and up" in str(e.value) + assert "Method 'begin_recognize_invoices_from_url' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi.py index 838f9503add7..f4f4851582ac 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi.py @@ -35,6 +35,16 @@ def test_v2_0_form_recognizer_client(self, client): def test_v2_0_form_training_client(self, client): assert "v2.0" in client._client._client._base_url + @FormRecognizerPreparer() + @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1_PREVIEW}) + def test_v2_1_preview_form_recognizer_client(self, client): + assert "v2.1-preview.3" in client._client._client._base_url + + @FormRecognizerPreparer() + @FormTrainingClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1_PREVIEW}) + def test_v2_1_preview_form_training_client(self, client): + assert "v2.1-preview.3" in client._client._client._base_url + @FormRecognizerPreparer() @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1}) def test_v2_1_form_recognizer_client(self, client): diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi_async.py index 4141c4218fe3..4e2cb4963c8b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi_async.py @@ -36,6 +36,16 @@ def test_v2_0_form_recognizer_client(self, client): def test_v2_0_form_training_client(self, client): assert "v2.0" in client._client._client._base_url + @FormRecognizerPreparer() + @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1_PREVIEW}) + def test_v2_1_preview_form_recognizer_client(self, client): + assert "v2.1-preview.3" in client._client._client._base_url + + @FormRecognizerPreparer() + @FormTrainingClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1_PREVIEW}) + def test_v2_1_preview_form_training_client(self, client): + assert "v2.1-preview.3" in client._client._client._base_url + @FormRecognizerPreparer() @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1}) def test_V2_1_form_recognizer_client(self, client): diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py index 93ddbf14b0f8..b605371a288a 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py @@ -379,7 +379,7 @@ def test_receipt_locale_v2(self, client): receipt = fd.read() with pytest.raises(ValueError) as e: client.begin_recognize_receipts(receipt, locale="en-US") - assert "'locale' is only available for API version V2_1 and up" in str(e.value) + assert "'locale' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py index 2241f3c942ce..4bc853363b56 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py @@ -409,7 +409,7 @@ async def test_receipt_locale_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_receipts(receipt, locale="en-US") - assert "'locale' is only available for API version V2_1 and up" in str(e.value) + assert "'locale' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py index afbf6a76e21f..1e0248428672 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py @@ -310,7 +310,7 @@ def test_receipt_locale_error(self, client): def test_receipt_locale_v2(self, client): with pytest.raises(ValueError) as e: client.begin_recognize_receipts_from_url(self.receipt_url_jpg, locale="en-US") - assert "'locale' is only available for API version V2_1 and up" in str(e.value) + assert "'locale' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py index d06446d13bdc..e845d86ef25b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py @@ -342,7 +342,7 @@ async def test_receipt_locale_v2(self, client): with pytest.raises(ValueError) as e: async with client: await client.begin_recognize_receipts_from_url(self.receipt_url_jpg, locale="en-US") - assert "'locale' is only available for API version V2_1 and up" in str(e.value) + assert "'locale' is only available for API version V2_1_PREVIEW and up" in str(e.value) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py index d614d74ace53..a0bb671127a5 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py @@ -264,4 +264,4 @@ def test_training_with_model_name_bad_api_version(self, client, formrecognizer_s with pytest.raises(ValueError) as excinfo: poller = client.begin_training(training_files_url="url", use_training_labels=True, model_name="not supported in v2.0") result = poller.result() - assert "'model_name' is only available for API version V2_1 and up" in str(excinfo.value) + assert "'model_name' is only available for API version V2_1_PREVIEW and up" in str(excinfo.value) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py index 00cf0a178788..906c871f4470 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py @@ -278,4 +278,4 @@ async def test_training_with_model_name_bad_api_version(self, client, formrecogn with pytest.raises(ValueError) as excinfo: poller = await client.begin_training(training_files_url="url", use_training_labels=True, model_name="not supported in v2.0") result = await poller.result() - assert "'model_name' is only available for API version V2_1 and up" in str(excinfo.value) + assert "'model_name' is only available for API version V2_1_PREVIEW and up" in str(excinfo.value) From 4e4605fa61c88c9323f36d8775d83b40e20babdf Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Sun, 2 May 2021 15:21:00 -0700 Subject: [PATCH 5/5] fix multiapi tests --- .../azure-ai-formrecognizer/tests/test_multiapi.py | 8 ++++---- .../azure-ai-formrecognizer/tests/test_multiapi_async.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi.py index f4f4851582ac..b19fb72da168 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi.py @@ -18,12 +18,12 @@ class TestMultiapi(FormRecognizerTest): @FormRecognizerPreparer() @FormRecognizerClientPreparer() def test_default_api_version_form_recognizer_client(self, client): - assert "v2.1" in client._client._client._base_url + assert "v2.1-preview.3" in client._client._client._base_url @FormRecognizerPreparer() @FormTrainingClientPreparer() def test_default_api_version_form_training_client(self, client): - assert "v2.1" in client._client._client._base_url + assert "v2.1-preview.3" in client._client._client._base_url @FormRecognizerPreparer() @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_0}) @@ -37,12 +37,12 @@ def test_v2_0_form_training_client(self, client): @FormRecognizerPreparer() @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1_PREVIEW}) - def test_v2_1_preview_form_recognizer_client(self, client): + def test_v2_1_preview_3_form_recognizer_client(self, client): assert "v2.1-preview.3" in client._client._client._base_url @FormRecognizerPreparer() @FormTrainingClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1_PREVIEW}) - def test_v2_1_preview_form_training_client(self, client): + def test_v2_1_preview_3_form_training_client(self, client): assert "v2.1-preview.3" in client._client._client._base_url @FormRecognizerPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi_async.py index 4e2cb4963c8b..0c0958e35ef4 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_multiapi_async.py @@ -19,12 +19,12 @@ class TestMultiapi(AsyncFormRecognizerTest): @FormRecognizerPreparer() @FormRecognizerClientPreparer() def test_default_api_version_form_recognizer_client(self, client): - assert "v2.1" in client._client._client._base_url + assert "v2.1-preview.3" in client._client._client._base_url @FormRecognizerPreparer() @FormTrainingClientPreparer() def test_default_api_version_form_training_client(self, client): - assert "v2.1" in client._client._client._base_url + assert "v2.1-preview.3" in client._client._client._base_url @FormRecognizerPreparer() @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_0}) @@ -38,12 +38,12 @@ def test_v2_0_form_training_client(self, client): @FormRecognizerPreparer() @FormRecognizerClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1_PREVIEW}) - def test_v2_1_preview_form_recognizer_client(self, client): + def test_v2_1_preview_3_form_recognizer_client(self, client): assert "v2.1-preview.3" in client._client._client._base_url @FormRecognizerPreparer() @FormTrainingClientPreparer(client_kwargs={"api_version": FormRecognizerApiVersion.V2_1_PREVIEW}) - def test_v2_1_preview_form_training_client(self, client): + def test_v2_1_preview_3_form_training_client(self, client): assert "v2.1-preview.3" in client._client._client._base_url @FormRecognizerPreparer()