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
1113from azure .mgmt .core import ARMPipelineClient
1214from 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+
1420if 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