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 , TYPE_CHECKING
1011
11- from azure .mgmt .core import ARMPipelineClient
1212from msrest import Deserializer , Serializer
1313
14- if TYPE_CHECKING :
15- # pylint: disable=unused-import,ungrouped-imports
16- from typing import Any , Optional
17-
18- from azure .core .credentials import TokenCredential
19- from azure .core .pipeline .transport import HttpRequest , HttpResponse
14+ from azure .core .rest import HttpRequest , HttpResponse
15+ from azure .mgmt .core import ARMPipelineClient
2016
21- from ._configuration import HybridComputeManagementClientConfiguration
22- from .operations import MachinesOperations
23- from .operations import MachineExtensionsOperations
24- from .operations import Operations
25- from .operations import PrivateLinkScopesOperations
26- from .operations import PrivateLinkResourcesOperations
27- from .operations import PrivateEndpointConnectionsOperations
2817from . import models
18+ from ._configuration import HybridComputeManagementClientConfiguration
19+ from .operations import HybridComputeManagementClientOperationsMixin , MachineExtensionsOperations , MachinesOperations , Operations , PrivateEndpointConnectionsOperations , PrivateLinkResourcesOperations , PrivateLinkScopesOperations
2920
21+ if TYPE_CHECKING :
22+ # pylint: disable=unused-import,ungrouped-imports
23+ from azure .core .credentials import TokenCredential
3024
31- class HybridComputeManagementClient (object ):
25+ class HybridComputeManagementClient (HybridComputeManagementClientOperationsMixin ): # pylint: disable=too-many-instance-attributes
3226 """The Hybrid Compute Management Client.
3327
3428 :ivar machines: MachinesOperations operations
@@ -40,65 +34,83 @@ class HybridComputeManagementClient(object):
4034 :ivar private_link_scopes: PrivateLinkScopesOperations operations
4135 :vartype private_link_scopes: azure.mgmt.hybridcompute.operations.PrivateLinkScopesOperations
4236 :ivar private_link_resources: PrivateLinkResourcesOperations operations
43- :vartype private_link_resources: azure.mgmt.hybridcompute.operations.PrivateLinkResourcesOperations
37+ :vartype private_link_resources:
38+ azure.mgmt.hybridcompute.operations.PrivateLinkResourcesOperations
4439 :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
45- :vartype private_endpoint_connections: azure.mgmt.hybridcompute.operations.PrivateEndpointConnectionsOperations
40+ :vartype private_endpoint_connections:
41+ azure.mgmt.hybridcompute.operations.PrivateEndpointConnectionsOperations
4642 :param credential: Credential needed for the client to connect to Azure.
4743 :type credential: ~azure.core.credentials.TokenCredential
4844 :param subscription_id: The ID of the target subscription.
4945 :type subscription_id: str
50- :param str base_url: Service URL
51- :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 api_version: Api Version. Default value is "2022-05-10-preview". Note that overriding
49+ this default value may result in unsupported behavior.
50+ :paramtype api_version: str
51+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
52+ Retry-After header is present.
5253 """
5354
5455 def __init__ (
5556 self ,
56- credential , # type: "TokenCredential"
57- subscription_id , # type: str
58- base_url = None , # type: Optional[str]
59- ** kwargs # type: Any
60- ):
61- # type: (...) -> None
62- if not base_url :
63- base_url = 'https://management.azure.com'
64- self ._config = HybridComputeManagementClientConfiguration (credential , subscription_id , ** kwargs )
57+ credential : "TokenCredential" ,
58+ subscription_id : str ,
59+ base_url : str = "https://management.azure.com" ,
60+ ** kwargs : Any
61+ ) -> None :
62+ self ._config = HybridComputeManagementClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
6563 self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
6664
6765 client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
6866 self ._serialize = Serializer (client_models )
69- self ._serialize .client_side_validation = False
7067 self ._deserialize = Deserializer (client_models )
71-
68+ self . _serialize . client_side_validation = False
7269 self .machines = MachinesOperations (
73- self ._client , self ._config , self ._serialize , self ._deserialize )
70+ self ._client , self ._config , self ._serialize , self ._deserialize
71+ )
7472 self .machine_extensions = MachineExtensionsOperations (
75- self ._client , self ._config , self ._serialize , self ._deserialize )
73+ self ._client , self ._config , self ._serialize , self ._deserialize
74+ )
7675 self .operations = Operations (
77- self ._client , self ._config , self ._serialize , self ._deserialize )
76+ self ._client , self ._config , self ._serialize , self ._deserialize
77+ )
7878 self .private_link_scopes = PrivateLinkScopesOperations (
79- self ._client , self ._config , self ._serialize , self ._deserialize )
79+ self ._client , self ._config , self ._serialize , self ._deserialize
80+ )
8081 self .private_link_resources = PrivateLinkResourcesOperations (
81- self ._client , self ._config , self ._serialize , self ._deserialize )
82+ self ._client , self ._config , self ._serialize , self ._deserialize
83+ )
8284 self .private_endpoint_connections = PrivateEndpointConnectionsOperations (
83- self ._client , self ._config , self ._serialize , self ._deserialize )
85+ self ._client , self ._config , self ._serialize , self ._deserialize
86+ )
87+
8488
85- def _send_request (self , http_request , ** kwargs ):
86- # type: (HttpRequest, Any) -> HttpResponse
89+ def _send_request (
90+ self ,
91+ request : HttpRequest ,
92+ ** kwargs : Any
93+ ) -> HttpResponse :
8794 """Runs the network request through the client's chained policies.
8895
89- :param http_request: The network request you want to make. Required.
90- :type http_request: ~azure.core.pipeline.transport.HttpRequest
91- :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
96+ >>> from azure.core.rest import HttpRequest
97+ >>> request = HttpRequest("GET", "https://www.example.org/")
98+ <HttpRequest [GET], url: 'https://www.example.org/'>
99+ >>> response = client._send_request(request)
100+ <HttpResponse: 200 OK>
101+
102+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
103+
104+ :param request: The network request you want to make. Required.
105+ :type request: ~azure.core.rest.HttpRequest
106+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
92107 :return: The response of your network call. Does not do error handling on your response.
93- :rtype: ~azure.core.pipeline.transport .HttpResponse
108+ :rtype: ~azure.core.rest .HttpResponse
94109 """
95- path_format_arguments = {
96- 'subscriptionId' : self ._serialize .url ("self._config.subscription_id" , self ._config .subscription_id , 'str' , min_length = 1 ),
97- }
98- http_request .url = self ._client .format_url (http_request .url , ** path_format_arguments )
99- stream = kwargs .pop ("stream" , True )
100- pipeline_response = self ._client ._pipeline .run (http_request , stream = stream , ** kwargs )
101- return pipeline_response .http_response
110+
111+ request_copy = deepcopy (request )
112+ request_copy .url = self ._client .format_url (request_copy .url )
113+ return self ._client .send_request (request_copy , ** kwargs )
102114
103115 def close (self ):
104116 # type: () -> None
0 commit comments