Skip to content

Commit 0d88194

Browse files
author
SDKAuto
committed
CodeGen from PR 21716 in Azure/azure-rest-api-specs
Merge 284d7fdfe30979590d777b648a389428a48f4d93 into 038922fd638b28f04ad706a916b486f8392c7cef
1 parent fa9f040 commit 0d88194

File tree

76 files changed

+6470
-840
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+6470
-840
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2+
"commit": "8835b30846e95518c5b8e7c276ffc94fd13fe567",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
24
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@6.1.11",
6+
"@autorest/python@6.2.7",
57
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "f3312d0962e91b065f287e44f5ae76db038fcd87",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/cognitiveservices/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.1.11 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/cognitiveservices/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/cognitiveservices/resource-manager/readme.md"
1111
}

sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313

1414
try:
1515
from ._patch import __all__ as _patch_all
16-
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
16+
from ._patch import * # pylint: disable=unused-wildcard-import
1717
except ImportError:
1818
_patch_all = []
1919
from ._patch import patch_sdk as _patch_sdk
2020

21-
__all__ = ["CognitiveServicesManagementClient"]
21+
__all__ = [
22+
"CognitiveServicesManagementClient",
23+
]
2224
__all__.extend([p for p in _patch_all if p not in __all__])
2325

2426
_patch_sdk()

sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_cognitive_services_management_client.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from azure.core.rest import HttpRequest, HttpResponse
1313
from azure.mgmt.core import ARMPipelineClient
1414

15-
from . import models
15+
from . import models as _models
1616
from ._configuration import CognitiveServicesManagementClientConfiguration
1717
from ._serialization import Deserializer, Serializer
1818
from .operations import (
@@ -64,7 +64,7 @@ class CognitiveServicesManagementClient(
6464
:type subscription_id: str
6565
:param base_url: Service URL. Default value is "https://management.azure.com".
6666
:type base_url: str
67-
:keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this
67+
:keyword api_version: Api Version. Default value is "2022-12-01". Note that overriding this
6868
default value may result in unsupported behavior.
6969
:paramtype api_version: str
7070
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -83,7 +83,7 @@ def __init__(
8383
)
8484
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
8585

86-
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
86+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
8787
self._serialize = Serializer(client_models)
8888
self._deserialize = Deserializer(client_models)
8989
self._serialize.client_side_validation = False
@@ -129,15 +129,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
129129
request_copy.url = self._client.format_url(request_copy.url)
130130
return self._client.send_request(request_copy, **kwargs)
131131

132-
def close(self):
133-
# type: () -> None
132+
def close(self) -> None:
134133
self._client.close()
135134

136-
def __enter__(self):
137-
# type: () -> CognitiveServicesManagementClient
135+
def __enter__(self) -> "CognitiveServicesManagementClient":
138136
self._client.__enter__()
139137
return self
140138

141-
def __exit__(self, *exc_details):
142-
# type: (Any) -> None
139+
def __exit__(self, *exc_details) -> None:
143140
self._client.__exit__(*exc_details)

sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_configuration.py

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

9+
import sys
910
from typing import Any, TYPE_CHECKING
1011

1112
from azure.core.configuration import Configuration
@@ -14,6 +15,11 @@
1415

1516
from ._version import VERSION
1617

18+
if sys.version_info >= (3, 8):
19+
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20+
else:
21+
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22+
1723
if TYPE_CHECKING:
1824
# pylint: disable=unused-import,ungrouped-imports
1925
from azure.core.credentials import TokenCredential
@@ -29,14 +35,14 @@ class CognitiveServicesManagementClientConfiguration(Configuration): # pylint:
2935
:type credential: ~azure.core.credentials.TokenCredential
3036
:param subscription_id: The ID of the target subscription. Required.
3137
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this
38+
:keyword api_version: Api Version. Default value is "2022-12-01". Note that overriding this
3339
default value may result in unsupported behavior.
3440
:paramtype api_version: str
3541
"""
3642

3743
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
3844
super(CognitiveServicesManagementClientConfiguration, self).__init__(**kwargs)
39-
api_version = kwargs.pop("api_version", "2022-10-01") # type: str
45+
api_version: Literal["2022-12-01"] = kwargs.pop("api_version", "2022-12-01")
4046

4147
if credential is None:
4248
raise ValueError("Parameter 'credential' must not be None.")
@@ -50,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
5056
kwargs.setdefault("sdk_moniker", "mgmt-cognitiveservices/{}".format(VERSION))
5157
self._configure(**kwargs)
5258

53-
def _configure(
54-
self, **kwargs # type: Any
55-
):
56-
# type: (...) -> None
59+
def _configure(self, **kwargs: Any) -> None:
5760
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
5861
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
5962
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)

0 commit comments

Comments
 (0)