Skip to content

Commit 4617007

Browse files
azure-sdkmsyycCopilot
authored
Refresh azure-mgmt-datafactory after migrate to Typespec (#47198)
* Configurations: 'specification/datafactory/resource-manager/Microsoft.DataFactory/DataFactory/tspconfig.yaml', API Version: 2018-06-01, SDK Release Type: beta, and CommitSHA: '5c7cd01768cc4a537f309dff14af7be34f87cd14' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6364067 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Optimize changelog for azure-mgmt-datafactory Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add live tests for azure-mgmt-datafactory Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * update test case * Consolidate unused models/enums in changelog Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * update changelog --------- Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6250a49 commit 4617007

241 files changed

Lines changed: 104496 additions & 108421 deletions

File tree

Some content is hidden

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

sdk/datafactory/azure-mgmt-datafactory/CHANGELOG.md

Lines changed: 351 additions & 0 deletions
Large diffs are not rendered by default.

sdk/datafactory/azure-mgmt-datafactory/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Data Factory Management Client Library.
4-
This package has been tested with Python 3.9+.
4+
This package has been tested with Python 3.10+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.9+ is required to use this package.
15+
- Python 3.10+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
2-
"commit": "31c0f92613ba340053694ed55714a6f40f4fd7de",
2+
"apiVersion": "2018-06-01",
3+
"apiVersions": {
4+
"Microsoft.DataFactory": "2018-06-01"
5+
},
6+
"commit": "5c7cd01768cc4a537f309dff14af7be34f87cd14",
37
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.10.2",
5-
"use": [
6-
"@autorest/python@6.48.0",
7-
"@autorest/modelerfour@4.27.0"
8-
],
9-
"autorest_command": "autorest specification/datafactory/resource-manager/Microsoft.DataFactory/DataFactory/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.48.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
10-
"readme": "specification/datafactory/resource-manager/Microsoft.DataFactory/DataFactory/readme.md"
8+
"typespec_src": "specification/datafactory/resource-manager/Microsoft.DataFactory/DataFactory",
9+
"emitterVersion": "0.62.1"
1110
}

sdk/datafactory/azure-mgmt-datafactory/apiview-properties.json

Lines changed: 1366 additions & 1149 deletions
Large diffs are not rendered by default.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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
# pylint: disable=wrong-import-position
@@ -12,7 +12,7 @@
1212
if TYPE_CHECKING:
1313
from ._patch import * # pylint: disable=unused-wildcard-import
1414

15-
from ._data_factory_management_client import DataFactoryManagementClient # type: ignore
15+
from ._client import DataFactoryManagementClient # type: ignore
1616
from ._version import VERSION
1717

1818
__version__ = VERSION

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_data_factory_management_client.py renamed to sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_client.py

Lines changed: 54 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
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

99
from copy import deepcopy
10+
import sys
1011
from typing import Any, Optional, TYPE_CHECKING, cast
11-
from typing_extensions import Self
1212

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import HttpRequest, HttpResponse
@@ -17,7 +17,6 @@
1717
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1818
from azure.mgmt.core.tools import get_arm_endpoints
1919

20-
from . import models as _models
2120
from ._configuration import DataFactoryManagementClientConfiguration
2221
from ._utils.serialization import Deserializer, Serializer
2322
from .operations import (
@@ -47,21 +46,39 @@
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+
5054
if TYPE_CHECKING:
5155
from azure.core import AzureClouds
5256
from azure.core.credentials import TokenCredential
5357

5458

5559
class 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:

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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

@@ -24,22 +24,26 @@ class DataFactoryManagementClientConfiguration: # pylint: disable=too-many-inst
2424
Note that all parameters used to create this instance are saved as instance
2525
attributes.
2626
27-
:param credential: Credential needed for the client to connect to Azure. Required.
27+
:param credential: Credential used to authenticate requests to the service. Required.
2828
:type credential: ~azure.core.credentials.TokenCredential
29-
:param subscription_id: The subscription identifier. Required.
29+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3030
:type subscription_id: str
31+
:param base_url: Service host. Default value is "https://management.azure.com".
32+
:type base_url: str
3133
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
3234
None.
3335
:type cloud_setting: ~azure.core.AzureClouds
34-
:keyword api_version: Api Version. Default value is "2018-06-01". Note that overriding this
35-
default value may result in unsupported behavior.
36+
:keyword api_version: The API version to use for this operation. Known values are "2018-06-01"
37+
and None. Default value is None. If not set, the operation's default API version will be used.
38+
Note that overriding this default value may result in unsupported behavior.
3639
:paramtype api_version: str
3740
"""
3841

3942
def __init__(
4043
self,
4144
credential: "TokenCredential",
4245
subscription_id: str,
46+
base_url: str = "https://management.azure.com",
4347
cloud_setting: Optional["AzureClouds"] = None,
4448
**kwargs: Any
4549
) -> None:
@@ -52,6 +56,7 @@ def __init__(
5256

5357
self.credential = credential
5458
self.subscription_id = subscription_id
59+
self.base_url = base_url
5560
self.cloud_setting = cloud_setting
5661
self.api_version = api_version
5762
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])

0 commit comments

Comments
 (0)