Skip to content

Commit 9d47c61

Browse files
author
SDKAuto
committed
CodeGen from PR 3537 in test-repo-billy/azure-rest-api-specs
Merge 6296b8e5c14516850f6b39a7fee10b2f0db170a5 into 6c6e1713f03acaf37e5c89652b023dd2c9eae16e
1 parent b2b0c35 commit 9d47c61

File tree

24 files changed

+1335
-4020
lines changed

24 files changed

+1335
-4020
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "c29452397f8d29456182b951987a765d1ae01bb1",
3+
"repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs",
4+
"typespec_src": "specification/translation/Azure.AI.DocumentTranslation",
5+
"@azure-tools/typespec-python": "0.31.1"
6+
}

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

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,23 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from ._patch import DocumentTranslationClient
9+
from ._client import DocumentTranslationClient
1010
from ._client import SingleDocumentTranslationClient
1111
from ._version import VERSION
1212

1313
__version__ = VERSION
1414

15-
16-
from ._patch import DocumentTranslationApiVersion
17-
from ._patch import DocumentTranslationLROPoller
18-
from ._patch import TranslationGlossary
19-
from ._patch import TranslationTarget
20-
from ._patch import DocumentTranslationInput
21-
from ._patch import TranslationStatus
22-
from ._patch import DocumentStatus
23-
from ._patch import DocumentTranslationError
24-
from ._patch import DocumentTranslationFileFormat
25-
from ._patch import StorageInputType
15+
try:
16+
from ._patch import __all__ as _patch_all
17+
from ._patch import * # pylint: disable=unused-wildcard-import
18+
except ImportError:
19+
_patch_all = []
2620
from ._patch import patch_sdk as _patch_sdk
2721

2822
__all__ = [
29-
"DocumentTranslationApiVersion",
30-
"DocumentTranslationLROPoller",
31-
"TranslationGlossary",
32-
"TranslationTarget",
33-
"DocumentTranslationInput",
34-
"TranslationStatus",
35-
"DocumentStatus",
36-
"DocumentTranslationError",
37-
"DocumentTranslationFileFormat",
38-
"StorageInputType",
3923
"DocumentTranslationClient",
4024
"SingleDocumentTranslationClient",
4125
]
42-
26+
__all__.extend([p for p in _patch_all if p not in __all__])
4327

4428
_patch_sdk()

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING, Union
11+
from typing_extensions import Self
1112

1213
from azure.core import PipelineClient
1314
from azure.core.credentials import AzureKeyCredential
@@ -97,7 +98,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
9798
def close(self) -> None:
9899
self._client.close()
99100

100-
def __enter__(self) -> "DocumentTranslationClient":
101+
def __enter__(self) -> Self:
101102
self._client.__enter__()
102103
return self
103104

@@ -177,7 +178,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
177178
def close(self) -> None:
178179
self._client.close()
179180

180-
def __enter__(self) -> "SingleDocumentTranslationClient":
181+
def __enter__(self) -> Self:
181182
self._client.__enter__()
182183
return self
183184

0 commit comments

Comments
 (0)