Skip to content

Commit 10d6842

Browse files
author
SDKAuto
committed
CodeGen from PR 17016 in Azure/azure-rest-api-specs
datafactory, clean directive after Dapeng (Azure#17016)
1 parent 63a3589 commit 10d6842

File tree

55 files changed

+59285
-26947
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+59285
-26947
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.4.5",
2+
"autorest": "3.7.2",
33
"use": [
4-
"@autorest/python@5.8.4",
5-
"@autorest/[email protected].2"
4+
"@autorest/python@5.12.0",
5+
"@autorest/[email protected].3"
66
],
7-
"commit": "9e8a591da83285d863866ecd2f6fe87a72758a7d",
7+
"commit": "91c198e26991291a67ecb3aab163b255746d0b58",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/datafactory/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/[email protected].2 --version=3.4.5",
9+
"autorest_command": "autorest specification/datafactory/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.12.0 --use=@autorest/[email protected].3 --version=3.7.2",
1010
"readme": "specification/datafactory/resource-manager/readme.md"
1111
}

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/__init__.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
__version__ = VERSION
1313
__all__ = ['DataFactoryManagementClient']
1414

15-
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
18-
except ImportError:
19-
pass
15+
# `._patch.py` is used for handwritten extensions to the generated code
16+
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17+
from ._patch import patch_sdk
18+
patch_sdk()

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_configuration.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from azure.core.configuration import Configuration
1212
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
13+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1414

1515
from ._version import VERSION
1616

@@ -40,11 +40,11 @@ def __init__(
4040
**kwargs # type: Any
4141
):
4242
# type: (...) -> None
43+
super(DataFactoryManagementClientConfiguration, self).__init__(**kwargs)
4344
if credential is None:
4445
raise ValueError("Parameter 'credential' must not be None.")
4546
if subscription_id is None:
4647
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(DataFactoryManagementClientConfiguration, self).__init__(**kwargs)
4848

4949
self.credential = credential
5050
self.subscription_id = subscription_id
@@ -68,4 +68,4 @@ def _configure(
6868
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6969
self.authentication_policy = kwargs.get('authentication_policy')
7070
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
71+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_data_factory_management_client.py

+75-96
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,22 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9+
from copy import deepcopy
910
from typing import TYPE_CHECKING
1011

1112
from azure.mgmt.core import ARMPipelineClient
1213
from msrest import Deserializer, Serializer
1314

15+
from . import models
16+
from ._configuration import DataFactoryManagementClientConfiguration
17+
from .operations import ActivityRunsOperations, DataFlowDebugSessionOperations, DataFlowsOperations, DatasetsOperations, ExposureControlOperations, FactoriesOperations, IntegrationRuntimeNodesOperations, IntegrationRuntimeObjectMetadataOperations, IntegrationRuntimesOperations, LinkedServicesOperations, ManagedPrivateEndpointsOperations, ManagedVirtualNetworksOperations, Operations, PipelineRunsOperations, PipelinesOperations, PrivateEndPointConnectionsOperations, PrivateEndpointConnectionOperations, PrivateLinkResourcesOperations, TriggerRunsOperations, TriggersOperations
18+
1419
if 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 DataFactoryManagementClientConfiguration
22-
from .operations import Operations
23-
from .operations import FactoriesOperations
24-
from .operations import ExposureControlOperations
25-
from .operations import IntegrationRuntimesOperations
26-
from .operations import IntegrationRuntimeObjectMetadataOperations
27-
from .operations import IntegrationRuntimeNodesOperations
28-
from .operations import LinkedServicesOperations
29-
from .operations import DatasetsOperations
30-
from .operations import PipelinesOperations
31-
from .operations import PipelineRunsOperations
32-
from .operations import ActivityRunsOperations
33-
from .operations import TriggersOperations
34-
from .operations import TriggerRunsOperations
35-
from .operations import DataFlowsOperations
36-
from .operations import DataFlowDebugSessionOperations
37-
from .operations import ManagedVirtualNetworksOperations
38-
from .operations import ManagedPrivateEndpointsOperations
39-
from .operations import PrivateEndPointConnectionsOperations
40-
from .operations import PrivateEndpointConnectionOperations
41-
from .operations import PrivateLinkResourcesOperations
42-
from . import models
43-
24+
from azure.core.rest import HttpRequest, HttpResponse
4425

4526
class DataFactoryManagementClient(object):
4627
"""The Azure Data Factory V2 management API provides a RESTful set of web services that interact with Azure Data Factory V2 services.
@@ -53,10 +34,13 @@ class DataFactoryManagementClient(object):
5334
:vartype exposure_control: azure.mgmt.datafactory.operations.ExposureControlOperations
5435
:ivar integration_runtimes: IntegrationRuntimesOperations operations
5536
:vartype integration_runtimes: azure.mgmt.datafactory.operations.IntegrationRuntimesOperations
56-
:ivar integration_runtime_object_metadata: IntegrationRuntimeObjectMetadataOperations operations
57-
:vartype integration_runtime_object_metadata: azure.mgmt.datafactory.operations.IntegrationRuntimeObjectMetadataOperations
37+
:ivar integration_runtime_object_metadata: IntegrationRuntimeObjectMetadataOperations
38+
operations
39+
:vartype integration_runtime_object_metadata:
40+
azure.mgmt.datafactory.operations.IntegrationRuntimeObjectMetadataOperations
5841
:ivar integration_runtime_nodes: IntegrationRuntimeNodesOperations operations
59-
:vartype integration_runtime_nodes: azure.mgmt.datafactory.operations.IntegrationRuntimeNodesOperations
42+
:vartype integration_runtime_nodes:
43+
azure.mgmt.datafactory.operations.IntegrationRuntimeNodesOperations
6044
:ivar linked_services: LinkedServicesOperations operations
6145
:vartype linked_services: azure.mgmt.datafactory.operations.LinkedServicesOperations
6246
:ivar datasets: DatasetsOperations operations
@@ -74,101 +58,96 @@ class DataFactoryManagementClient(object):
7458
:ivar data_flows: DataFlowsOperations operations
7559
:vartype data_flows: azure.mgmt.datafactory.operations.DataFlowsOperations
7660
:ivar data_flow_debug_session: DataFlowDebugSessionOperations operations
77-
:vartype data_flow_debug_session: azure.mgmt.datafactory.operations.DataFlowDebugSessionOperations
61+
:vartype data_flow_debug_session:
62+
azure.mgmt.datafactory.operations.DataFlowDebugSessionOperations
7863
:ivar managed_virtual_networks: ManagedVirtualNetworksOperations operations
79-
:vartype managed_virtual_networks: azure.mgmt.datafactory.operations.ManagedVirtualNetworksOperations
64+
:vartype managed_virtual_networks:
65+
azure.mgmt.datafactory.operations.ManagedVirtualNetworksOperations
8066
:ivar managed_private_endpoints: ManagedPrivateEndpointsOperations operations
81-
:vartype managed_private_endpoints: azure.mgmt.datafactory.operations.ManagedPrivateEndpointsOperations
67+
:vartype managed_private_endpoints:
68+
azure.mgmt.datafactory.operations.ManagedPrivateEndpointsOperations
8269
:ivar private_end_point_connections: PrivateEndPointConnectionsOperations operations
83-
:vartype private_end_point_connections: azure.mgmt.datafactory.operations.PrivateEndPointConnectionsOperations
70+
:vartype private_end_point_connections:
71+
azure.mgmt.datafactory.operations.PrivateEndPointConnectionsOperations
8472
:ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations
85-
:vartype private_endpoint_connection: azure.mgmt.datafactory.operations.PrivateEndpointConnectionOperations
73+
:vartype private_endpoint_connection:
74+
azure.mgmt.datafactory.operations.PrivateEndpointConnectionOperations
8675
:ivar private_link_resources: PrivateLinkResourcesOperations operations
87-
:vartype private_link_resources: azure.mgmt.datafactory.operations.PrivateLinkResourcesOperations
76+
:vartype private_link_resources:
77+
azure.mgmt.datafactory.operations.PrivateLinkResourcesOperations
8878
:param credential: Credential needed for the client to connect to Azure.
8979
:type credential: ~azure.core.credentials.TokenCredential
9080
:param subscription_id: The subscription identifier.
9181
:type subscription_id: str
92-
:param str base_url: Service URL
93-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
82+
:param base_url: Service URL. Default value is 'https://management.azure.com'.
83+
:type base_url: str
84+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
85+
Retry-After header is present.
9486
"""
9587

9688
def __init__(
9789
self,
9890
credential, # type: "TokenCredential"
9991
subscription_id, # type: str
100-
base_url=None, # type: Optional[str]
92+
base_url="https://management.azure.com", # type: str
10193
**kwargs # type: Any
10294
):
10395
# type: (...) -> None
104-
if not base_url:
105-
base_url = 'https://management.azure.com'
106-
self._config = DataFactoryManagementClientConfiguration(credential, subscription_id, **kwargs)
96+
self._config = DataFactoryManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
10797
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
10898

10999
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
110100
self._serialize = Serializer(client_models)
111-
self._serialize.client_side_validation = False
112101
self._deserialize = Deserializer(client_models)
113-
114-
self.operations = Operations(
115-
self._client, self._config, self._serialize, self._deserialize)
116-
self.factories = FactoriesOperations(
117-
self._client, self._config, self._serialize, self._deserialize)
118-
self.exposure_control = ExposureControlOperations(
119-
self._client, self._config, self._serialize, self._deserialize)
120-
self.integration_runtimes = IntegrationRuntimesOperations(
121-
self._client, self._config, self._serialize, self._deserialize)
122-
self.integration_runtime_object_metadata = IntegrationRuntimeObjectMetadataOperations(
123-
self._client, self._config, self._serialize, self._deserialize)
124-
self.integration_runtime_nodes = IntegrationRuntimeNodesOperations(
125-
self._client, self._config, self._serialize, self._deserialize)
126-
self.linked_services = LinkedServicesOperations(
127-
self._client, self._config, self._serialize, self._deserialize)
128-
self.datasets = DatasetsOperations(
129-
self._client, self._config, self._serialize, self._deserialize)
130-
self.pipelines = PipelinesOperations(
131-
self._client, self._config, self._serialize, self._deserialize)
132-
self.pipeline_runs = PipelineRunsOperations(
133-
self._client, self._config, self._serialize, self._deserialize)
134-
self.activity_runs = ActivityRunsOperations(
135-
self._client, self._config, self._serialize, self._deserialize)
136-
self.triggers = TriggersOperations(
137-
self._client, self._config, self._serialize, self._deserialize)
138-
self.trigger_runs = TriggerRunsOperations(
139-
self._client, self._config, self._serialize, self._deserialize)
140-
self.data_flows = DataFlowsOperations(
141-
self._client, self._config, self._serialize, self._deserialize)
142-
self.data_flow_debug_session = DataFlowDebugSessionOperations(
143-
self._client, self._config, self._serialize, self._deserialize)
144-
self.managed_virtual_networks = ManagedVirtualNetworksOperations(
145-
self._client, self._config, self._serialize, self._deserialize)
146-
self.managed_private_endpoints = ManagedPrivateEndpointsOperations(
147-
self._client, self._config, self._serialize, self._deserialize)
148-
self.private_end_point_connections = PrivateEndPointConnectionsOperations(
149-
self._client, self._config, self._serialize, self._deserialize)
150-
self.private_endpoint_connection = PrivateEndpointConnectionOperations(
151-
self._client, self._config, self._serialize, self._deserialize)
152-
self.private_link_resources = PrivateLinkResourcesOperations(
153-
self._client, self._config, self._serialize, self._deserialize)
154-
155-
def _send_request(self, http_request, **kwargs):
156-
# type: (HttpRequest, Any) -> HttpResponse
102+
self._serialize.client_side_validation = False
103+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
104+
self.factories = FactoriesOperations(self._client, self._config, self._serialize, self._deserialize)
105+
self.exposure_control = ExposureControlOperations(self._client, self._config, self._serialize, self._deserialize)
106+
self.integration_runtimes = IntegrationRuntimesOperations(self._client, self._config, self._serialize, self._deserialize)
107+
self.integration_runtime_object_metadata = IntegrationRuntimeObjectMetadataOperations(self._client, self._config, self._serialize, self._deserialize)
108+
self.integration_runtime_nodes = IntegrationRuntimeNodesOperations(self._client, self._config, self._serialize, self._deserialize)
109+
self.linked_services = LinkedServicesOperations(self._client, self._config, self._serialize, self._deserialize)
110+
self.datasets = DatasetsOperations(self._client, self._config, self._serialize, self._deserialize)
111+
self.pipelines = PipelinesOperations(self._client, self._config, self._serialize, self._deserialize)
112+
self.pipeline_runs = PipelineRunsOperations(self._client, self._config, self._serialize, self._deserialize)
113+
self.activity_runs = ActivityRunsOperations(self._client, self._config, self._serialize, self._deserialize)
114+
self.triggers = TriggersOperations(self._client, self._config, self._serialize, self._deserialize)
115+
self.trigger_runs = TriggerRunsOperations(self._client, self._config, self._serialize, self._deserialize)
116+
self.data_flows = DataFlowsOperations(self._client, self._config, self._serialize, self._deserialize)
117+
self.data_flow_debug_session = DataFlowDebugSessionOperations(self._client, self._config, self._serialize, self._deserialize)
118+
self.managed_virtual_networks = ManagedVirtualNetworksOperations(self._client, self._config, self._serialize, self._deserialize)
119+
self.managed_private_endpoints = ManagedPrivateEndpointsOperations(self._client, self._config, self._serialize, self._deserialize)
120+
self.private_end_point_connections = PrivateEndPointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
121+
self.private_endpoint_connection = PrivateEndpointConnectionOperations(self._client, self._config, self._serialize, self._deserialize)
122+
self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
123+
124+
125+
def _send_request(
126+
self,
127+
request, # type: HttpRequest
128+
**kwargs # type: Any
129+
):
130+
# type: (...) -> HttpResponse
157131
"""Runs the network request through the client's chained policies.
158132
159-
:param http_request: The network request you want to make. Required.
160-
:type http_request: ~azure.core.pipeline.transport.HttpRequest
161-
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
133+
>>> from azure.core.rest import HttpRequest
134+
>>> request = HttpRequest("GET", "https://www.example.org/")
135+
<HttpRequest [GET], url: 'https://www.example.org/'>
136+
>>> response = client._send_request(request)
137+
<HttpResponse: 200 OK>
138+
139+
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
140+
141+
:param request: The network request you want to make. Required.
142+
:type request: ~azure.core.rest.HttpRequest
143+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
162144
:return: The response of your network call. Does not do error handling on your response.
163-
:rtype: ~azure.core.pipeline.transport.HttpResponse
145+
:rtype: ~azure.core.rest.HttpResponse
164146
"""
165-
path_format_arguments = {
166-
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
167-
}
168-
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
169-
stream = kwargs.pop("stream", True)
170-
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
171-
return pipeline_response.http_response
147+
148+
request_copy = deepcopy(request)
149+
request_copy.url = self._client.format_url(request_copy.url)
150+
return self._client.send_request(request_copy, **kwargs)
172151

173152
def close(self):
174153
# type: () -> None

0 commit comments

Comments
 (0)