Skip to content

Commit 01636bf

Browse files
author
SDKAuto
committed
CodeGen from PR 21286 in Azure/azure-rest-api-specs
Merge 1c63627d0f3fa2658e98c5c12cb05fe69ff7f7b3 into 7f67f12515a8d572569c4257aebed850240598b9
1 parent 902e0eb commit 01636bf

34 files changed

+4137
-1761
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.4.2",
2+
"commit": "cb7528924787b0a2058886666cb773c6c9c3a809",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@5.8.1",
5-
"@autorest/modelerfour@4.19.2"
6+
"@autorest/python@6.2.1",
7+
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "8816b8568ee46dae94967bfadb97e19301604667",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/resourcehealth/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/python@5.8.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2",
9+
"autorest_command": "autorest specification/resourcehealth/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.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/resourcehealth/resource-manager/readme.md"
1111
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414
patch_sdk()
1515
except ImportError:
1616
pass
17+
18+
from ._version import VERSION
19+
20+
__version__ = VERSION

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@
88
# Changes may cause incorrect behavior and will be lost if the code is
99
# regenerated.
1010
# --------------------------------------------------------------------------
11-
from typing import TYPE_CHECKING
11+
from typing import Any, TYPE_CHECKING
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
15-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
15+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1616

1717
from ._version import VERSION
1818

1919
if TYPE_CHECKING:
2020
# pylint: disable=unused-import,ungrouped-imports
21-
from typing import Any
22-
2321
from azure.core.credentials import TokenCredential
2422

2523
class MicrosoftResourceHealthConfiguration(Configuration):
@@ -28,16 +26,16 @@ class MicrosoftResourceHealthConfiguration(Configuration):
2826
Note that all parameters used to create this instance are saved as instance
2927
attributes.
3028
31-
:param credential: Credential needed for the client to connect to Azure.
29+
:param credential: Credential needed for the client to connect to Azure. Required.
3230
:type credential: ~azure.core.credentials.TokenCredential
33-
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
31+
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.
3432
:type subscription_id: str
3533
"""
3634

3735
def __init__(
3836
self,
39-
credential, # type: "TokenCredential"
40-
subscription_id, # type: str
37+
credential: "TokenCredential",
38+
subscription_id: str,
4139
**kwargs # type: Any
4240
):
4341
# type: (...) -> None
@@ -68,4 +66,4 @@ def _configure(
6866
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6967
self.authentication_policy = kwargs.get('authentication_policy')
7068
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
69+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/_microsoft_resource_health.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,18 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from typing import TYPE_CHECKING
12+
from typing import Any, Optional, TYPE_CHECKING
1313

1414
from azure.mgmt.core import ARMPipelineClient
1515
from azure.profiles import KnownProfiles, ProfileDefinition
1616
from azure.profiles.multiapiclient import MultiApiClientMixin
17-
from msrest import Deserializer, Serializer
1817

1918
from ._configuration import MicrosoftResourceHealthConfiguration
19+
from ._serialization import Deserializer, Serializer
2020

2121
if TYPE_CHECKING:
2222
# pylint: disable=unused-import,ungrouped-imports
23-
from typing import Any, Optional
24-
2523
from azure.core.credentials import TokenCredential
26-
from azure.core.pipeline.transport import HttpRequest, HttpResponse
2724

2825
class _SDKClient(object):
2926
def __init__(self, *args, **kwargs):
@@ -43,9 +40,9 @@ class MicrosoftResourceHealth(MultiApiClientMixin, _SDKClient):
4340
The api-version parameter sets the default API version if the operation
4441
group is not described in the profile.
4542
46-
:param credential: Credential needed for the client to connect to Azure.
43+
:param credential: Credential needed for the client to connect to Azure. Required.
4744
:type credential: ~azure.core.credentials.TokenCredential
48-
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
45+
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.
4946
:type subscription_id: str
5047
:param api_version: API version to use if no profile is provided, or if missing in profile.
5148
:type api_version: str
@@ -66,15 +63,13 @@ class MicrosoftResourceHealth(MultiApiClientMixin, _SDKClient):
6663

6764
def __init__(
6865
self,
69-
credential, # type: "TokenCredential"
70-
subscription_id, # type: str
66+
credential: "TokenCredential",
67+
subscription_id: str,
7168
api_version=None, # type: Optional[str]
72-
base_url=None, # type: Optional[str]
69+
base_url: str = "https://management.azure.com",
7370
profile=KnownProfiles.default, # type: KnownProfiles
7471
**kwargs # type: Any
7572
):
76-
if not base_url:
77-
base_url = 'https://management.azure.com'
7873
self._config = MicrosoftResourceHealthConfiguration(credential, subscription_id, **kwargs)
7974
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
8075
super(MicrosoftResourceHealth, self).__init__(
@@ -108,6 +103,7 @@ def availability_statuses(self):
108103
from .v2015_01_01.operations import AvailabilityStatusesOperations as OperationClass
109104
else:
110105
raise ValueError("API version {} does not have operation group 'availability_statuses'".format(api_version))
106+
self._config.api_version = api_version
111107
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
112108

113109
@property
@@ -121,6 +117,7 @@ def child_availability_statuses(self):
121117
from .v2015_01_01.operations import ChildAvailabilityStatusesOperations as OperationClass
122118
else:
123119
raise ValueError("API version {} does not have operation group 'child_availability_statuses'".format(api_version))
120+
self._config.api_version = api_version
124121
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
125122

126123
@property
@@ -134,6 +131,7 @@ def child_resources(self):
134131
from .v2015_01_01.operations import ChildResourcesOperations as OperationClass
135132
else:
136133
raise ValueError("API version {} does not have operation group 'child_resources'".format(api_version))
134+
self._config.api_version = api_version
137135
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
138136

139137
@property
@@ -147,6 +145,7 @@ def operations(self):
147145
from .v2015_01_01.operations import Operations as OperationClass
148146
else:
149147
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
148+
self._config.api_version = api_version
150149
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
151150

152151
def close(self):

0 commit comments

Comments
 (0)