Skip to content

Commit bda6713

Browse files
author
SDKAuto
committed
CodeGen from PR 18529 in Azure/azure-rest-api-specs
Merge 73ae3929d818288c4d551484dcce2dbc89b2a77f into 4ed2eef2469a38feb5d1d755d094f66854ea3013
1 parent 8445817 commit bda6713

File tree

442 files changed

+80252
-69898
lines changed

Some content is hidden

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

442 files changed

+80252
-69898
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+
"autorest": "3.7.2",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "13000aa19d23af4facb0c5dbd802916d4b1c801d",
58
"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/python@5.6.6 --version=3.3.0",
9+
"autorest_command": "autorest specification/databoxedge/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.12.0 --use=@autorest/[email protected] --version=3.7.2",
710
"readme": "specification/databoxedge/resource-manager/readme.md"
811
}

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

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

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

12-
try:
13-
from ._patch import patch_sdk # type: ignore
14-
patch_sdk()
15-
except ImportError:
16-
pass
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()

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

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

9-
from typing import TYPE_CHECKING
9+
from typing import Any, TYPE_CHECKING
1010

1111
from azure.core.configuration import Configuration
1212
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
13+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
14+
15+
from ._version import VERSION
1416

1517
if TYPE_CHECKING:
1618
# pylint: disable=unused-import,ungrouped-imports
17-
from typing import Any
18-
1919
from azure.core.credentials import TokenCredential
2020

21-
VERSION = "unknown"
2221

2322
class DataBoxEdgeManagementClientConfiguration(Configuration):
2423
"""Configuration for DataBoxEdgeManagementClient.
@@ -34,16 +33,15 @@ class DataBoxEdgeManagementClientConfiguration(Configuration):
3433

3534
def __init__(
3635
self,
37-
credential, # type: "TokenCredential"
38-
subscription_id, # type: str
39-
**kwargs # type: Any
40-
):
41-
# type: (...) -> None
36+
credential: "TokenCredential",
37+
subscription_id: str,
38+
**kwargs: Any
39+
) -> None:
40+
super(DataBoxEdgeManagementClientConfiguration, self).__init__(**kwargs)
4241
if credential is None:
4342
raise ValueError("Parameter 'credential' must not be None.")
4443
if subscription_id is None:
4544
raise ValueError("Parameter 'subscription_id' must not be None.")
46-
super(DataBoxEdgeManagementClientConfiguration, self).__init__(**kwargs)
4745

4846
self.credential = credential
4947
self.subscription_id = subscription_id
@@ -67,4 +65,4 @@ def _configure(
6765
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6866
self.authentication_policy = kwargs.get('authentication_policy')
6967
if self.credential and not self.authentication_policy:
70-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
68+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

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

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

9-
from typing import TYPE_CHECKING
9+
from copy import deepcopy
10+
from typing import Any, Optional, TYPE_CHECKING
1011

12+
from azure.core.rest import HttpRequest, HttpResponse
1113
from azure.mgmt.core import ARMPipelineClient
1214
from msrest import Deserializer, Serializer
1315

16+
from . import models
17+
from ._configuration import DataBoxEdgeManagementClientConfiguration
18+
from .operations import AddonsOperations, AlertsOperations, AvailableSkusOperations, BandwidthSchedulesOperations, ContainersOperations, DevicesOperations, JobsOperations, MonitoringConfigOperations, NodesOperations, Operations, OperationsStatusOperations, OrdersOperations, RolesOperations, SharesOperations, StorageAccountCredentialsOperations, StorageAccountsOperations, TriggersOperations, UsersOperations
19+
1420
if TYPE_CHECKING:
1521
# pylint: disable=unused-import,ungrouped-imports
16-
from typing import Any, Optional
17-
1822
from azure.core.credentials import TokenCredential
19-
from azure.core.pipeline.transport import HttpRequest, HttpResponse
20-
21-
from ._configuration import DataBoxEdgeManagementClientConfiguration
22-
from .operations import Operations
23-
from .operations import AvailableSkusOperations
24-
from .operations import DevicesOperations
25-
from .operations import AlertsOperations
26-
from .operations import BandwidthSchedulesOperations
27-
from .operations import JobsOperations
28-
from .operations import NodesOperations
29-
from .operations import OperationsStatusOperations
30-
from .operations import OrdersOperations
31-
from .operations import RolesOperations
32-
from .operations import AddonsOperations
33-
from .operations import MonitoringConfigOperations
34-
from .operations import SharesOperations
35-
from .operations import StorageAccountCredentialsOperations
36-
from .operations import StorageAccountsOperations
37-
from .operations import ContainersOperations
38-
from .operations import TriggersOperations
39-
from .operations import UsersOperations
40-
from . import models
41-
4223

43-
class DataBoxEdgeManagementClient(object):
24+
class DataBoxEdgeManagementClient:
4425
"""The DataBoxEdge Client.
4526
4627
:ivar operations: Operations operations
@@ -52,27 +33,32 @@ class DataBoxEdgeManagementClient(object):
5233
:ivar alerts: AlertsOperations operations
5334
:vartype alerts: azure.mgmt.databoxedge.v2020_12_01.operations.AlertsOperations
5435
:ivar bandwidth_schedules: BandwidthSchedulesOperations operations
55-
:vartype bandwidth_schedules: azure.mgmt.databoxedge.v2020_12_01.operations.BandwidthSchedulesOperations
36+
:vartype bandwidth_schedules:
37+
azure.mgmt.databoxedge.v2020_12_01.operations.BandwidthSchedulesOperations
5638
:ivar jobs: JobsOperations operations
5739
:vartype jobs: azure.mgmt.databoxedge.v2020_12_01.operations.JobsOperations
5840
:ivar nodes: NodesOperations operations
5941
:vartype nodes: azure.mgmt.databoxedge.v2020_12_01.operations.NodesOperations
6042
:ivar operations_status: OperationsStatusOperations operations
61-
:vartype operations_status: azure.mgmt.databoxedge.v2020_12_01.operations.OperationsStatusOperations
43+
:vartype operations_status:
44+
azure.mgmt.databoxedge.v2020_12_01.operations.OperationsStatusOperations
6245
:ivar orders: OrdersOperations operations
6346
:vartype orders: azure.mgmt.databoxedge.v2020_12_01.operations.OrdersOperations
6447
:ivar roles: RolesOperations operations
6548
:vartype roles: azure.mgmt.databoxedge.v2020_12_01.operations.RolesOperations
6649
:ivar addons: AddonsOperations operations
6750
:vartype addons: azure.mgmt.databoxedge.v2020_12_01.operations.AddonsOperations
6851
:ivar monitoring_config: MonitoringConfigOperations operations
69-
:vartype monitoring_config: azure.mgmt.databoxedge.v2020_12_01.operations.MonitoringConfigOperations
52+
:vartype monitoring_config:
53+
azure.mgmt.databoxedge.v2020_12_01.operations.MonitoringConfigOperations
7054
:ivar shares: SharesOperations operations
7155
:vartype shares: azure.mgmt.databoxedge.v2020_12_01.operations.SharesOperations
7256
:ivar storage_account_credentials: StorageAccountCredentialsOperations operations
73-
:vartype storage_account_credentials: azure.mgmt.databoxedge.v2020_12_01.operations.StorageAccountCredentialsOperations
57+
:vartype storage_account_credentials:
58+
azure.mgmt.databoxedge.v2020_12_01.operations.StorageAccountCredentialsOperations
7459
:ivar storage_accounts: StorageAccountsOperations operations
75-
:vartype storage_accounts: azure.mgmt.databoxedge.v2020_12_01.operations.StorageAccountsOperations
60+
:vartype storage_accounts:
61+
azure.mgmt.databoxedge.v2020_12_01.operations.StorageAccountsOperations
7662
:ivar containers: ContainersOperations operations
7763
:vartype containers: azure.mgmt.databoxedge.v2020_12_01.operations.ContainersOperations
7864
:ivar triggers: TriggersOperations operations
@@ -83,82 +69,71 @@ class DataBoxEdgeManagementClient(object):
8369
:type credential: ~azure.core.credentials.TokenCredential
8470
:param subscription_id: The subscription ID.
8571
:type subscription_id: str
86-
:param str base_url: Service URL
87-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
72+
:param base_url: Service URL. Default value is 'https://management.azure.com'.
73+
:type base_url: str
74+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
75+
Retry-After header is present.
8876
"""
8977

9078
def __init__(
9179
self,
92-
credential, # type: "TokenCredential"
93-
subscription_id, # type: str
94-
base_url=None, # type: Optional[str]
95-
**kwargs # type: Any
96-
):
97-
# type: (...) -> None
98-
if not base_url:
99-
base_url = 'https://management.azure.com'
100-
self._config = DataBoxEdgeManagementClientConfiguration(credential, subscription_id, **kwargs)
80+
credential: "TokenCredential",
81+
subscription_id: str,
82+
base_url: str = "https://management.azure.com",
83+
**kwargs: Any
84+
) -> None:
85+
self._config = DataBoxEdgeManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
10186
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
10287

10388
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
10489
self._serialize = Serializer(client_models)
105-
self._serialize.client_side_validation = False
10690
self._deserialize = Deserializer(client_models)
107-
108-
self.operations = Operations(
109-
self._client, self._config, self._serialize, self._deserialize)
110-
self.available_skus = AvailableSkusOperations(
111-
self._client, self._config, self._serialize, self._deserialize)
112-
self.devices = DevicesOperations(
113-
self._client, self._config, self._serialize, self._deserialize)
114-
self.alerts = AlertsOperations(
115-
self._client, self._config, self._serialize, self._deserialize)
116-
self.bandwidth_schedules = BandwidthSchedulesOperations(
117-
self._client, self._config, self._serialize, self._deserialize)
118-
self.jobs = JobsOperations(
119-
self._client, self._config, self._serialize, self._deserialize)
120-
self.nodes = NodesOperations(
121-
self._client, self._config, self._serialize, self._deserialize)
122-
self.operations_status = OperationsStatusOperations(
123-
self._client, self._config, self._serialize, self._deserialize)
124-
self.orders = OrdersOperations(
125-
self._client, self._config, self._serialize, self._deserialize)
126-
self.roles = RolesOperations(
127-
self._client, self._config, self._serialize, self._deserialize)
128-
self.addons = AddonsOperations(
129-
self._client, self._config, self._serialize, self._deserialize)
130-
self.monitoring_config = MonitoringConfigOperations(
131-
self._client, self._config, self._serialize, self._deserialize)
132-
self.shares = SharesOperations(
133-
self._client, self._config, self._serialize, self._deserialize)
134-
self.storage_account_credentials = StorageAccountCredentialsOperations(
135-
self._client, self._config, self._serialize, self._deserialize)
136-
self.storage_accounts = StorageAccountsOperations(
137-
self._client, self._config, self._serialize, self._deserialize)
138-
self.containers = ContainersOperations(
139-
self._client, self._config, self._serialize, self._deserialize)
140-
self.triggers = TriggersOperations(
141-
self._client, self._config, self._serialize, self._deserialize)
142-
self.users = UsersOperations(
143-
self._client, self._config, self._serialize, self._deserialize)
144-
145-
def _send_request(self, http_request, **kwargs):
146-
# type: (HttpRequest, Any) -> HttpResponse
91+
self._serialize.client_side_validation = False
92+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
93+
self.available_skus = AvailableSkusOperations(self._client, self._config, self._serialize, self._deserialize)
94+
self.devices = DevicesOperations(self._client, self._config, self._serialize, self._deserialize)
95+
self.alerts = AlertsOperations(self._client, self._config, self._serialize, self._deserialize)
96+
self.bandwidth_schedules = BandwidthSchedulesOperations(self._client, self._config, self._serialize, self._deserialize)
97+
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
98+
self.nodes = NodesOperations(self._client, self._config, self._serialize, self._deserialize)
99+
self.operations_status = OperationsStatusOperations(self._client, self._config, self._serialize, self._deserialize)
100+
self.orders = OrdersOperations(self._client, self._config, self._serialize, self._deserialize)
101+
self.roles = RolesOperations(self._client, self._config, self._serialize, self._deserialize)
102+
self.addons = AddonsOperations(self._client, self._config, self._serialize, self._deserialize)
103+
self.monitoring_config = MonitoringConfigOperations(self._client, self._config, self._serialize, self._deserialize)
104+
self.shares = SharesOperations(self._client, self._config, self._serialize, self._deserialize)
105+
self.storage_account_credentials = StorageAccountCredentialsOperations(self._client, self._config, self._serialize, self._deserialize)
106+
self.storage_accounts = StorageAccountsOperations(self._client, self._config, self._serialize, self._deserialize)
107+
self.containers = ContainersOperations(self._client, self._config, self._serialize, self._deserialize)
108+
self.triggers = TriggersOperations(self._client, self._config, self._serialize, self._deserialize)
109+
self.users = UsersOperations(self._client, self._config, self._serialize, self._deserialize)
110+
111+
112+
def _send_request(
113+
self,
114+
request, # type: HttpRequest
115+
**kwargs: Any
116+
) -> HttpResponse:
147117
"""Runs the network request through the client's chained policies.
148118
149-
:param http_request: The network request you want to make. Required.
150-
:type http_request: ~azure.core.pipeline.transport.HttpRequest
151-
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
119+
>>> from azure.core.rest import HttpRequest
120+
>>> request = HttpRequest("GET", "https://www.example.org/")
121+
<HttpRequest [GET], url: 'https://www.example.org/'>
122+
>>> response = client._send_request(request)
123+
<HttpResponse: 200 OK>
124+
125+
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
126+
127+
:param request: The network request you want to make. Required.
128+
:type request: ~azure.core.rest.HttpRequest
129+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
152130
:return: The response of your network call. Does not do error handling on your response.
153-
:rtype: ~azure.core.pipeline.transport.HttpResponse
131+
:rtype: ~azure.core.rest.HttpResponse
154132
"""
155-
path_format_arguments = {
156-
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
157-
}
158-
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
159-
stream = kwargs.pop("stream", True)
160-
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
161-
return pipeline_response.http_response
133+
134+
request_copy = deepcopy(request)
135+
request_copy.url = self._client.format_url(request_copy.url)
136+
return self._client.send_request(request_copy, **kwargs)
162137

163138
def close(self):
164139
# type: () -> None

0 commit comments

Comments
 (0)