Skip to content

Commit c6ce066

Browse files
author
SDKAuto
committed
CodeGen from PR 21890 in Azure/azure-rest-api-specs
Merge 737c81cf81755ac305a3457e735323a7eeeb2954 into f012b6bceb90be88947c3f8a21dab9c78b0b4a6d
1 parent c45589e commit c6ce066

File tree

488 files changed

+164957
-114982
lines changed

Some content is hidden

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

488 files changed

+164957
-114982
lines changed
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
2-
"autorest": "3.3.0",
3-
"use": "@autorest/[email protected]",
4-
"commit": "cc247b28bd6dc94786fb18e691d6331a168985f6",
2+
"commit": "6b5f7fbe9fe34d788b76b154400c2912bb94df89",
53
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
6-
"autorest_command": "autorest specification/databoxedge/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --version=3.3.0",
4+
"autorest": "3.9.2",
5+
"use": [
6+
"@autorest/[email protected]",
7+
"@autorest/[email protected]"
8+
],
9+
"autorest_command": "autorest specification/databoxedge/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",
710
"readme": "specification/databoxedge/resource-manager/readme.md"
811
}

sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/__init__.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,20 @@
77
# --------------------------------------------------------------------------
88

99
from ._data_box_edge_management_client import DataBoxEdgeManagementClient
10-
__all__ = ['DataBoxEdgeManagementClient']
10+
from ._version import VERSION
11+
12+
__version__ = VERSION
1113

1214
try:
13-
from ._patch import patch_sdk # type: ignore
14-
patch_sdk()
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # pylint: disable=unused-wildcard-import
1517
except ImportError:
16-
pass
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = [
22+
"DataBoxEdgeManagementClient",
23+
]
24+
__all__.extend([p for p in _patch_all if p not in __all__])
25+
26+
_patch_sdk()

sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_configuration.py

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

9-
from typing import TYPE_CHECKING
9+
import sys
10+
from typing import Any, TYPE_CHECKING
1011

1112
from azure.core.configuration import Configuration
1213
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
15+
16+
from ._version import VERSION
17+
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
1422

1523
if TYPE_CHECKING:
1624
# pylint: disable=unused-import,ungrouped-imports
17-
from typing import Any
18-
1925
from azure.core.credentials import TokenCredential
2026

21-
VERSION = "unknown"
2227

23-
class DataBoxEdgeManagementClientConfiguration(Configuration):
28+
class DataBoxEdgeManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2429
"""Configuration for DataBoxEdgeManagementClient.
2530
2631
Note that all parameters used to create this instance are saved as instance
2732
attributes.
2833
29-
:param credential: Credential needed for the client to connect to Azure.
34+
:param credential: Credential needed for the client to connect to Azure. Required.
3035
:type credential: ~azure.core.credentials.TokenCredential
31-
:param subscription_id: The subscription ID.
36+
:param subscription_id: The subscription ID. Required.
3237
:type subscription_id: str
38+
:keyword api_version: Api Version. Default value is "2020-12-01". Note that overriding this
39+
default value may result in unsupported behavior.
40+
:paramtype api_version: str
3341
"""
3442

35-
def __init__(
36-
self,
37-
credential, # type: "TokenCredential"
38-
subscription_id, # type: str
39-
**kwargs # type: Any
40-
):
41-
# type: (...) -> None
43+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
44+
super(DataBoxEdgeManagementClientConfiguration, self).__init__(**kwargs)
45+
api_version: Literal["2020-12-01"] = kwargs.pop("api_version", "2020-12-01")
46+
4247
if credential is None:
4348
raise ValueError("Parameter 'credential' must not be None.")
4449
if subscription_id is None:
4550
raise ValueError("Parameter 'subscription_id' must not be None.")
46-
super(DataBoxEdgeManagementClientConfiguration, self).__init__(**kwargs)
4751

4852
self.credential = credential
4953
self.subscription_id = subscription_id
50-
self.api_version = "2020-12-01"
51-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
52-
kwargs.setdefault('sdk_moniker', 'mgmt-databoxedge/{}'.format(VERSION))
54+
self.api_version = api_version
55+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
56+
kwargs.setdefault("sdk_moniker", "mgmt-databoxedge/{}".format(VERSION))
5357
self._configure(**kwargs)
5458

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

0 commit comments

Comments
 (0)