Skip to content

Commit bad1fa9

Browse files
author
SDKAuto
committed
CodeGen from PR 19870 in Azure/azure-rest-api-specs
Merge 07ecbe547740e6ec7ecd7fd285e9cf4a93c33982 into 505bb06f3bf66661d0170e9dcd8c1c053d9cdbec
1 parent f9d2bc0 commit bad1fa9

34 files changed

+4697
-2195
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.7.2",
2+
"autorest": "3.8.4",
33
"use": [
4-
"@autorest/python@5.12.0",
5-
"@autorest/modelerfour@4.19.3"
4+
"@autorest/python@6.0.1",
5+
"@autorest/modelerfour@4.23.5"
66
],
7-
"commit": "1b0a465061c68175898f8f5d27f0301f42ce994c",
7+
"commit": "8c5a67d031b48e7e8f9c9c322e8c7ecf689dfbf7",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/subscription/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
9+
"autorest_command": "autorest specification/subscription/resource-manager/readme.md --models-mode=msrest --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.0.1 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False",
1010
"readme": "specification/subscription/resource-manager/readme.md"
1111
}

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13-
__all__ = ['SubscriptionClient']
1413

15-
# `._patch.py` is used for handwritten extensions to the generated code
16-
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17-
from ._patch import patch_sdk
18-
patch_sdk()
14+
try:
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
17+
except ImportError:
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = ["SubscriptionClient"]
22+
__all__.extend([p for p in _patch_all if p not in __all__])
23+
24+
_patch_sdk()

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

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,43 +19,40 @@
1919
from azure.core.credentials import TokenCredential
2020

2121

22-
class SubscriptionClientConfiguration(Configuration):
22+
class SubscriptionClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2323
"""Configuration for SubscriptionClient.
2424
2525
Note that all parameters used to create this instance are saved as instance
2626
attributes.
2727
28-
:param credential: Credential needed for the client to connect to Azure.
28+
:param credential: Credential needed for the client to connect to Azure. Required.
2929
:type credential: ~azure.core.credentials.TokenCredential
3030
"""
3131

32-
def __init__(
33-
self,
34-
credential: "TokenCredential",
35-
**kwargs: Any
36-
) -> None:
32+
def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None:
3733
super(SubscriptionClientConfiguration, self).__init__(**kwargs)
3834
if credential is None:
3935
raise ValueError("Parameter 'credential' must not be None.")
4036

4137
self.credential = credential
42-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
43-
kwargs.setdefault('sdk_moniker', 'mgmt-subscription/{}'.format(VERSION))
38+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
39+
kwargs.setdefault("sdk_moniker", "mgmt-subscription/{}".format(VERSION))
4440
self._configure(**kwargs)
4541

4642
def _configure(
47-
self,
48-
**kwargs # type: Any
43+
self, **kwargs # type: Any
4944
):
5045
# type: (...) -> None
51-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
52-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
53-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
54-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
55-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
56-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
57-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
58-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
59-
self.authentication_policy = kwargs.get('authentication_policy')
46+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
47+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
48+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
49+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
50+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
51+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
52+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
53+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
54+
self.authentication_policy = kwargs.get("authentication_policy")
6055
if self.credential and not self.authentication_policy:
61-
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
56+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
57+
self.credential, *self.credential_scopes, **kwargs
58+
)

sdk/subscription/azure-mgmt-subscription/azure/mgmt/subscription/_patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
# This file is used for handwritten extensions to the generated code. Example:
2929
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3030
def patch_sdk():
31-
pass
31+
pass

0 commit comments

Comments
 (0)