Skip to content

Commit 4bcb65f

Browse files
author
SDKAuto
committed
CodeGen from PR 21060 in Azure/azure-rest-api-specs
Merge 03ef5ef267d66b2ee39522643a8664b44f107f5d into ae227e20bcb22d83634452026f701d75bec2619e
1 parent cece86a commit 4bcb65f

File tree

259 files changed

+90924
-29134
lines changed

Some content is hidden

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

259 files changed

+90924
-29134
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"autorest": "3.9.2",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "f2cc6d7fa00c8a58fc8f744cae1b3f9f7fc03f42",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/databox/resource-manager/readme.md --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",
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: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,34 @@
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
37+
credential: "TokenCredential",
38+
subscription_id: str,
3639
**kwargs # type: Any
3740
):
3841
# type: (...) -> None
@@ -63,4 +66,4 @@ def _configure(
6366
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6467
self.authentication_policy = kwargs.get('authentication_policy')
6568
if self.credential and not self.authentication_policy:
66-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
69+
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: 90 additions & 16 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-02-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,
68+
credential: "TokenCredential",
69+
subscription_id: str,
70+
api_version=None, # type: Optional[str]
71+
base_url: str = "https://management.azure.com",
72+
profile=KnownProfiles.default, # type: KnownProfiles
6573
**kwargs # type: 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,11 @@ 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>`
8899
"""
89100
if api_version == '2018-01-01':
90101
from .v2018_01_01 import models
@@ -98,6 +109,21 @@ def models(cls, api_version=DEFAULT_API_VERSION):
98109
elif api_version == '2020-11-01':
99110
from .v2020_11_01 import models
100111
return models
112+
elif api_version == '2021-03-01':
113+
from .v2021_03_01 import models
114+
return models
115+
elif api_version == '2021-05-01':
116+
from .v2021_05_01 import models
117+
return models
118+
elif api_version == '2021-08-01-preview':
119+
from .v2021_08_01_preview import models
120+
return models
121+
elif api_version == '2021-12-01':
122+
from .v2021_12_01 import models
123+
return models
124+
elif api_version == '2022-02-01':
125+
from .v2022_02_01 import models
126+
return models
101127
raise ValueError("API version {} is not available".format(api_version))
102128

103129
@property
@@ -108,6 +134,11 @@ def jobs(self):
108134
* 2019-09-01: :class:`JobsOperations<azure.mgmt.databox.v2019_09_01.operations.JobsOperations>`
109135
* 2020-04-01: :class:`JobsOperations<azure.mgmt.databox.v2020_04_01.operations.JobsOperations>`
110136
* 2020-11-01: :class:`JobsOperations<azure.mgmt.databox.v2020_11_01.operations.JobsOperations>`
137+
* 2021-03-01: :class:`JobsOperations<azure.mgmt.databox.v2021_03_01.operations.JobsOperations>`
138+
* 2021-05-01: :class:`JobsOperations<azure.mgmt.databox.v2021_05_01.operations.JobsOperations>`
139+
* 2021-08-01-preview: :class:`JobsOperations<azure.mgmt.databox.v2021_08_01_preview.operations.JobsOperations>`
140+
* 2021-12-01: :class:`JobsOperations<azure.mgmt.databox.v2021_12_01.operations.JobsOperations>`
141+
* 2022-02-01: :class:`JobsOperations<azure.mgmt.databox.v2022_02_01.operations.JobsOperations>`
111142
"""
112143
api_version = self._get_api_version('jobs')
113144
if api_version == '2018-01-01':
@@ -118,8 +149,19 @@ def jobs(self):
118149
from .v2020_04_01.operations import JobsOperations as OperationClass
119150
elif api_version == '2020-11-01':
120151
from .v2020_11_01.operations import JobsOperations as OperationClass
152+
elif api_version == '2021-03-01':
153+
from .v2021_03_01.operations import JobsOperations as OperationClass
154+
elif api_version == '2021-05-01':
155+
from .v2021_05_01.operations import JobsOperations as OperationClass
156+
elif api_version == '2021-08-01-preview':
157+
from .v2021_08_01_preview.operations import JobsOperations as OperationClass
158+
elif api_version == '2021-12-01':
159+
from .v2021_12_01.operations import JobsOperations as OperationClass
160+
elif api_version == '2022-02-01':
161+
from .v2022_02_01.operations import JobsOperations as OperationClass
121162
else:
122163
raise ValueError("API version {} does not have operation group 'jobs'".format(api_version))
164+
self._config.api_version = api_version
123165
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
124166

125167
@property
@@ -130,6 +172,11 @@ def operations(self):
130172
* 2019-09-01: :class:`Operations<azure.mgmt.databox.v2019_09_01.operations.Operations>`
131173
* 2020-04-01: :class:`Operations<azure.mgmt.databox.v2020_04_01.operations.Operations>`
132174
* 2020-11-01: :class:`Operations<azure.mgmt.databox.v2020_11_01.operations.Operations>`
175+
* 2021-03-01: :class:`Operations<azure.mgmt.databox.v2021_03_01.operations.Operations>`
176+
* 2021-05-01: :class:`Operations<azure.mgmt.databox.v2021_05_01.operations.Operations>`
177+
* 2021-08-01-preview: :class:`Operations<azure.mgmt.databox.v2021_08_01_preview.operations.Operations>`
178+
* 2021-12-01: :class:`Operations<azure.mgmt.databox.v2021_12_01.operations.Operations>`
179+
* 2022-02-01: :class:`Operations<azure.mgmt.databox.v2022_02_01.operations.Operations>`
133180
"""
134181
api_version = self._get_api_version('operations')
135182
if api_version == '2018-01-01':
@@ -140,8 +187,19 @@ def operations(self):
140187
from .v2020_04_01.operations import Operations as OperationClass
141188
elif api_version == '2020-11-01':
142189
from .v2020_11_01.operations import Operations as OperationClass
190+
elif api_version == '2021-03-01':
191+
from .v2021_03_01.operations import Operations as OperationClass
192+
elif api_version == '2021-05-01':
193+
from .v2021_05_01.operations import Operations as OperationClass
194+
elif api_version == '2021-08-01-preview':
195+
from .v2021_08_01_preview.operations import Operations as OperationClass
196+
elif api_version == '2021-12-01':
197+
from .v2021_12_01.operations import Operations as OperationClass
198+
elif api_version == '2022-02-01':
199+
from .v2022_02_01.operations import Operations as OperationClass
143200
else:
144201
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
202+
self._config.api_version = api_version
145203
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
146204

147205
@property
@@ -152,6 +210,11 @@ def service(self):
152210
* 2019-09-01: :class:`ServiceOperations<azure.mgmt.databox.v2019_09_01.operations.ServiceOperations>`
153211
* 2020-04-01: :class:`ServiceOperations<azure.mgmt.databox.v2020_04_01.operations.ServiceOperations>`
154212
* 2020-11-01: :class:`ServiceOperations<azure.mgmt.databox.v2020_11_01.operations.ServiceOperations>`
213+
* 2021-03-01: :class:`ServiceOperations<azure.mgmt.databox.v2021_03_01.operations.ServiceOperations>`
214+
* 2021-05-01: :class:`ServiceOperations<azure.mgmt.databox.v2021_05_01.operations.ServiceOperations>`
215+
* 2021-08-01-preview: :class:`ServiceOperations<azure.mgmt.databox.v2021_08_01_preview.operations.ServiceOperations>`
216+
* 2021-12-01: :class:`ServiceOperations<azure.mgmt.databox.v2021_12_01.operations.ServiceOperations>`
217+
* 2022-02-01: :class:`ServiceOperations<azure.mgmt.databox.v2022_02_01.operations.ServiceOperations>`
155218
"""
156219
api_version = self._get_api_version('service')
157220
if api_version == '2018-01-01':
@@ -162,8 +225,19 @@ def service(self):
162225
from .v2020_04_01.operations import ServiceOperations as OperationClass
163226
elif api_version == '2020-11-01':
164227
from .v2020_11_01.operations import ServiceOperations as OperationClass
228+
elif api_version == '2021-03-01':
229+
from .v2021_03_01.operations import ServiceOperations as OperationClass
230+
elif api_version == '2021-05-01':
231+
from .v2021_05_01.operations import ServiceOperations as OperationClass
232+
elif api_version == '2021-08-01-preview':
233+
from .v2021_08_01_preview.operations import ServiceOperations as OperationClass
234+
elif api_version == '2021-12-01':
235+
from .v2021_12_01.operations import ServiceOperations as OperationClass
236+
elif api_version == '2022-02-01':
237+
from .v2022_02_01.operations import ServiceOperations as OperationClass
165238
else:
166239
raise ValueError("API version {} does not have operation group 'service'".format(api_version))
240+
self._config.api_version = api_version
167241
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
168242

169243
def close(self):
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
from ._serialization import Serializer, Deserializer
12+
from typing import Any, IO, Optional, Union
13+
14+
from . import models as _models
15+
16+
17+
class DataBoxManagementClientOperationsMixin(object):
18+
19+
def mitigate( # pylint: disable=inconsistent-return-statements
20+
self,
21+
job_name: str,
22+
resource_group_name: str,
23+
mitigate_job_request: Union[_models.MitigateJobRequest, IO],
24+
**kwargs: Any
25+
) -> None:
26+
"""Request to mitigate for a given job.
27+
28+
:param job_name: The name of the job Resource within the specified resource group. job names
29+
must be between 3 and 24 characters in length and use any alphanumeric and underscore only.
30+
Required.
31+
:type job_name: str
32+
:param resource_group_name: The Resource Group Name. Required.
33+
:type resource_group_name: str
34+
:param mitigate_job_request: Mitigation Request. Is either a model type or a IO type. Required.
35+
:type mitigate_job_request: ~azure.mgmt.databox.v2022_02_01.models.MitigateJobRequest or IO
36+
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
37+
Default value is None.
38+
:paramtype content_type: str
39+
:keyword callable cls: A custom type or function that will be passed the direct response
40+
:return: None or the result of cls(response)
41+
:rtype: None
42+
:raises ~azure.core.exceptions.HttpResponseError:
43+
"""
44+
api_version = self._get_api_version('mitigate')
45+
if api_version == '2021-03-01':
46+
from .v2021_03_01.operations import DataBoxManagementClientOperationsMixin as OperationClass
47+
elif api_version == '2021-05-01':
48+
from .v2021_05_01.operations import DataBoxManagementClientOperationsMixin as OperationClass
49+
elif api_version == '2021-08-01-preview':
50+
from .v2021_08_01_preview.operations import DataBoxManagementClientOperationsMixin as OperationClass
51+
elif api_version == '2021-12-01':
52+
from .v2021_12_01.operations import DataBoxManagementClientOperationsMixin as OperationClass
53+
elif api_version == '2022-02-01':
54+
from .v2022_02_01.operations import DataBoxManagementClientOperationsMixin as OperationClass
55+
else:
56+
raise ValueError("API version {} does not have operation 'mitigate'".format(api_version))
57+
mixin_instance = OperationClass()
58+
mixin_instance._client = self._client
59+
mixin_instance._config = self._config
60+
mixin_instance._config.api_version = api_version
61+
mixin_instance._serialize = Serializer(self._models_dict(api_version))
62+
mixin_instance._serialize.client_side_validation = False
63+
mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
64+
return mixin_instance.mitigate(job_name, resource_group_name, mitigate_job_request, **kwargs)

0 commit comments

Comments
 (0)