Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[formrecognizer] add back code #14289

Merged
merged 1 commit into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def begin_recognize_custom_forms(self, model_id, form, **kwargs):
raise ValueError("model_id cannot be None or empty.")

polling_interval = kwargs.pop("polling_interval", self._client._config.polling_interval)

continuation_token = kwargs.pop("continuation_token", None)
content_type = kwargs.pop("content_type", None)
if content_type == "application/json":
raise TypeError("Call begin_recognize_custom_forms_from_url() to analyze a document from a URL.")
Expand All @@ -301,6 +301,7 @@ def analyze_callback(raw_response, _, headers): # pylint: disable=unused-argume
content_type=content_type,
cls=kwargs.pop("cls", analyze_callback),
polling=LROBasePolling(timeout=polling_interval, lro_algorithms=[AnalyzePolling()], **kwargs),
continuation_token=continuation_token,
**kwargs
)

Expand Down Expand Up @@ -329,7 +330,7 @@ def begin_recognize_custom_forms_from_url(self, model_id, form_url, **kwargs):
raise ValueError("model_id cannot be None or empty.")

polling_interval = kwargs.pop("polling_interval", self._client._config.polling_interval)

continuation_token = kwargs.pop("continuation_token", None)
include_field_elements = kwargs.pop("include_field_elements", False)

def analyze_callback(raw_response, _, headers): # pylint: disable=unused-argument
Expand All @@ -342,6 +343,7 @@ def analyze_callback(raw_response, _, headers): # pylint: disable=unused-argume
include_text_details=include_field_elements,
cls=kwargs.pop("cls", analyze_callback),
polling=LROBasePolling(timeout=polling_interval, lro_algorithms=[AnalyzePolling()], **kwargs),
continuation_token=continuation_token,
**kwargs
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ def begin_copy_model(
if not model_id:
raise ValueError("model_id cannot be None or empty.")
polling_interval = kwargs.pop("polling_interval", self._client._config.polling_interval)
continuation_token = kwargs.pop("continuation_token", None)

def _copy_callback(raw_response, _, headers): # pylint: disable=unused-argument
copy_result = self._deserialize(self._generated_models.CopyOperationResult, raw_response)
Expand All @@ -368,6 +369,7 @@ def _copy_callback(raw_response, _, headers): # pylint: disable=unused-argument
),
cls=kwargs.pop("cls", _copy_callback),
polling=LROBasePolling(timeout=polling_interval, lro_algorithms=[CopyPolling()], **kwargs),
continuation_token=continuation_token,
**kwargs
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ async def begin_recognize_custom_forms(

polling_interval = kwargs.pop("polling_interval", self._client._config.polling_interval)
content_type = kwargs.pop("content_type", None)
continuation_token = kwargs.pop("continuation_token", None)
if content_type == "application/json":
raise TypeError("Call begin_recognize_custom_forms_from_url() to analyze a document from a URL.")

Expand All @@ -317,6 +318,7 @@ def analyze_callback(raw_response, _, headers): # pylint: disable=unused-argume
lro_algorithms=[AnalyzePolling()],
**kwargs
),
continuation_token=continuation_token,
**kwargs
)

Expand Down Expand Up @@ -348,7 +350,7 @@ async def begin_recognize_custom_forms_from_url(
if not model_id:
raise ValueError("model_id cannot be None or empty.")
polling_interval = kwargs.pop("polling_interval", self._client._config.polling_interval)

continuation_token = kwargs.pop("continuation_token", None)
include_field_elements = kwargs.pop("include_field_elements", False)

def analyze_callback(raw_response, _, headers): # pylint: disable=unused-argument
Expand All @@ -365,6 +367,7 @@ def analyze_callback(raw_response, _, headers): # pylint: disable=unused-argume
lro_algorithms=[AnalyzePolling()],
**kwargs
),
continuation_token=continuation_token,
**kwargs
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ async def begin_copy_model(
if not model_id:
raise ValueError("model_id cannot be None or empty.")
polling_interval = kwargs.pop("polling_interval", self._client._config.polling_interval)
continuation_token = kwargs.pop("continuation_token", None)

def _copy_callback(raw_response, _, headers): # pylint: disable=unused-argument
copy_result = self._deserialize(self._generated_models.CopyOperationResult, raw_response)
Expand All @@ -380,6 +381,7 @@ def _copy_callback(raw_response, _, headers): # pylint: disable=unused-argument
lro_algorithms=[CopyPolling()],
**kwargs
),
continuation_token=continuation_token,
**kwargs
)

Expand Down