Skip to content

Commit 1cf031e

Browse files
author
SDKAuto
committed
CodeGen from PR 22545 in Azure/azure-rest-api-specs
Merge 19e169f03fd1108fe3381760c7da3f2844071860 into 18e0a756cd948b08cec7d4264f2dbbbfa53246ac
1 parent 23dbd6e commit 1cf031e

File tree

374 files changed

+135367
-29369
lines changed

Some content is hidden

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

374 files changed

+135367
-29369
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"commit": "5770c558d9dd293617884206686440222c46ee49",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
5+
"use": [
6+
"@autorest/python@6.4.0",
7+
"@autorest/modelerfour@4.24.3"
8+
],
9+
"autorest_command": "autorest specification/databox/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.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
10+
"readme": "specification/databox/resource-manager/readme.md"
11+
}

sdk/databox/azure-mgmt-databox/azure/mgmt/databox/__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/databox/azure-mgmt-databox/azure/mgmt/databox/_configuration.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,36 @@
88
# Changes may cause incorrect behavior and will be lost if the code is
99
# regenerated.
1010
# --------------------------------------------------------------------------
11-
from typing import Any
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

19+
if TYPE_CHECKING:
20+
# pylint: disable=unused-import,ungrouped-imports
21+
from azure.core.credentials import TokenCredential
1922

2023
class DataBoxManagementClientConfiguration(Configuration):
2124
"""Configuration for DataBoxManagementClient.
2225
2326
Note that all parameters used to create this instance are saved as instance
2427
attributes.
2528
26-
:param credential: Credential needed for the client to connect to Azure.
29+
:param credential: Credential needed for the client to connect to Azure. Required.
2730
:type credential: ~azure.core.credentials.TokenCredential
28-
:param subscription_id: The Subscription Id.
31+
:param subscription_id: The Subscription Id. Required.
2932
:type subscription_id: str
3033
"""
3134

3235
def __init__(
3336
self,
34-
credential, # type: "TokenCredential"
35-
subscription_id, # type: str
36-
**kwargs # type: Any
37+
credential: "TokenCredential",
38+
subscription_id: str,
39+
**kwargs: Any
3740
):
38-
# type: (...) -> None
3941
if credential is None:
4042
raise ValueError("Parameter 'credential' must not be None.")
4143
if subscription_id is None:
@@ -50,9 +52,8 @@ def __init__(
5052

5153
def _configure(
5254
self,
53-
**kwargs # type: Any
55+
**kwargs: Any
5456
):
55-
# type: (...) -> None
5657
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
5758
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
5859
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
@@ -63,4 +64,4 @@ def _configure(
6364
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6465
self.authentication_policy = kwargs.get('authentication_policy')
6566
if self.credential and not self.authentication_policy:
66-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
67+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_data_box_management_client.py

Lines changed: 130 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,19 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from azure.mgmt.core import ARMPipelineClient
13-
from msrest import Serializer, Deserializer
12+
from typing import Any, Optional, TYPE_CHECKING
1413

14+
from azure.mgmt.core import ARMPipelineClient
1515
from azure.profiles import KnownProfiles, ProfileDefinition
1616
from azure.profiles.multiapiclient import MultiApiClientMixin
17+
1718
from ._configuration import DataBoxManagementClientConfiguration
19+
from ._operations_mixin import DataBoxManagementClientOperationsMixin
20+
from ._serialization import Deserializer, Serializer
21+
22+
if TYPE_CHECKING:
23+
# pylint: disable=unused-import,ungrouped-imports
24+
from azure.core.credentials import TokenCredential
1825

1926
class _SDKClient(object):
2027
def __init__(self, *args, **kwargs):
@@ -23,7 +30,7 @@ def __init__(self, *args, **kwargs):
2330
"""
2431
pass
2532

26-
class DataBoxManagementClient(MultiApiClientMixin, _SDKClient):
33+
class DataBoxManagementClient(DataBoxManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient):
2734
"""The DataBox Client.
2835
2936
This ready contains multiple API versions, to help you deal with all of the Azure clouds
@@ -34,19 +41,20 @@ class DataBoxManagementClient(MultiApiClientMixin, _SDKClient):
3441
The api-version parameter sets the default API version if the operation
3542
group is not described in the profile.
3643
37-
:param credential: Credential needed for the client to connect to Azure.
44+
:param credential: Credential needed for the client to connect to Azure. Required.
3845
:type credential: ~azure.core.credentials.TokenCredential
39-
:param subscription_id: The Subscription Id.
46+
:param subscription_id: The Subscription Id. Required.
4047
:type subscription_id: str
41-
:param str api_version: API version to use if no profile is provided, or if
42-
missing in profile.
43-
:param str base_url: Service URL
48+
:param api_version: API version to use if no profile is provided, or if missing in profile.
49+
:type api_version: str
50+
:param base_url: Service URL
51+
:type base_url: str
4452
:param profile: A profile definition, from KnownProfiles to dict.
4553
:type profile: azure.profiles.KnownProfiles
4654
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
4755
"""
4856

49-
DEFAULT_API_VERSION = '2020-11-01'
57+
DEFAULT_API_VERSION = '2022-12-01'
5058
_PROFILE_TAG = "azure.mgmt.databox.DataBoxManagementClient"
5159
LATEST_PROFILE = ProfileDefinition({
5260
_PROFILE_TAG: {
@@ -57,15 +65,13 @@ class DataBoxManagementClient(MultiApiClientMixin, _SDKClient):
5765

5866
def __init__(
5967
self,
60-
credential, # type: "TokenCredential"
61-
subscription_id, # type: str
62-
api_version=None,
63-
base_url=None,
64-
profile=KnownProfiles.default,
65-
**kwargs # type: Any
68+
credential: "TokenCredential",
69+
subscription_id: str,
70+
api_version: Optional[str]=None,
71+
base_url: str = "https://management.azure.com",
72+
profile: KnownProfiles=KnownProfiles.default,
73+
**kwargs: Any
6674
):
67-
if not base_url:
68-
base_url = 'https://management.azure.com'
6975
self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs)
7076
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
7177
super(DataBoxManagementClient, self).__init__(
@@ -85,6 +91,14 @@ def models(cls, api_version=DEFAULT_API_VERSION):
8591
* 2019-09-01: :mod:`v2019_09_01.models<azure.mgmt.databox.v2019_09_01.models>`
8692
* 2020-04-01: :mod:`v2020_04_01.models<azure.mgmt.databox.v2020_04_01.models>`
8793
* 2020-11-01: :mod:`v2020_11_01.models<azure.mgmt.databox.v2020_11_01.models>`
94+
* 2021-03-01: :mod:`v2021_03_01.models<azure.mgmt.databox.v2021_03_01.models>`
95+
* 2021-05-01: :mod:`v2021_05_01.models<azure.mgmt.databox.v2021_05_01.models>`
96+
* 2021-08-01-preview: :mod:`v2021_08_01_preview.models<azure.mgmt.databox.v2021_08_01_preview.models>`
97+
* 2021-12-01: :mod:`v2021_12_01.models<azure.mgmt.databox.v2021_12_01.models>`
98+
* 2022-02-01: :mod:`v2022_02_01.models<azure.mgmt.databox.v2022_02_01.models>`
99+
* 2022-09-01: :mod:`v2022_09_01.models<azure.mgmt.databox.v2022_09_01.models>`
100+
* 2022-10-01: :mod:`v2022_10_01.models<azure.mgmt.databox.v2022_10_01.models>`
101+
* 2022-12-01: :mod:`v2022_12_01.models<azure.mgmt.databox.v2022_12_01.models>`
88102
"""
89103
if api_version == '2018-01-01':
90104
from .v2018_01_01 import models
@@ -98,6 +112,30 @@ def models(cls, api_version=DEFAULT_API_VERSION):
98112
elif api_version == '2020-11-01':
99113
from .v2020_11_01 import models
100114
return models
115+
elif api_version == '2021-03-01':
116+
from .v2021_03_01 import models
117+
return models
118+
elif api_version == '2021-05-01':
119+
from .v2021_05_01 import models
120+
return models
121+
elif api_version == '2021-08-01-preview':
122+
from .v2021_08_01_preview import models
123+
return models
124+
elif api_version == '2021-12-01':
125+
from .v2021_12_01 import models
126+
return models
127+
elif api_version == '2022-02-01':
128+
from .v2022_02_01 import models
129+
return models
130+
elif api_version == '2022-09-01':
131+
from .v2022_09_01 import models
132+
return models
133+
elif api_version == '2022-10-01':
134+
from .v2022_10_01 import models
135+
return models
136+
elif api_version == '2022-12-01':
137+
from .v2022_12_01 import models
138+
return models
101139
raise ValueError("API version {} is not available".format(api_version))
102140

103141
@property
@@ -108,6 +146,14 @@ def jobs(self):
108146
* 2019-09-01: :class:`JobsOperations<azure.mgmt.databox.v2019_09_01.operations.JobsOperations>`
109147
* 2020-04-01: :class:`JobsOperations<azure.mgmt.databox.v2020_04_01.operations.JobsOperations>`
110148
* 2020-11-01: :class:`JobsOperations<azure.mgmt.databox.v2020_11_01.operations.JobsOperations>`
149+
* 2021-03-01: :class:`JobsOperations<azure.mgmt.databox.v2021_03_01.operations.JobsOperations>`
150+
* 2021-05-01: :class:`JobsOperations<azure.mgmt.databox.v2021_05_01.operations.JobsOperations>`
151+
* 2021-08-01-preview: :class:`JobsOperations<azure.mgmt.databox.v2021_08_01_preview.operations.JobsOperations>`
152+
* 2021-12-01: :class:`JobsOperations<azure.mgmt.databox.v2021_12_01.operations.JobsOperations>`
153+
* 2022-02-01: :class:`JobsOperations<azure.mgmt.databox.v2022_02_01.operations.JobsOperations>`
154+
* 2022-09-01: :class:`JobsOperations<azure.mgmt.databox.v2022_09_01.operations.JobsOperations>`
155+
* 2022-10-01: :class:`JobsOperations<azure.mgmt.databox.v2022_10_01.operations.JobsOperations>`
156+
* 2022-12-01: :class:`JobsOperations<azure.mgmt.databox.v2022_12_01.operations.JobsOperations>`
111157
"""
112158
api_version = self._get_api_version('jobs')
113159
if api_version == '2018-01-01':
@@ -118,8 +164,25 @@ def jobs(self):
118164
from .v2020_04_01.operations import JobsOperations as OperationClass
119165
elif api_version == '2020-11-01':
120166
from .v2020_11_01.operations import JobsOperations as OperationClass
167+
elif api_version == '2021-03-01':
168+
from .v2021_03_01.operations import JobsOperations as OperationClass
169+
elif api_version == '2021-05-01':
170+
from .v2021_05_01.operations import JobsOperations as OperationClass
171+
elif api_version == '2021-08-01-preview':
172+
from .v2021_08_01_preview.operations import JobsOperations as OperationClass
173+
elif api_version == '2021-12-01':
174+
from .v2021_12_01.operations import JobsOperations as OperationClass
175+
elif api_version == '2022-02-01':
176+
from .v2022_02_01.operations import JobsOperations as OperationClass
177+
elif api_version == '2022-09-01':
178+
from .v2022_09_01.operations import JobsOperations as OperationClass
179+
elif api_version == '2022-10-01':
180+
from .v2022_10_01.operations import JobsOperations as OperationClass
181+
elif api_version == '2022-12-01':
182+
from .v2022_12_01.operations import JobsOperations as OperationClass
121183
else:
122184
raise ValueError("API version {} does not have operation group 'jobs'".format(api_version))
185+
self._config.api_version = api_version
123186
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
124187

125188
@property
@@ -130,6 +193,14 @@ def operations(self):
130193
* 2019-09-01: :class:`Operations<azure.mgmt.databox.v2019_09_01.operations.Operations>`
131194
* 2020-04-01: :class:`Operations<azure.mgmt.databox.v2020_04_01.operations.Operations>`
132195
* 2020-11-01: :class:`Operations<azure.mgmt.databox.v2020_11_01.operations.Operations>`
196+
* 2021-03-01: :class:`Operations<azure.mgmt.databox.v2021_03_01.operations.Operations>`
197+
* 2021-05-01: :class:`Operations<azure.mgmt.databox.v2021_05_01.operations.Operations>`
198+
* 2021-08-01-preview: :class:`Operations<azure.mgmt.databox.v2021_08_01_preview.operations.Operations>`
199+
* 2021-12-01: :class:`Operations<azure.mgmt.databox.v2021_12_01.operations.Operations>`
200+
* 2022-02-01: :class:`Operations<azure.mgmt.databox.v2022_02_01.operations.Operations>`
201+
* 2022-09-01: :class:`Operations<azure.mgmt.databox.v2022_09_01.operations.Operations>`
202+
* 2022-10-01: :class:`Operations<azure.mgmt.databox.v2022_10_01.operations.Operations>`
203+
* 2022-12-01: :class:`Operations<azure.mgmt.databox.v2022_12_01.operations.Operations>`
133204
"""
134205
api_version = self._get_api_version('operations')
135206
if api_version == '2018-01-01':
@@ -140,8 +211,25 @@ def operations(self):
140211
from .v2020_04_01.operations import Operations as OperationClass
141212
elif api_version == '2020-11-01':
142213
from .v2020_11_01.operations import Operations as OperationClass
214+
elif api_version == '2021-03-01':
215+
from .v2021_03_01.operations import Operations as OperationClass
216+
elif api_version == '2021-05-01':
217+
from .v2021_05_01.operations import Operations as OperationClass
218+
elif api_version == '2021-08-01-preview':
219+
from .v2021_08_01_preview.operations import Operations as OperationClass
220+
elif api_version == '2021-12-01':
221+
from .v2021_12_01.operations import Operations as OperationClass
222+
elif api_version == '2022-02-01':
223+
from .v2022_02_01.operations import Operations as OperationClass
224+
elif api_version == '2022-09-01':
225+
from .v2022_09_01.operations import Operations as OperationClass
226+
elif api_version == '2022-10-01':
227+
from .v2022_10_01.operations import Operations as OperationClass
228+
elif api_version == '2022-12-01':
229+
from .v2022_12_01.operations import Operations as OperationClass
143230
else:
144231
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
232+
self._config.api_version = api_version
145233
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
146234

147235
@property
@@ -152,6 +240,14 @@ def service(self):
152240
* 2019-09-01: :class:`ServiceOperations<azure.mgmt.databox.v2019_09_01.operations.ServiceOperations>`
153241
* 2020-04-01: :class:`ServiceOperations<azure.mgmt.databox.v2020_04_01.operations.ServiceOperations>`
154242
* 2020-11-01: :class:`ServiceOperations<azure.mgmt.databox.v2020_11_01.operations.ServiceOperations>`
243+
* 2021-03-01: :class:`ServiceOperations<azure.mgmt.databox.v2021_03_01.operations.ServiceOperations>`
244+
* 2021-05-01: :class:`ServiceOperations<azure.mgmt.databox.v2021_05_01.operations.ServiceOperations>`
245+
* 2021-08-01-preview: :class:`ServiceOperations<azure.mgmt.databox.v2021_08_01_preview.operations.ServiceOperations>`
246+
* 2021-12-01: :class:`ServiceOperations<azure.mgmt.databox.v2021_12_01.operations.ServiceOperations>`
247+
* 2022-02-01: :class:`ServiceOperations<azure.mgmt.databox.v2022_02_01.operations.ServiceOperations>`
248+
* 2022-09-01: :class:`ServiceOperations<azure.mgmt.databox.v2022_09_01.operations.ServiceOperations>`
249+
* 2022-10-01: :class:`ServiceOperations<azure.mgmt.databox.v2022_10_01.operations.ServiceOperations>`
250+
* 2022-12-01: :class:`ServiceOperations<azure.mgmt.databox.v2022_12_01.operations.ServiceOperations>`
155251
"""
156252
api_version = self._get_api_version('service')
157253
if api_version == '2018-01-01':
@@ -162,8 +258,25 @@ def service(self):
162258
from .v2020_04_01.operations import ServiceOperations as OperationClass
163259
elif api_version == '2020-11-01':
164260
from .v2020_11_01.operations import ServiceOperations as OperationClass
261+
elif api_version == '2021-03-01':
262+
from .v2021_03_01.operations import ServiceOperations as OperationClass
263+
elif api_version == '2021-05-01':
264+
from .v2021_05_01.operations import ServiceOperations as OperationClass
265+
elif api_version == '2021-08-01-preview':
266+
from .v2021_08_01_preview.operations import ServiceOperations as OperationClass
267+
elif api_version == '2021-12-01':
268+
from .v2021_12_01.operations import ServiceOperations as OperationClass
269+
elif api_version == '2022-02-01':
270+
from .v2022_02_01.operations import ServiceOperations as OperationClass
271+
elif api_version == '2022-09-01':
272+
from .v2022_09_01.operations import ServiceOperations as OperationClass
273+
elif api_version == '2022-10-01':
274+
from .v2022_10_01.operations import ServiceOperations as OperationClass
275+
elif api_version == '2022-12-01':
276+
from .v2022_12_01.operations import ServiceOperations as OperationClass
165277
else:
166278
raise ValueError("API version {} does not have operation group 'service'".format(api_version))
279+
self._config.api_version = api_version
167280
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
168281

169282
def close(self):

0 commit comments

Comments
 (0)