66# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77# --------------------------------------------------------------------------
88
9+ from copy import deepcopy
910from typing import TYPE_CHECKING
1011
1112from azure .mgmt .core import ARMPipelineClient
1213from msrest import Deserializer , Serializer
1314
15+ from . import models
16+ from ._configuration import DeviceUpdateConfiguration
17+ from .operations import AccountsOperations , DeviceUpdateOperationsMixin , InstancesOperations , Operations , PrivateEndpointConnectionProxiesOperations , PrivateEndpointConnectionsOperations , PrivateLinkResourcesOperations
18+
1419if TYPE_CHECKING :
1520 # pylint: disable=unused-import,ungrouped-imports
1621 from typing import Any , Optional
1722
1823 from azure .core .credentials import TokenCredential
19- from azure .core .pipeline .transport import HttpRequest , HttpResponse
20-
21- from ._configuration import DeviceUpdateConfiguration
22- from .operations import DeviceUpdateOperationsMixin
23- from .operations import AccountsOperations
24- from .operations import InstancesOperations
25- from .operations import PrivateEndpointConnectionsOperations
26- from .operations import PrivateLinkResourcesOperations
27- from .operations import Operations
28- from . import models
29-
24+ from azure .core .rest import HttpRequest , HttpResponse
3025
3126class DeviceUpdate (DeviceUpdateOperationsMixin ):
3227 """Microsoft Device Update resource provider.
@@ -36,65 +31,75 @@ class DeviceUpdate(DeviceUpdateOperationsMixin):
3631 :ivar instances: InstancesOperations operations
3732 :vartype instances: device_update.operations.InstancesOperations
3833 :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
39- :vartype private_endpoint_connections: device_update.operations.PrivateEndpointConnectionsOperations
34+ :vartype private_endpoint_connections:
35+ device_update.operations.PrivateEndpointConnectionsOperations
4036 :ivar private_link_resources: PrivateLinkResourcesOperations operations
4137 :vartype private_link_resources: device_update.operations.PrivateLinkResourcesOperations
38+ :ivar private_endpoint_connection_proxies: PrivateEndpointConnectionProxiesOperations
39+ operations
40+ :vartype private_endpoint_connection_proxies:
41+ device_update.operations.PrivateEndpointConnectionProxiesOperations
4242 :ivar operations: Operations operations
4343 :vartype operations: device_update.operations.Operations
4444 :param credential: Credential needed for the client to connect to Azure.
4545 :type credential: ~azure.core.credentials.TokenCredential
4646 :param subscription_id: The Azure subscription ID.
4747 :type subscription_id: str
48- :param str base_url: Service URL
49- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
48+ :param base_url: Service URL. Default value is 'https://management.azure.com'.
49+ :type base_url: str
50+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
51+ Retry-After header is present.
5052 """
5153
5254 def __init__ (
5355 self ,
5456 credential , # type: "TokenCredential"
5557 subscription_id , # type: str
56- base_url = None , # type: Optional[ str]
58+ base_url = "https://management.azure.com" , # type: str
5759 ** kwargs # type: Any
5860 ):
5961 # type: (...) -> None
60- if not base_url :
61- base_url = 'https://management.azure.com'
62- self ._config = DeviceUpdateConfiguration (credential , subscription_id , ** kwargs )
62+ self ._config = DeviceUpdateConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
6363 self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
6464
6565 client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
6666 self ._serialize = Serializer (client_models )
67- self ._serialize .client_side_validation = False
6867 self ._deserialize = Deserializer (client_models )
68+ self ._serialize .client_side_validation = False
69+ self .accounts = AccountsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
70+ self .instances = InstancesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
71+ self .private_endpoint_connections = PrivateEndpointConnectionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
72+ self .private_link_resources = PrivateLinkResourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
73+ self .private_endpoint_connection_proxies = PrivateEndpointConnectionProxiesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
74+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
75+
6976
70- self .accounts = AccountsOperations (
71- self ._client , self ._config , self ._serialize , self ._deserialize )
72- self .instances = InstancesOperations (
73- self ._client , self ._config , self ._serialize , self ._deserialize )
74- self .private_endpoint_connections = PrivateEndpointConnectionsOperations (
75- self ._client , self ._config , self ._serialize , self ._deserialize )
76- self .private_link_resources = PrivateLinkResourcesOperations (
77- self ._client , self ._config , self ._serialize , self ._deserialize )
78- self .operations = Operations (
79- self ._client , self ._config , self ._serialize , self ._deserialize )
80-
81- def _send_request (self , http_request , ** kwargs ):
82- # type: (HttpRequest, Any) -> HttpResponse
77+ def _send_request (
78+ self ,
79+ request , # type: HttpRequest
80+ ** kwargs # type: Any
81+ ):
82+ # type: (...) -> HttpResponse
8383 """Runs the network request through the client's chained policies.
8484
85- :param http_request: The network request you want to make. Required.
86- :type http_request: ~azure.core.pipeline.transport.HttpRequest
87- :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
85+ >>> from azure.core.rest import HttpRequest
86+ >>> request = HttpRequest("GET", "https://www.example.org/")
87+ <HttpRequest [GET], url: 'https://www.example.org/'>
88+ >>> response = client._send_request(request)
89+ <HttpResponse: 200 OK>
90+
91+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
92+
93+ :param request: The network request you want to make. Required.
94+ :type request: ~azure.core.rest.HttpRequest
95+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
8896 :return: The response of your network call. Does not do error handling on your response.
89- :rtype: ~azure.core.pipeline.transport .HttpResponse
97+ :rtype: ~azure.core.rest .HttpResponse
9098 """
91- path_format_arguments = {
92- 'subscriptionId' : self ._serialize .url ("self._config.subscription_id" , self ._config .subscription_id , 'str' ),
93- }
94- http_request .url = self ._client .format_url (http_request .url , ** path_format_arguments )
95- stream = kwargs .pop ("stream" , True )
96- pipeline_response = self ._client ._pipeline .run (http_request , stream = stream , ** kwargs )
97- return pipeline_response .http_response
99+
100+ request_copy = deepcopy (request )
101+ request_copy .url = self ._client .format_url (request_copy .url )
102+ return self ._client .send_request (request_copy , ** kwargs )
98103
99104 def close (self ):
100105 # type: () -> None
0 commit comments