Skip to content

Commit ec3a8ca

Browse files
author
SDKAuto
committed
CodeGen from PR 21408 in Azure/azure-rest-api-specs
Merge 23e2337a0979ad4dacc8e6ae5b8760d74e74fe48 into b32e1896f30e6ea155449cb49719a6286e32b961
1 parent 9b0417f commit ec3a8ca

35 files changed

+4387
-1666
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.7.2",
2+
"commit": "d52bcb92db97a5209cd7251ca7ae70d0b211447c",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@5.13.0",
5-
"@autorest/modelerfour@4.19.3"
6+
"@autorest/python@6.2.7",
7+
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "0cc5e2efd6ffccf30e80d1e150b488dd87198b94",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/servicelinker/resource-manager/readme.md --multiapi --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.7.2",
9+
"autorest_command": "autorest specification/servicelinker/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/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/servicelinker/resource-manager/readme.md"
1111
}

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

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

1212
__version__ = VERSION
13-
__all__ = ['ServiceLinkerManagementClient']
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 * # pylint: disable=unused-wildcard-import
17+
except ImportError:
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = [
22+
"ServiceLinkerManagementClient",
23+
]
24+
__all__.extend([p for p in _patch_all if p not in __all__])
25+
26+
_patch_sdk()

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

Lines changed: 24 additions & 24 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
@@ -25,43 +31,37 @@ class ServiceLinkerManagementClientConfiguration(Configuration): # pylint: disa
2531
Note that all parameters used to create this instance are saved as instance
2632
attributes.
2733
28-
:param credential: Credential needed for the client to connect to Azure.
34+
:param credential: Credential needed for the client to connect to Azure. Required.
2935
:type credential: ~azure.core.credentials.TokenCredential
3036
:keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this
3137
default value may result in unsupported behavior.
3238
:paramtype api_version: str
3339
"""
3440

35-
def __init__(
36-
self,
37-
credential: "TokenCredential",
38-
**kwargs: Any
39-
) -> None:
41+
def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None:
4042
super(ServiceLinkerManagementClientConfiguration, self).__init__(**kwargs)
41-
api_version = kwargs.pop('api_version', "2022-05-01") # type: str
43+
api_version: Literal["2022-05-01"] = kwargs.pop("api_version", "2022-05-01")
4244

4345
if credential is None:
4446
raise ValueError("Parameter 'credential' must not be None.")
4547

4648
self.credential = credential
4749
self.api_version = api_version
48-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
49-
kwargs.setdefault('sdk_moniker', 'mgmt-servicelinker/{}'.format(VERSION))
50+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
51+
kwargs.setdefault("sdk_moniker", "mgmt-servicelinker/{}".format(VERSION))
5052
self._configure(**kwargs)
5153

52-
def _configure(
53-
self,
54-
**kwargs # type: Any
55-
):
56-
# type: (...) -> None
57-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
58-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
59-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
60-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
61-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
62-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
63-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
64-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
65-
self.authentication_policy = kwargs.get('authentication_policy')
54+
def _configure(self, **kwargs: Any) -> None:
55+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
56+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
57+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
58+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
59+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
61+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
62+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
63+
self.authentication_policy = kwargs.get("authentication_policy")
6664
if self.credential and not self.authentication_policy:
67-
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
65+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
66+
self.credential, *self.credential_scopes, **kwargs
67+
)

sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_metadata.json

Lines changed: 0 additions & 91 deletions
This file was deleted.

sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_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)