6
6
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
# --------------------------------------------------------------------------
8
8
9
- from typing import TYPE_CHECKING
9
+ from copy import deepcopy
10
+ from typing import Any , Optional , TYPE_CHECKING
10
11
12
+ from azure .core .rest import HttpRequest , HttpResponse
11
13
from azure .mgmt .core import ARMPipelineClient
12
14
from msrest import Deserializer , Serializer
13
15
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
+
14
20
if TYPE_CHECKING :
15
21
# pylint: disable=unused-import,ungrouped-imports
16
- from typing import Any , Optional
17
-
18
22
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
-
42
23
43
- class DataBoxEdgeManagementClient ( object ) :
24
+ class DataBoxEdgeManagementClient :
44
25
"""The DataBoxEdge Client.
45
26
46
27
:ivar operations: Operations operations
@@ -52,27 +33,32 @@ class DataBoxEdgeManagementClient(object):
52
33
:ivar alerts: AlertsOperations operations
53
34
:vartype alerts: azure.mgmt.databoxedge.v2020_12_01.operations.AlertsOperations
54
35
: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
56
38
:ivar jobs: JobsOperations operations
57
39
:vartype jobs: azure.mgmt.databoxedge.v2020_12_01.operations.JobsOperations
58
40
:ivar nodes: NodesOperations operations
59
41
:vartype nodes: azure.mgmt.databoxedge.v2020_12_01.operations.NodesOperations
60
42
: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
62
45
:ivar orders: OrdersOperations operations
63
46
:vartype orders: azure.mgmt.databoxedge.v2020_12_01.operations.OrdersOperations
64
47
:ivar roles: RolesOperations operations
65
48
:vartype roles: azure.mgmt.databoxedge.v2020_12_01.operations.RolesOperations
66
49
:ivar addons: AddonsOperations operations
67
50
:vartype addons: azure.mgmt.databoxedge.v2020_12_01.operations.AddonsOperations
68
51
: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
70
54
:ivar shares: SharesOperations operations
71
55
:vartype shares: azure.mgmt.databoxedge.v2020_12_01.operations.SharesOperations
72
56
: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
74
59
: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
76
62
:ivar containers: ContainersOperations operations
77
63
:vartype containers: azure.mgmt.databoxedge.v2020_12_01.operations.ContainersOperations
78
64
:ivar triggers: TriggersOperations operations
@@ -83,82 +69,71 @@ class DataBoxEdgeManagementClient(object):
83
69
:type credential: ~azure.core.credentials.TokenCredential
84
70
:param subscription_id: The subscription ID.
85
71
: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.
88
76
"""
89
77
90
78
def __init__ (
91
79
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 )
101
86
self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
102
87
103
88
client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
104
89
self ._serialize = Serializer (client_models )
105
- self ._serialize .client_side_validation = False
106
90
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 :
147
117
"""Runs the network request through the client's chained policies.
148
118
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.
152
130
: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
154
132
"""
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 )
162
137
163
138
def close (self ):
164
139
# type: () -> None
0 commit comments