22# --------------------------------------------------------------------------
33# Copyright (c) Microsoft Corporation. All rights reserved.
44# Licensed under the MIT License. See License.txt in the project root for license information.
5- # Code generated by Microsoft (R) AutoRest Code Generator.
5+ # Code generated by Microsoft (R) Python Code Generator.
66# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77# --------------------------------------------------------------------------
88
99from copy import deepcopy
10+ import sys
1011from typing import Any , Optional , TYPE_CHECKING , cast
11- from typing_extensions import Self
1212
1313from azure .core .pipeline import policies
1414from azure .core .rest import HttpRequest , HttpResponse
1717from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1818from azure .mgmt .core .tools import get_arm_endpoints
1919
20- from . import models as _models
2120from ._configuration import DataFactoryManagementClientConfiguration
2221from ._utils .serialization import Deserializer , Serializer
2322from .operations import (
4746 TriggersOperations ,
4847)
4948
49+ if sys .version_info >= (3 , 11 ):
50+ from typing import Self
51+ else :
52+ from typing_extensions import Self # type: ignore
53+
5054if TYPE_CHECKING :
5155 from azure .core import AzureClouds
5256 from azure .core .credentials import TokenCredential
5357
5458
5559class DataFactoryManagementClient : # pylint: disable=too-many-instance-attributes
56- """The Azure Data Factory V2 management API provides a RESTful set of web services that interact
57- with Azure Data Factory V2 services.
60+ """DataFactoryManagementClient.
5861
5962 :ivar operations: Operations operations
6063 :vartype operations: azure.mgmt.datafactory.operations.Operations
6164 :ivar factories: FactoriesOperations operations
6265 :vartype factories: azure.mgmt.datafactory.operations.FactoriesOperations
6366 :ivar exposure_control: ExposureControlOperations operations
6467 :vartype exposure_control: azure.mgmt.datafactory.operations.ExposureControlOperations
68+ :ivar pipeline_runs: PipelineRunsOperations operations
69+ :vartype pipeline_runs: azure.mgmt.datafactory.operations.PipelineRunsOperations
70+ :ivar activity_runs: ActivityRunsOperations operations
71+ :vartype activity_runs: azure.mgmt.datafactory.operations.ActivityRunsOperations
72+ :ivar triggers: TriggersOperations operations
73+ :vartype triggers: azure.mgmt.datafactory.operations.TriggersOperations
74+ :ivar trigger_runs: TriggerRunsOperations operations
75+ :vartype trigger_runs: azure.mgmt.datafactory.operations.TriggerRunsOperations
76+ :ivar data_flow_debug_session: DataFlowDebugSessionOperations operations
77+ :vartype data_flow_debug_session:
78+ azure.mgmt.datafactory.operations.DataFlowDebugSessionOperations
79+ :ivar private_link_resources: PrivateLinkResourcesOperations operations
80+ :vartype private_link_resources:
81+ azure.mgmt.datafactory.operations.PrivateLinkResourcesOperations
6582 :ivar integration_runtimes: IntegrationRuntimesOperations operations
6683 :vartype integration_runtimes: azure.mgmt.datafactory.operations.IntegrationRuntimesOperations
6784 :ivar integration_runtime_object_metadata: IntegrationRuntimeObjectMetadataOperations
@@ -79,19 +96,8 @@ class DataFactoryManagementClient: # pylint: disable=too-many-instance-attribut
7996 :vartype datasets: azure.mgmt.datafactory.operations.DatasetsOperations
8097 :ivar pipelines: PipelinesOperations operations
8198 :vartype pipelines: azure.mgmt.datafactory.operations.PipelinesOperations
82- :ivar pipeline_runs: PipelineRunsOperations operations
83- :vartype pipeline_runs: azure.mgmt.datafactory.operations.PipelineRunsOperations
84- :ivar activity_runs: ActivityRunsOperations operations
85- :vartype activity_runs: azure.mgmt.datafactory.operations.ActivityRunsOperations
86- :ivar triggers: TriggersOperations operations
87- :vartype triggers: azure.mgmt.datafactory.operations.TriggersOperations
88- :ivar trigger_runs: TriggerRunsOperations operations
89- :vartype trigger_runs: azure.mgmt.datafactory.operations.TriggerRunsOperations
9099 :ivar data_flows: DataFlowsOperations operations
91100 :vartype data_flows: azure.mgmt.datafactory.operations.DataFlowsOperations
92- :ivar data_flow_debug_session: DataFlowDebugSessionOperations operations
93- :vartype data_flow_debug_session:
94- azure.mgmt.datafactory.operations.DataFlowDebugSessionOperations
95101 :ivar managed_virtual_networks: ManagedVirtualNetworksOperations operations
96102 :vartype managed_virtual_networks:
97103 azure.mgmt.datafactory.operations.ManagedVirtualNetworksOperations
@@ -101,30 +107,28 @@ class DataFactoryManagementClient: # pylint: disable=too-many-instance-attribut
101107 :ivar credential_operations: CredentialOperationsOperations operations
102108 :vartype credential_operations:
103109 azure.mgmt.datafactory.operations.CredentialOperationsOperations
104- :ivar private_end_point_connections: PrivateEndPointConnectionsOperations operations
105- :vartype private_end_point_connections:
106- azure.mgmt.datafactory.operations.PrivateEndPointConnectionsOperations
107110 :ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations
108111 :vartype private_endpoint_connection:
109112 azure.mgmt.datafactory.operations.PrivateEndpointConnectionOperations
110- :ivar private_link_resources: PrivateLinkResourcesOperations operations
111- :vartype private_link_resources :
112- azure.mgmt.datafactory.operations.PrivateLinkResourcesOperations
113+ :ivar private_end_point_connections: PrivateEndPointConnectionsOperations operations
114+ :vartype private_end_point_connections :
115+ azure.mgmt.datafactory.operations.PrivateEndPointConnectionsOperations
113116 :ivar global_parameters: GlobalParametersOperations operations
114117 :vartype global_parameters: azure.mgmt.datafactory.operations.GlobalParametersOperations
115118 :ivar change_data_capture: ChangeDataCaptureOperations operations
116119 :vartype change_data_capture: azure.mgmt.datafactory.operations.ChangeDataCaptureOperations
117- :param credential: Credential needed for the client to connect to Azure . Required.
120+ :param credential: Credential used to authenticate requests to the service . Required.
118121 :type credential: ~azure.core.credentials.TokenCredential
119- :param subscription_id: The subscription identifier . Required.
122+ :param subscription_id: The ID of the target subscription. The value must be an UUID . Required.
120123 :type subscription_id: str
121- :param base_url: Service URL . Default value is None.
124+ :param base_url: Service host . Default value is None.
122125 :type base_url: str
123126 :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
124127 None.
125128 :paramtype cloud_setting: ~azure.core.AzureClouds
126- :keyword api_version: Api Version. Default value is "2018-06-01". Note that overriding this
127- default value may result in unsupported behavior.
129+ :keyword api_version: The API version to use for this operation. Known values are "2018-06-01"
130+ and None. Default value is None. If not set, the operation's default API version will be used.
131+ Note that overriding this default value may result in unsupported behavior.
128132 :paramtype api_version: str
129133 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
130134 Retry-After header is present.
@@ -139,6 +143,7 @@ def __init__(
139143 cloud_setting : Optional ["AzureClouds" ] = None ,
140144 ** kwargs : Any
141145 ) -> None :
146+ _endpoint = "{endpoint}"
142147 _cloud = cloud_setting or settings .current .azure_cloud # type: ignore
143148 _endpoints = get_arm_endpoints (_cloud )
144149 if not base_url :
@@ -147,6 +152,7 @@ def __init__(
147152 self ._config = DataFactoryManagementClientConfiguration (
148153 credential = credential ,
149154 subscription_id = subscription_id ,
155+ base_url = cast (str , base_url ),
150156 cloud_setting = cloud_setting ,
151157 credential_scopes = credential_scopes ,
152158 ** kwargs
@@ -170,17 +176,26 @@ def __init__(
170176 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
171177 self ._config .http_logging_policy ,
172178 ]
173- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast (str , base_url ), policies = _policies , ** kwargs )
179+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast (str , _endpoint ), policies = _policies , ** kwargs )
174180
175- client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
176- self ._serialize = Serializer (client_models )
177- self ._deserialize = Deserializer (client_models )
181+ self ._serialize = Serializer ()
182+ self ._deserialize = Deserializer ()
178183 self ._serialize .client_side_validation = False
179184 self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
180185 self .factories = FactoriesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
181186 self .exposure_control = ExposureControlOperations (
182187 self ._client , self ._config , self ._serialize , self ._deserialize
183188 )
189+ self .pipeline_runs = PipelineRunsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
190+ self .activity_runs = ActivityRunsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
191+ self .triggers = TriggersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
192+ self .trigger_runs = TriggerRunsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
193+ self .data_flow_debug_session = DataFlowDebugSessionOperations (
194+ self ._client , self ._config , self ._serialize , self ._deserialize
195+ )
196+ self .private_link_resources = PrivateLinkResourcesOperations (
197+ self ._client , self ._config , self ._serialize , self ._deserialize
198+ )
184199 self .integration_runtimes = IntegrationRuntimesOperations (
185200 self ._client , self ._config , self ._serialize , self ._deserialize
186201 )
@@ -196,14 +211,7 @@ def __init__(
196211 self .linked_services = LinkedServicesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
197212 self .datasets = DatasetsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
198213 self .pipelines = PipelinesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
199- self .pipeline_runs = PipelineRunsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
200- self .activity_runs = ActivityRunsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
201- self .triggers = TriggersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
202- self .trigger_runs = TriggerRunsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
203214 self .data_flows = DataFlowsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
204- self .data_flow_debug_session = DataFlowDebugSessionOperations (
205- self ._client , self ._config , self ._serialize , self ._deserialize
206- )
207215 self .managed_virtual_networks = ManagedVirtualNetworksOperations (
208216 self ._client , self ._config , self ._serialize , self ._deserialize
209217 )
@@ -213,13 +221,10 @@ def __init__(
213221 self .credential_operations = CredentialOperationsOperations (
214222 self ._client , self ._config , self ._serialize , self ._deserialize
215223 )
216- self .private_end_point_connections = PrivateEndPointConnectionsOperations (
217- self ._client , self ._config , self ._serialize , self ._deserialize
218- )
219224 self .private_endpoint_connection = PrivateEndpointConnectionOperations (
220225 self ._client , self ._config , self ._serialize , self ._deserialize
221226 )
222- self .private_link_resources = PrivateLinkResourcesOperations (
227+ self .private_end_point_connections = PrivateEndPointConnectionsOperations (
223228 self ._client , self ._config , self ._serialize , self ._deserialize
224229 )
225230 self .global_parameters = GlobalParametersOperations (
@@ -229,13 +234,13 @@ def __init__(
229234 self ._client , self ._config , self ._serialize , self ._deserialize
230235 )
231236
232- def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
237+ def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
233238 """Runs the network request through the client's chained policies.
234239
235240 >>> from azure.core.rest import HttpRequest
236241 >>> request = HttpRequest("GET", "https://www.example.org/")
237242 <HttpRequest [GET], url: 'https://www.example.org/'>
238- >>> response = client._send_request (request)
243+ >>> response = client.send_request (request)
239244 <HttpResponse: 200 OK>
240245
241246 For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -248,7 +253,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
248253 """
249254
250255 request_copy = deepcopy (request )
251- request_copy .url = self ._client .format_url (request_copy .url )
256+ path_format_arguments = {
257+ "endpoint" : self ._serialize .url ("self._config.base_url" , self ._config .base_url , "str" , skip_quote = True ),
258+ }
259+
260+ request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
252261 return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
253262
254263 def close (self ) -> None :
0 commit comments