Skip to content

Commit d0ed621

Browse files
Re-generated SDK after renaming id to translation_id. Cleaned up patching.
1 parent e6fe73b commit d0ed621

File tree

9 files changed

+59
-166
lines changed

9 files changed

+59
-166
lines changed

sdk/translation/azure-ai-translation-document/MANIFEST.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ recursive-include tests *.py
55
recursive-include samples *.py *.md
66
include azure/__init__.py
77
include azure/ai/__init__.py
8-
include azure/ai/translation/__init__.py
9-
recursive-include doc *.rst
8+
include azure/ai/translation/__init__.py

sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_operations/_operations.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def build_document_translation_list_translation_statuses_request( # pylint: dis
127127

128128

129129
def build_document_translation_get_document_status_request( # pylint: disable=name-too-long
130-
id: str, document_id: str, **kwargs: Any
130+
translation_id: str, document_id: str, **kwargs: Any
131131
) -> HttpRequest:
132132
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
133133
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -138,7 +138,7 @@ def build_document_translation_get_document_status_request( # pylint: disable=n
138138
# Construct URL
139139
_url = "/document/batches/{id}/documents/{documentId}"
140140
path_format_arguments = {
141-
"id": _SERIALIZER.url("id", id, "str"),
141+
"id": _SERIALIZER.url("translation_id", translation_id, "str"),
142142
"documentId": _SERIALIZER.url("document_id", document_id, "str"),
143143
}
144144

@@ -154,7 +154,7 @@ def build_document_translation_get_document_status_request( # pylint: disable=n
154154

155155

156156
def build_document_translation_get_translation_status_request( # pylint: disable=name-too-long
157-
id: str, **kwargs: Any
157+
translation_id: str, **kwargs: Any
158158
) -> HttpRequest:
159159
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
160160
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -165,7 +165,7 @@ def build_document_translation_get_translation_status_request( # pylint: disabl
165165
# Construct URL
166166
_url = "/document/batches/{id}"
167167
path_format_arguments = {
168-
"id": _SERIALIZER.url("id", id, "str"),
168+
"id": _SERIALIZER.url("translation_id", translation_id, "str"),
169169
}
170170

171171
_url: str = _url.format(**path_format_arguments) # type: ignore
@@ -180,7 +180,7 @@ def build_document_translation_get_translation_status_request( # pylint: disabl
180180

181181

182182
def build_document_translation_cancel_translation_request( # pylint: disable=name-too-long
183-
id: str, **kwargs: Any
183+
translation_id: str, **kwargs: Any
184184
) -> HttpRequest:
185185
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
186186
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -191,7 +191,7 @@ def build_document_translation_cancel_translation_request( # pylint: disable=na
191191
# Construct URL
192192
_url = "/document/batches/{id}"
193193
path_format_arguments = {
194-
"id": _SERIALIZER.url("id", id, "str"),
194+
"id": _SERIALIZER.url("translation_id", translation_id, "str"),
195195
}
196196

197197
_url: str = _url.format(**path_format_arguments) # type: ignore
@@ -206,7 +206,7 @@ def build_document_translation_cancel_translation_request( # pylint: disable=na
206206

207207

208208
def build_document_translation_list_document_statuses_request( # pylint: disable=name-too-long
209-
id: str,
209+
translation_id: str,
210210
*,
211211
top: Optional[int] = None,
212212
skip: Optional[int] = None,
@@ -227,7 +227,7 @@ def build_document_translation_list_document_statuses_request( # pylint: disabl
227227
# Construct URL
228228
_url = "/document/batches/{id}/documents"
229229
path_format_arguments = {
230-
"id": _SERIALIZER.url("id", id, "str"),
230+
"id": _SERIALIZER.url("translation_id", translation_id, "str"),
231231
}
232232

233233
_url: str = _url.format(**path_format_arguments) # type: ignore
@@ -860,14 +860,14 @@ def get_next(next_link=None):
860860
return ItemPaged(get_next, extract_data)
861861

862862
@distributed_trace
863-
def get_document_status(self, id: str, document_id: str, **kwargs: Any) -> _models.DocumentStatus:
863+
def get_document_status(self, translation_id: str, document_id: str, **kwargs: Any) -> _models.DocumentStatus:
864864
"""Returns the status for a specific document.
865865
866866
Returns the translation status for a specific document based on the request Id
867867
and document Id.
868868
869-
:param id: Format - uuid. The batch id. Required.
870-
:type id: str
869+
:param translation_id: Format - uuid. The batch id. Required.
870+
:type translation_id: str
871871
:param document_id: Format - uuid. The document id. Required.
872872
:type document_id: str
873873
:return: DocumentStatus. The DocumentStatus is compatible with MutableMapping
@@ -915,7 +915,7 @@ def get_document_status(self, id: str, document_id: str, **kwargs: Any) -> _mode
915915
cls: ClsType[_models.DocumentStatus] = kwargs.pop("cls", None)
916916

917917
_request = build_document_translation_get_document_status_request(
918-
id=id,
918+
translation_id=translation_id,
919919
document_id=document_id,
920920
api_version=self._config.api_version,
921921
headers=_headers,
@@ -953,16 +953,16 @@ def get_document_status(self, id: str, document_id: str, **kwargs: Any) -> _mode
953953
return deserialized # type: ignore
954954

955955
@distributed_trace
956-
def get_translation_status(self, id: str, **kwargs: Any) -> _models.TranslationStatus:
956+
def get_translation_status(self, translation_id: str, **kwargs: Any) -> _models.TranslationStatus:
957957
"""Returns the status for a document translation request.
958958
959959
Returns the status for a document translation request.
960960
The status includes the
961961
overall request status, as well as the status for documents that are being
962962
translated as part of that request.
963963
964-
:param id: Format - uuid. The operation id. Required.
965-
:type id: str
964+
:param translation_id: Format - uuid. The operation id. Required.
965+
:type translation_id: str
966966
:return: TranslationStatus. The TranslationStatus is compatible with MutableMapping
967967
:rtype: ~azure.ai.translation.document.models.TranslationStatus
968968
:raises ~azure.core.exceptions.HttpResponseError:
@@ -1012,7 +1012,7 @@ def get_translation_status(self, id: str, **kwargs: Any) -> _models.TranslationS
10121012
cls: ClsType[_models.TranslationStatus] = kwargs.pop("cls", None)
10131013

10141014
_request = build_document_translation_get_translation_status_request(
1015-
id=id,
1015+
translation_id=translation_id,
10161016
api_version=self._config.api_version,
10171017
headers=_headers,
10181018
params=_params,
@@ -1049,7 +1049,7 @@ def get_translation_status(self, id: str, **kwargs: Any) -> _models.TranslationS
10491049
return deserialized # type: ignore
10501050

10511051
@distributed_trace
1052-
def cancel_translation(self, id: str, **kwargs: Any) -> _models.TranslationStatus:
1052+
def cancel_translation(self, translation_id: str, **kwargs: Any) -> _models.TranslationStatus:
10531053
"""Cancel a currently processing or queued translation.
10541054
10551055
Cancel a currently processing or queued translation.
@@ -1061,8 +1061,8 @@ def cancel_translation(self, id: str, **kwargs: Any) -> _models.TranslationStatu
10611061
All pending documents will be cancelled if
10621062
possible.
10631063
1064-
:param id: Format - uuid. The operation-id. Required.
1065-
:type id: str
1064+
:param translation_id: Format - uuid. The operation-id. Required.
1065+
:type translation_id: str
10661066
:return: TranslationStatus. The TranslationStatus is compatible with MutableMapping
10671067
:rtype: ~azure.ai.translation.document.models.TranslationStatus
10681068
:raises ~azure.core.exceptions.HttpResponseError:
@@ -1112,7 +1112,7 @@ def cancel_translation(self, id: str, **kwargs: Any) -> _models.TranslationStatu
11121112
cls: ClsType[_models.TranslationStatus] = kwargs.pop("cls", None)
11131113

11141114
_request = build_document_translation_cancel_translation_request(
1115-
id=id,
1115+
translation_id=translation_id,
11161116
api_version=self._config.api_version,
11171117
headers=_headers,
11181118
params=_params,
@@ -1151,7 +1151,7 @@ def cancel_translation(self, id: str, **kwargs: Any) -> _models.TranslationStatu
11511151
@distributed_trace
11521152
def list_document_statuses(
11531153
self,
1154-
id: str,
1154+
translation_id: str,
11551155
*,
11561156
top: Optional[int] = None,
11571157
skip: Optional[int] = None,
@@ -1209,8 +1209,8 @@ def list_document_statuses(
12091209
This reduces the risk of the client making assumptions about
12101210
the data returned.
12111211
1212-
:param id: Format - uuid. The operation id. Required.
1213-
:type id: str
1212+
:param translation_id: Format - uuid. The operation id. Required.
1213+
:type translation_id: str
12141214
:keyword top: top indicates the total number of records the user wants to be returned across
12151215
all pages.
12161216
@@ -1300,7 +1300,7 @@ def prepare_request(next_link=None):
13001300
if not next_link:
13011301

13021302
_request = build_document_translation_list_document_statuses_request(
1303-
id=id,
1303+
translation_id=translation_id,
13041304
top=top,
13051305
skip=skip,
13061306
maxpagesize=maxpagesize,

sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_patch.py

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,7 @@ def begin_translation(
295295
"""
296296

297297
@overload
298-
def begin_translation(
299-
self, inputs: JSON, **kwargs: Any
300-
) -> DocumentTranslationLROPoller[ItemPaged[DocumentStatus]]:
298+
def begin_translation(self, inputs: JSON, **kwargs: Any) -> DocumentTranslationLROPoller[ItemPaged[DocumentStatus]]:
301299
"""Begin translating the document(s) in your source container to your target container
302300
in the given language.
303301
@@ -371,7 +369,7 @@ def begin_translation(
371369
returned for each translation on a document.
372370
:rtype: DocumentTranslationLROPoller[~azure.core.paging.ItemPaged[DocumentStatus]]
373371
:raises ~azure.core.exceptions.HttpResponseError:
374-
"""
372+
"""
375373

376374
@overload
377375
def begin_translation(
@@ -484,39 +482,6 @@ def deserialization_callback(raw_response, _, headers): # pylint: disable=unuse
484482
),
485483
)
486484

487-
# pylint: disable=arguments-renamed
488-
@distributed_trace
489-
def get_translation_status(self, translation_id: str, **kwargs: Any) -> TranslationStatus: # type: ignore[override]
490-
"""Gets the status of the translation operation.
491-
492-
Includes the overall status, as well as a summary of
493-
the documents that are being translated as part of that translation operation.
494-
495-
:param str translation_id: The translation operation ID.
496-
:return: A TranslationStatus with information on the status of the translation operation.
497-
:rtype: ~azure.ai.translation.document.TranslationStatus
498-
:raises ~azure.core.exceptions.HttpResponseError or ~azure.core.exceptions.ResourceNotFoundError:
499-
"""
500-
501-
return super().get_translation_status(translation_id, **kwargs)
502-
503-
# pylint: disable=arguments-renamed
504-
@distributed_trace
505-
def cancel_translation(self, translation_id: str, **kwargs: Any) -> None: # type: ignore[override]
506-
"""Cancel a currently processing or queued translation operation.
507-
508-
A translation will not be canceled if it is already completed, failed, or canceling.
509-
All documents that have completed translation will not be canceled and will be charged.
510-
If possible, all pending documents will be canceled.
511-
512-
:param str translation_id: The translation operation ID.
513-
:return: None
514-
:rtype: None
515-
:raises ~azure.core.exceptions.HttpResponseError or ~azure.core.exceptions.ResourceNotFoundError:
516-
"""
517-
518-
super().cancel_translation(translation_id, **kwargs)
519-
520485
@distributed_trace
521486
def list_translation_statuses(
522487
self,
@@ -637,7 +602,7 @@ def list_document_statuses( # type: ignore[override]
637602
return cast(
638603
ItemPaged[DocumentStatus],
639604
super().list_document_statuses(
640-
id=translation_id,
605+
translation_id=translation_id,
641606
created_date_time_utc_start=created_after,
642607
created_date_time_utc_end=created_before,
643608
ids=document_ids,
@@ -649,22 +614,6 @@ def list_document_statuses( # type: ignore[override]
649614
),
650615
)
651616

652-
# pylint: disable=arguments-renamed
653-
@distributed_trace
654-
def get_document_status( # type: ignore[override]
655-
self, translation_id: str, document_id: str, **kwargs: Any
656-
) -> DocumentStatus:
657-
"""Get the status of an individual document within a translation operation.
658-
659-
:param str translation_id: The translation operation ID.
660-
:param str document_id: The ID for the document.
661-
:return: A DocumentStatus with information on the status of the document.
662-
:rtype: ~azure.ai.translation.document.DocumentStatus
663-
:raises ~azure.core.exceptions.HttpResponseError or ~azure.core.exceptions.ResourceNotFoundError:
664-
"""
665-
666-
return super().get_document_status(translation_id, document_id, **kwargs)
667-
668617
@distributed_trace
669618
def get_supported_glossary_formats(self, **kwargs: Any) -> List[DocumentTranslationFileFormat]:
670619
"""Get the list of the glossary formats supported by the Document Translation service.

sdk/translation/azure-ai-translation-document/azure/ai/translation/document/aio/_operations/_operations.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -615,14 +615,14 @@ async def get_next(next_link=None):
615615
return AsyncItemPaged(get_next, extract_data)
616616

617617
@distributed_trace_async
618-
async def get_document_status(self, id: str, document_id: str, **kwargs: Any) -> _models.DocumentStatus:
618+
async def get_document_status(self, translation_id: str, document_id: str, **kwargs: Any) -> _models.DocumentStatus:
619619
"""Returns the status for a specific document.
620620
621621
Returns the translation status for a specific document based on the request Id
622622
and document Id.
623623
624-
:param id: Format - uuid. The batch id. Required.
625-
:type id: str
624+
:param translation_id: Format - uuid. The batch id. Required.
625+
:type translation_id: str
626626
:param document_id: Format - uuid. The document id. Required.
627627
:type document_id: str
628628
:return: DocumentStatus. The DocumentStatus is compatible with MutableMapping
@@ -670,7 +670,7 @@ async def get_document_status(self, id: str, document_id: str, **kwargs: Any) ->
670670
cls: ClsType[_models.DocumentStatus] = kwargs.pop("cls", None)
671671

672672
_request = build_document_translation_get_document_status_request(
673-
id=id,
673+
translation_id=translation_id,
674674
document_id=document_id,
675675
api_version=self._config.api_version,
676676
headers=_headers,
@@ -708,16 +708,16 @@ async def get_document_status(self, id: str, document_id: str, **kwargs: Any) ->
708708
return deserialized # type: ignore
709709

710710
@distributed_trace_async
711-
async def get_translation_status(self, id: str, **kwargs: Any) -> _models.TranslationStatus:
711+
async def get_translation_status(self, translation_id: str, **kwargs: Any) -> _models.TranslationStatus:
712712
"""Returns the status for a document translation request.
713713
714714
Returns the status for a document translation request.
715715
The status includes the
716716
overall request status, as well as the status for documents that are being
717717
translated as part of that request.
718718
719-
:param id: Format - uuid. The operation id. Required.
720-
:type id: str
719+
:param translation_id: Format - uuid. The operation id. Required.
720+
:type translation_id: str
721721
:return: TranslationStatus. The TranslationStatus is compatible with MutableMapping
722722
:rtype: ~azure.ai.translation.document.models.TranslationStatus
723723
:raises ~azure.core.exceptions.HttpResponseError:
@@ -767,7 +767,7 @@ async def get_translation_status(self, id: str, **kwargs: Any) -> _models.Transl
767767
cls: ClsType[_models.TranslationStatus] = kwargs.pop("cls", None)
768768

769769
_request = build_document_translation_get_translation_status_request(
770-
id=id,
770+
translation_id=translation_id,
771771
api_version=self._config.api_version,
772772
headers=_headers,
773773
params=_params,
@@ -804,7 +804,7 @@ async def get_translation_status(self, id: str, **kwargs: Any) -> _models.Transl
804804
return deserialized # type: ignore
805805

806806
@distributed_trace_async
807-
async def cancel_translation(self, id: str, **kwargs: Any) -> _models.TranslationStatus:
807+
async def cancel_translation(self, translation_id: str, **kwargs: Any) -> _models.TranslationStatus:
808808
"""Cancel a currently processing or queued translation.
809809
810810
Cancel a currently processing or queued translation.
@@ -816,8 +816,8 @@ async def cancel_translation(self, id: str, **kwargs: Any) -> _models.Translatio
816816
All pending documents will be cancelled if
817817
possible.
818818
819-
:param id: Format - uuid. The operation-id. Required.
820-
:type id: str
819+
:param translation_id: Format - uuid. The operation-id. Required.
820+
:type translation_id: str
821821
:return: TranslationStatus. The TranslationStatus is compatible with MutableMapping
822822
:rtype: ~azure.ai.translation.document.models.TranslationStatus
823823
:raises ~azure.core.exceptions.HttpResponseError:
@@ -867,7 +867,7 @@ async def cancel_translation(self, id: str, **kwargs: Any) -> _models.Translatio
867867
cls: ClsType[_models.TranslationStatus] = kwargs.pop("cls", None)
868868

869869
_request = build_document_translation_cancel_translation_request(
870-
id=id,
870+
translation_id=translation_id,
871871
api_version=self._config.api_version,
872872
headers=_headers,
873873
params=_params,
@@ -906,7 +906,7 @@ async def cancel_translation(self, id: str, **kwargs: Any) -> _models.Translatio
906906
@distributed_trace
907907
def list_document_statuses(
908908
self,
909-
id: str,
909+
translation_id: str,
910910
*,
911911
top: Optional[int] = None,
912912
skip: Optional[int] = None,
@@ -964,8 +964,8 @@ def list_document_statuses(
964964
This reduces the risk of the client making assumptions about
965965
the data returned.
966966
967-
:param id: Format - uuid. The operation id. Required.
968-
:type id: str
967+
:param translation_id: Format - uuid. The operation id. Required.
968+
:type translation_id: str
969969
:keyword top: top indicates the total number of records the user wants to be returned across
970970
all pages.
971971
@@ -1056,7 +1056,7 @@ def prepare_request(next_link=None):
10561056
if not next_link:
10571057

10581058
_request = build_document_translation_list_document_statuses_request(
1059-
id=id,
1059+
translation_id=translation_id,
10601060
top=top,
10611061
skip=skip,
10621062
maxpagesize=maxpagesize,

0 commit comments

Comments
 (0)