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 DeviceUpdateConfiguration
18+ from .operations import AccountsOperations , DeviceUpdateOperationsMixin , InstancesOperations , Operations , PrivateEndpointConnectionProxiesOperations , PrivateEndpointConnectionsOperations , PrivateLinkResourcesOperations
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 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-
3023
3124class DeviceUpdate (DeviceUpdateOperationsMixin ):
3225 """Microsoft Device Update resource provider.
@@ -36,65 +29,73 @@ class DeviceUpdate(DeviceUpdateOperationsMixin):
3629 :ivar instances: InstancesOperations operations
3730 :vartype instances: device_update.operations.InstancesOperations
3831 :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
39- :vartype private_endpoint_connections: device_update.operations.PrivateEndpointConnectionsOperations
32+ :vartype private_endpoint_connections:
33+ device_update.operations.PrivateEndpointConnectionsOperations
4034 :ivar private_link_resources: PrivateLinkResourcesOperations operations
4135 :vartype private_link_resources: device_update.operations.PrivateLinkResourcesOperations
36+ :ivar private_endpoint_connection_proxies: PrivateEndpointConnectionProxiesOperations
37+ operations
38+ :vartype private_endpoint_connection_proxies:
39+ device_update.operations.PrivateEndpointConnectionProxiesOperations
4240 :ivar operations: Operations operations
4341 :vartype operations: device_update.operations.Operations
4442 :param credential: Credential needed for the client to connect to Azure.
4543 :type credential: ~azure.core.credentials.TokenCredential
4644 :param subscription_id: The Azure subscription ID.
4745 :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.
46+ :param base_url: Service URL. Default value is 'https://management.azure.com'.
47+ :type base_url: str
48+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
49+ Retry-After header is present.
5050 """
5151
5252 def __init__ (
5353 self ,
54- credential , # type: "TokenCredential"
55- subscription_id , # type: str
56- base_url = None , # type: Optional[str]
57- ** kwargs # type: Any
58- ):
59- # type: (...) -> None
60- if not base_url :
61- base_url = 'https://management.azure.com'
62- self ._config = DeviceUpdateConfiguration (credential , subscription_id , ** kwargs )
54+ credential : "TokenCredential" ,
55+ subscription_id : str ,
56+ base_url : str = "https://management.azure.com" ,
57+ ** kwargs : Any
58+ ) -> None :
59+ self ._config = DeviceUpdateConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
6360 self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
6461
6562 client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
6663 self ._serialize = Serializer (client_models )
67- self ._serialize .client_side_validation = False
6864 self ._deserialize = Deserializer (client_models )
65+ self ._serialize .client_side_validation = False
66+ self .accounts = AccountsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
67+ self .instances = InstancesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
68+ self .private_endpoint_connections = PrivateEndpointConnectionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
69+ self .private_link_resources = PrivateLinkResourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
70+ self .private_endpoint_connection_proxies = PrivateEndpointConnectionProxiesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
71+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
6972
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
73+
74+ def _send_request (
75+ self ,
76+ request , # type: HttpRequest
77+ ** kwargs : Any
78+ ) -> HttpResponse :
8379 """Runs the network request through the client's chained policies.
8480
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.
81+ >>> from azure.core.rest import HttpRequest
82+ >>> request = HttpRequest("GET", "https://www.example.org/")
83+ <HttpRequest [GET], url: 'https://www.example.org/'>
84+ >>> response = client._send_request(request)
85+ <HttpResponse: 200 OK>
86+
87+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
88+
89+ :param request: The network request you want to make. Required.
90+ :type request: ~azure.core.rest.HttpRequest
91+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
8892 :return: The response of your network call. Does not do error handling on your response.
89- :rtype: ~azure.core.pipeline.transport .HttpResponse
93+ :rtype: ~azure.core.rest .HttpResponse
9094 """
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
95+
96+ request_copy = deepcopy (request )
97+ request_copy .url = self ._client .format_url (request_copy .url )
98+ return self ._client .send_request (request_copy , ** kwargs )
9899
99100 def close (self ):
100101 # type: () -> None
0 commit comments