Skip to content
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 @@ -214,13 +214,6 @@ def list_submitted_jobs(self, **kwargs):
# type: (**Any) -> ItemPaged[JobStatusResult]
"""List all the submitted translation jobs under the Document Translation resource.

:keyword int top: Use top to indicate the total number of results you want
to be returned across all pages.
:keyword int skip: Use skip to indicate the number of results to skip from the list
of jobs held by the server based on the sorting method specified. By default,
this is sorted by descending start time.
:keyword int results_per_page: Use results_per_page to indicate the maximum number
of results returned in a page.
:return: ~azure.core.paging.ItemPaged[:class:`~azure.ai.documenttranslation.JobStatusResult`]
:rtype: ~azure.core.paging.ItemPaged
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -235,9 +228,6 @@ def list_submitted_jobs(self, **kwargs):
:caption: List all submitted jobs under the resource.
"""

skip = kwargs.pop('skip', None)
results_per_page = kwargs.pop('results_per_page', None)

def _convert_from_generated_model(generated_model): # pylint: disable=protected-access
return JobStatusResult._from_generated(generated_model) # pylint: disable=protected-access

Expand All @@ -248,8 +238,6 @@ def _convert_from_generated_model(generated_model): # pylint: disable=protected
])

return self._client.document_translation.get_operations(
top=results_per_page,
skip=skip,
cls=model_conversion_function,
**kwargs
)
Expand All @@ -260,13 +248,6 @@ def list_all_document_statuses(self, job_id, **kwargs):
"""List all the document statuses under a translation job.

:param str job_id: The translation job ID.
:keyword int top: Use top to indicate the total number of results you want
to be returned across all pages.
:keyword int skip: Use skip to indicate the number of results to skip from the list
of document statuses held by the server based on the sorting method specified. By default,
this is sorted by descending start time.
:keyword int results_per_page: Use results_per_page to indicate the maximum number
of results returned in a page.
:return: ~azure.core.paging.ItemPaged[:class:`~azure.ai.documenttranslation.DocumentStatusResult`]
:rtype: ~azure.core.paging.ItemPaged
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -281,9 +262,6 @@ def list_all_document_statuses(self, job_id, **kwargs):
:caption: List all the document statuses under the translation job.
"""

skip = kwargs.pop('skip', None)
results_per_page = kwargs.pop('results_per_page', None)

def _convert_from_generated_model(generated_model):
return DocumentStatusResult._from_generated(generated_model) # pylint: disable=protected-access

Expand All @@ -295,13 +273,10 @@ def _convert_from_generated_model(generated_model):

return self._client.document_translation.get_operation_documents_status(
id=job_id,
top=results_per_page,
skip=skip,
cls=model_conversion_function,
**kwargs
)


@distributed_trace
def get_document_status(self, job_id, document_id, **kwargs):
# type: (str, str, **Any) -> DocumentStatusResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ class FileFormat(object): # pylint: disable=useless-object-inheritance, R0903
:vartype content_types: list[str]
:ivar format_versions: Supported Version.
:vartype format_versions: list[str]
:ivar default_format_version: Default format version if none is specified.
:vartype default_format_version: str
"""

def __init__(
Expand All @@ -390,14 +392,16 @@ def __init__(
self.file_extensions = kwargs.get('file_extensions', None)
self.content_types = kwargs.get('content_types', None)
self.format_versions = kwargs.get('format_versions', None)
self.default_format_version = kwargs.get('default_format_version', None)

@classmethod
def _from_generated(cls, file_format):
return cls(
file_format=file_format.format,
file_extensions=file_format.file_extensions,
content_types=file_format.content_types,
format_versions=file_format.versions
format_versions=file_format.versions,
default_format_version=file_format.default_version
)

@staticmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,6 @@ def list_submitted_jobs(self, **kwargs):
# type: (**Any) -> AsyncItemPaged[JobStatusResult]
"""List all the submitted translation jobs under the Document Translation resource.

:keyword int top: Use top to indicate the total number of results you want
to be returned across all pages.
:keyword int skip: Use skip to indicate the number of results to skip from the list
of jobs held by the server based on the sorting method specified. By default,
this is sorted by descending start time.
:keyword int results_per_page: Use results_per_page to indicate the maximum number
of results returned in a page.
:return: ~azure.core.paging.AsyncItemPaged[:class:`~azure.ai.documenttranslation.JobStatusResult`]
:rtype: ~azure.core.paging.AsyncItemPaged
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -235,8 +228,6 @@ def list_submitted_jobs(self, **kwargs):
:dedent: 4
:caption: List all submitted jobs under the resource.
"""
skip = kwargs.pop('skip', None)
results_per_page = kwargs.pop('results_per_page', None)

def _convert_from_generated_model(generated_model):
# pylint: disable=protected-access
Expand All @@ -248,8 +239,6 @@ def _convert_from_generated_model(generated_model):
)

return self._client.document_translation.get_operations(
top=results_per_page,
skip=skip,
cls=model_conversion_function,
**kwargs
)
Expand All @@ -260,13 +249,6 @@ def list_all_document_statuses(self, job_id, **kwargs):
"""List all the document statuses under a translation job.

:param str job_id: The translation job ID.
:keyword int top: Use top to indicate the total number of results you want
to be returned across all pages.
:keyword int skip: Use skip to indicate the number of results to skip from the list
of document statuses held by the server based on the sorting method specified. By default,
this is sorted by descending start time.
:keyword int results_per_page: Use results_per_page to indicate the maximum number
of results returned in a page.
:return: ~azure.core.paging.AsyncItemPaged[:class:`~azure.ai.documenttranslation.DocumentStatusResult`]
:rtype: ~azure.core.paging.AsyncItemPaged
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -280,8 +262,6 @@ def list_all_document_statuses(self, job_id, **kwargs):
:dedent: 8
:caption: List all the document statuses under the translation job.
"""
skip = kwargs.pop('skip', None)
results_per_page = kwargs.pop('results_per_page', None)

def _convert_from_generated_model(generated_model):
# pylint: disable=protected-access
Expand All @@ -294,13 +274,10 @@ def _convert_from_generated_model(generated_model):

return self._client.document_translation.get_operation_documents_status(
id=job_id,
top=results_per_page,
skip=skip,
cls=model_conversion_function,
**kwargs
)


@distributed_trace_async
async def get_document_status(self, job_id, document_id, **kwargs):
# type: (str, str, **Any) -> DocumentStatusResult
Expand Down