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 DevTestLabsClientConfiguration
18+ from .operations import ArmTemplatesOperations , ArtifactSourcesOperations , ArtifactsOperations , CostsOperations , CustomImagesOperations , DisksOperations , EnvironmentsOperations , FormulasOperations , GalleryImagesOperations , GlobalSchedulesOperations , LabsOperations , NotificationChannelsOperations , Operations , PoliciesOperations , PolicySetsOperations , ProviderOperationsOperations , SchedulesOperations , SecretsOperations , ServiceFabricSchedulesOperations , ServiceFabricsOperations , ServiceRunnersOperations , UsersOperations , VirtualMachineSchedulesOperations , VirtualMachinesOperations , VirtualNetworksOperations
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
1923
20- from ._configuration import DevTestLabsClientConfiguration
21- from .operations import ProviderOperationsOperations
22- from .operations import LabsOperations
23- from .operations import Operations
24- from .operations import GlobalSchedulesOperations
25- from .operations import ArtifactSourcesOperations
26- from .operations import ArmTemplatesOperations
27- from .operations import ArtifactsOperations
28- from .operations import CostsOperations
29- from .operations import CustomImagesOperations
30- from .operations import FormulasOperations
31- from .operations import GalleryImagesOperations
32- from .operations import NotificationChannelsOperations
33- from .operations import PolicySetsOperations
34- from .operations import PoliciesOperations
35- from .operations import SchedulesOperations
36- from .operations import ServiceRunnersOperations
37- from .operations import UsersOperations
38- from .operations import DisksOperations
39- from .operations import EnvironmentsOperations
40- from .operations import SecretsOperations
41- from .operations import ServiceFabricsOperations
42- from .operations import ServiceFabricSchedulesOperations
43- from .operations import VirtualMachinesOperations
44- from .operations import VirtualMachineSchedulesOperations
45- from .operations import VirtualNetworksOperations
46- from . import models
47-
48-
49- class DevTestLabsClient (object ):
24+ class DevTestLabsClient :
5025 """The DevTest Labs Client.
5126
5227 :ivar provider_operations: ProviderOperationsOperations operations
@@ -72,7 +47,8 @@ class DevTestLabsClient(object):
7247 :ivar gallery_images: GalleryImagesOperations operations
7348 :vartype gallery_images: azure.mgmt.devtestlabs.operations.GalleryImagesOperations
7449 :ivar notification_channels: NotificationChannelsOperations operations
75- :vartype notification_channels: azure.mgmt.devtestlabs.operations.NotificationChannelsOperations
50+ :vartype notification_channels:
51+ azure.mgmt.devtestlabs.operations.NotificationChannelsOperations
7652 :ivar policy_sets: PolicySetsOperations operations
7753 :vartype policy_sets: azure.mgmt.devtestlabs.operations.PolicySetsOperations
7854 :ivar policies: PoliciesOperations operations
@@ -92,89 +68,91 @@ class DevTestLabsClient(object):
9268 :ivar service_fabrics: ServiceFabricsOperations operations
9369 :vartype service_fabrics: azure.mgmt.devtestlabs.operations.ServiceFabricsOperations
9470 :ivar service_fabric_schedules: ServiceFabricSchedulesOperations operations
95- :vartype service_fabric_schedules: azure.mgmt.devtestlabs.operations.ServiceFabricSchedulesOperations
71+ :vartype service_fabric_schedules:
72+ azure.mgmt.devtestlabs.operations.ServiceFabricSchedulesOperations
9673 :ivar virtual_machines: VirtualMachinesOperations operations
9774 :vartype virtual_machines: azure.mgmt.devtestlabs.operations.VirtualMachinesOperations
9875 :ivar virtual_machine_schedules: VirtualMachineSchedulesOperations operations
99- :vartype virtual_machine_schedules: azure.mgmt.devtestlabs.operations.VirtualMachineSchedulesOperations
76+ :vartype virtual_machine_schedules:
77+ azure.mgmt.devtestlabs.operations.VirtualMachineSchedulesOperations
10078 :ivar virtual_networks: VirtualNetworksOperations operations
10179 :vartype virtual_networks: azure.mgmt.devtestlabs.operations.VirtualNetworksOperations
10280 :param credential: Credential needed for the client to connect to Azure.
10381 :type credential: ~azure.core.credentials.TokenCredential
10482 :param subscription_id: The subscription ID.
10583 :type subscription_id: str
106- :param str base_url: Service URL
107- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
84+ :param base_url: Service URL. Default value is 'https://management.azure.com'.
85+ :type base_url: str
86+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
87+ Retry-After header is present.
10888 """
10989
11090 def __init__ (
11191 self ,
112- credential , # type: "TokenCredential"
113- subscription_id , # type: str
114- base_url = None , # type: Optional[str]
115- ** kwargs # type: Any
116- ):
117- # type: (...) -> None
118- if not base_url :
119- base_url = 'https://management.azure.com'
120- self ._config = DevTestLabsClientConfiguration (credential , subscription_id , ** kwargs )
92+ credential : "TokenCredential" ,
93+ subscription_id : str ,
94+ base_url : str = "https://management.azure.com" ,
95+ ** kwargs : Any
96+ ) -> None :
97+ self ._config = DevTestLabsClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
12198 self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
12299
123100 client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
124101 self ._serialize = Serializer (client_models )
125- self ._serialize .client_side_validation = False
126102 self ._deserialize = Deserializer (client_models )
103+ self ._serialize .client_side_validation = False
104+ self .provider_operations = ProviderOperationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
105+ self .labs = LabsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
106+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
107+ self .global_schedules = GlobalSchedulesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
108+ self .artifact_sources = ArtifactSourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
109+ self .arm_templates = ArmTemplatesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
110+ self .artifacts = ArtifactsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
111+ self .costs = CostsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
112+ self .custom_images = CustomImagesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
113+ self .formulas = FormulasOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
114+ self .gallery_images = GalleryImagesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
115+ self .notification_channels = NotificationChannelsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
116+ self .policy_sets = PolicySetsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
117+ self .policies = PoliciesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
118+ self .schedules = SchedulesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
119+ self .service_runners = ServiceRunnersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
120+ self .users = UsersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
121+ self .disks = DisksOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
122+ self .environments = EnvironmentsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
123+ self .secrets = SecretsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
124+ self .service_fabrics = ServiceFabricsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
125+ self .service_fabric_schedules = ServiceFabricSchedulesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
126+ self .virtual_machines = VirtualMachinesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
127+ self .virtual_machine_schedules = VirtualMachineSchedulesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
128+ self .virtual_networks = VirtualNetworksOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
129+
130+
131+ def _send_request (
132+ self ,
133+ request , # type: HttpRequest
134+ ** kwargs : Any
135+ ) -> HttpResponse :
136+ """Runs the network request through the client's chained policies.
137+
138+ >>> from azure.core.rest import HttpRequest
139+ >>> request = HttpRequest("GET", "https://www.example.org/")
140+ <HttpRequest [GET], url: 'https://www.example.org/'>
141+ >>> response = client._send_request(request)
142+ <HttpResponse: 200 OK>
143+
144+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
145+
146+ :param request: The network request you want to make. Required.
147+ :type request: ~azure.core.rest.HttpRequest
148+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
149+ :return: The response of your network call. Does not do error handling on your response.
150+ :rtype: ~azure.core.rest.HttpResponse
151+ """
127152
128- self .provider_operations = ProviderOperationsOperations (
129- self ._client , self ._config , self ._serialize , self ._deserialize )
130- self .labs = LabsOperations (
131- self ._client , self ._config , self ._serialize , self ._deserialize )
132- self .operations = Operations (
133- self ._client , self ._config , self ._serialize , self ._deserialize )
134- self .global_schedules = GlobalSchedulesOperations (
135- self ._client , self ._config , self ._serialize , self ._deserialize )
136- self .artifact_sources = ArtifactSourcesOperations (
137- self ._client , self ._config , self ._serialize , self ._deserialize )
138- self .arm_templates = ArmTemplatesOperations (
139- self ._client , self ._config , self ._serialize , self ._deserialize )
140- self .artifacts = ArtifactsOperations (
141- self ._client , self ._config , self ._serialize , self ._deserialize )
142- self .costs = CostsOperations (
143- self ._client , self ._config , self ._serialize , self ._deserialize )
144- self .custom_images = CustomImagesOperations (
145- self ._client , self ._config , self ._serialize , self ._deserialize )
146- self .formulas = FormulasOperations (
147- self ._client , self ._config , self ._serialize , self ._deserialize )
148- self .gallery_images = GalleryImagesOperations (
149- self ._client , self ._config , self ._serialize , self ._deserialize )
150- self .notification_channels = NotificationChannelsOperations (
151- self ._client , self ._config , self ._serialize , self ._deserialize )
152- self .policy_sets = PolicySetsOperations (
153- self ._client , self ._config , self ._serialize , self ._deserialize )
154- self .policies = PoliciesOperations (
155- self ._client , self ._config , self ._serialize , self ._deserialize )
156- self .schedules = SchedulesOperations (
157- self ._client , self ._config , self ._serialize , self ._deserialize )
158- self .service_runners = ServiceRunnersOperations (
159- self ._client , self ._config , self ._serialize , self ._deserialize )
160- self .users = UsersOperations (
161- self ._client , self ._config , self ._serialize , self ._deserialize )
162- self .disks = DisksOperations (
163- self ._client , self ._config , self ._serialize , self ._deserialize )
164- self .environments = EnvironmentsOperations (
165- self ._client , self ._config , self ._serialize , self ._deserialize )
166- self .secrets = SecretsOperations (
167- self ._client , self ._config , self ._serialize , self ._deserialize )
168- self .service_fabrics = ServiceFabricsOperations (
169- self ._client , self ._config , self ._serialize , self ._deserialize )
170- self .service_fabric_schedules = ServiceFabricSchedulesOperations (
171- self ._client , self ._config , self ._serialize , self ._deserialize )
172- self .virtual_machines = VirtualMachinesOperations (
173- self ._client , self ._config , self ._serialize , self ._deserialize )
174- self .virtual_machine_schedules = VirtualMachineSchedulesOperations (
175- self ._client , self ._config , self ._serialize , self ._deserialize )
176- self .virtual_networks = VirtualNetworksOperations (
177- self ._client , self ._config , self ._serialize , self ._deserialize )
153+ request_copy = deepcopy (request )
154+ request_copy .url = self ._client .format_url (request_copy .url )
155+ return self ._client .send_request (request_copy , ** kwargs )
178156
179157 def close (self ):
180158 # type: () -> None
0 commit comments