Skip to content

Commit 2ca876c

Browse files
author
SDKAuto
committed
CodeGen from PR 17189 in Azure/azure-rest-api-specs
Merge 62cccf308c092d22c0da66d18e4e3a55014dc551 into 30fca88
1 parent bc99c22 commit 2ca876c

File tree

56 files changed

+34789
-56376
lines changed

Some content is hidden

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

56 files changed

+34789
-56376
lines changed
Lines changed: 5 additions & 5 deletions
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": "945bb83f8a6541a32ca190e7b0a86cac4299a6e3",
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 --python3-only --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

Lines changed: 4 additions & 5 deletions
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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@
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 typing import Any, TYPE_CHECKING
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

1717
if TYPE_CHECKING:
1818
# pylint: disable=unused-import,ungrouped-imports
19-
from typing import Any
20-
2119
from azure.core.credentials import TokenCredential
2220

2321

@@ -35,16 +33,15 @@ class DataFactoryManagementClientConfiguration(Configuration):
3533

3634
def __init__(
3735
self,
38-
credential, # type: "TokenCredential"
39-
subscription_id, # type: str
40-
**kwargs # type: Any
41-
):
42-
# type: (...) -> None
36+
credential: "TokenCredential",
37+
subscription_id: str,
38+
**kwargs: Any
39+
) -> None:
40+
super(DataFactoryManagementClientConfiguration, self).__init__(**kwargs)
4341
if credential is None:
4442
raise ValueError("Parameter 'credential' must not be None.")
4543
if subscription_id is None:
4644
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(DataFactoryManagementClientConfiguration, self).__init__(**kwargs)
4845

4946
self.credential = credential
5047
self.subscription_id = subscription_id
@@ -68,4 +65,4 @@ def _configure(
6865
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6966
self.authentication_policy = kwargs.get('authentication_policy')
7067
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
68+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

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

Lines changed: 80 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,22 @@
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
1113
from azure.mgmt.core import ARMPipelineClient
1214
from msrest import Deserializer, Serializer
1315

16+
from . import models
17+
from ._configuration import DataFactoryManagementClientConfiguration
18+
from .operations import ActivityRunsOperations, DataFlowDebugSessionOperations, DataFlowsOperations, DatasetsOperations, ExposureControlOperations, FactoriesOperations, IntegrationRuntimeNodesOperations, IntegrationRuntimeObjectMetadataOperations, IntegrationRuntimesOperations, LinkedServicesOperations, ManagedPrivateEndpointsOperations, ManagedVirtualNetworksOperations, Operations, PipelineRunsOperations, PipelinesOperations, PrivateEndPointConnectionsOperations, PrivateEndpointConnectionOperations, PrivateLinkResourcesOperations, TriggerRunsOperations, TriggersOperations
19+
1420
if TYPE_CHECKING:
1521
# pylint: disable=unused-import,ungrouped-imports
16-
from typing import Any, Optional
17-
1822
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-
4423

45-
class DataFactoryManagementClient(object):
24+
class DataFactoryManagementClient:
4625
"""The Azure Data Factory V2 management API provides a RESTful set of web services that interact with Azure Data Factory V2 services.
4726
4827
:ivar operations: Operations operations
@@ -53,10 +32,13 @@ class DataFactoryManagementClient(object):
5332
:vartype exposure_control: azure.mgmt.datafactory.operations.ExposureControlOperations
5433
:ivar integration_runtimes: IntegrationRuntimesOperations operations
5534
: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
35+
:ivar integration_runtime_object_metadata: IntegrationRuntimeObjectMetadataOperations
36+
operations
37+
:vartype integration_runtime_object_metadata:
38+
azure.mgmt.datafactory.operations.IntegrationRuntimeObjectMetadataOperations
5839
:ivar integration_runtime_nodes: IntegrationRuntimeNodesOperations operations
59-
:vartype integration_runtime_nodes: azure.mgmt.datafactory.operations.IntegrationRuntimeNodesOperations
40+
:vartype integration_runtime_nodes:
41+
azure.mgmt.datafactory.operations.IntegrationRuntimeNodesOperations
6042
:ivar linked_services: LinkedServicesOperations operations
6143
:vartype linked_services: azure.mgmt.datafactory.operations.LinkedServicesOperations
6244
:ivar datasets: DatasetsOperations operations
@@ -74,101 +56,94 @@ class DataFactoryManagementClient(object):
7456
:ivar data_flows: DataFlowsOperations operations
7557
:vartype data_flows: azure.mgmt.datafactory.operations.DataFlowsOperations
7658
:ivar data_flow_debug_session: DataFlowDebugSessionOperations operations
77-
:vartype data_flow_debug_session: azure.mgmt.datafactory.operations.DataFlowDebugSessionOperations
59+
:vartype data_flow_debug_session:
60+
azure.mgmt.datafactory.operations.DataFlowDebugSessionOperations
7861
:ivar managed_virtual_networks: ManagedVirtualNetworksOperations operations
79-
:vartype managed_virtual_networks: azure.mgmt.datafactory.operations.ManagedVirtualNetworksOperations
62+
:vartype managed_virtual_networks:
63+
azure.mgmt.datafactory.operations.ManagedVirtualNetworksOperations
8064
:ivar managed_private_endpoints: ManagedPrivateEndpointsOperations operations
81-
:vartype managed_private_endpoints: azure.mgmt.datafactory.operations.ManagedPrivateEndpointsOperations
65+
:vartype managed_private_endpoints:
66+
azure.mgmt.datafactory.operations.ManagedPrivateEndpointsOperations
8267
:ivar private_end_point_connections: PrivateEndPointConnectionsOperations operations
83-
:vartype private_end_point_connections: azure.mgmt.datafactory.operations.PrivateEndPointConnectionsOperations
68+
:vartype private_end_point_connections:
69+
azure.mgmt.datafactory.operations.PrivateEndPointConnectionsOperations
8470
:ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations
85-
:vartype private_endpoint_connection: azure.mgmt.datafactory.operations.PrivateEndpointConnectionOperations
71+
:vartype private_endpoint_connection:
72+
azure.mgmt.datafactory.operations.PrivateEndpointConnectionOperations
8673
:ivar private_link_resources: PrivateLinkResourcesOperations operations
87-
:vartype private_link_resources: azure.mgmt.datafactory.operations.PrivateLinkResourcesOperations
74+
:vartype private_link_resources:
75+
azure.mgmt.datafactory.operations.PrivateLinkResourcesOperations
8876
:param credential: Credential needed for the client to connect to Azure.
8977
:type credential: ~azure.core.credentials.TokenCredential
9078
:param subscription_id: The subscription identifier.
9179
: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.
80+
:param base_url: Service URL. Default value is 'https://management.azure.com'.
81+
:type base_url: str
82+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
83+
Retry-After header is present.
9484
"""
9585

9686
def __init__(
9787
self,
98-
credential, # type: "TokenCredential"
99-
subscription_id, # type: str
100-
base_url=None, # type: Optional[str]
101-
**kwargs # type: Any
102-
):
103-
# type: (...) -> None
104-
if not base_url:
105-
base_url = 'https://management.azure.com'
106-
self._config = DataFactoryManagementClientConfiguration(credential, subscription_id, **kwargs)
88+
credential: "TokenCredential",
89+
subscription_id: str,
90+
base_url: str = "https://management.azure.com",
91+
**kwargs: Any
92+
) -> None:
93+
self._config = DataFactoryManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
10794
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
10895

10996
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
11097
self._serialize = Serializer(client_models)
111-
self._serialize.client_side_validation = False
11298
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
99+
self._serialize.client_side_validation = False
100+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
101+
self.factories = FactoriesOperations(self._client, self._config, self._serialize, self._deserialize)
102+
self.exposure_control = ExposureControlOperations(self._client, self._config, self._serialize, self._deserialize)
103+
self.integration_runtimes = IntegrationRuntimesOperations(self._client, self._config, self._serialize, self._deserialize)
104+
self.integration_runtime_object_metadata = IntegrationRuntimeObjectMetadataOperations(self._client, self._config, self._serialize, self._deserialize)
105+
self.integration_runtime_nodes = IntegrationRuntimeNodesOperations(self._client, self._config, self._serialize, self._deserialize)
106+
self.linked_services = LinkedServicesOperations(self._client, self._config, self._serialize, self._deserialize)
107+
self.datasets = DatasetsOperations(self._client, self._config, self._serialize, self._deserialize)
108+
self.pipelines = PipelinesOperations(self._client, self._config, self._serialize, self._deserialize)
109+
self.pipeline_runs = PipelineRunsOperations(self._client, self._config, self._serialize, self._deserialize)
110+
self.activity_runs = ActivityRunsOperations(self._client, self._config, self._serialize, self._deserialize)
111+
self.triggers = TriggersOperations(self._client, self._config, self._serialize, self._deserialize)
112+
self.trigger_runs = TriggerRunsOperations(self._client, self._config, self._serialize, self._deserialize)
113+
self.data_flows = DataFlowsOperations(self._client, self._config, self._serialize, self._deserialize)
114+
self.data_flow_debug_session = DataFlowDebugSessionOperations(self._client, self._config, self._serialize, self._deserialize)
115+
self.managed_virtual_networks = ManagedVirtualNetworksOperations(self._client, self._config, self._serialize, self._deserialize)
116+
self.managed_private_endpoints = ManagedPrivateEndpointsOperations(self._client, self._config, self._serialize, self._deserialize)
117+
self.private_end_point_connections = PrivateEndPointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
118+
self.private_endpoint_connection = PrivateEndpointConnectionOperations(self._client, self._config, self._serialize, self._deserialize)
119+
self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
120+
121+
122+
def _send_request(
123+
self,
124+
request, # type: HttpRequest
125+
**kwargs: Any
126+
) -> HttpResponse:
157127
"""Runs the network request through the client's chained policies.
158128
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.
129+
>>> from azure.core.rest import HttpRequest
130+
>>> request = HttpRequest("GET", "https://www.example.org/")
131+
<HttpRequest [GET], url: 'https://www.example.org/'>
132+
>>> response = client._send_request(request)
133+
<HttpResponse: 200 OK>
134+
135+
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
136+
137+
:param request: The network request you want to make. Required.
138+
:type request: ~azure.core.rest.HttpRequest
139+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
162140
:return: The response of your network call. Does not do error handling on your response.
163-
:rtype: ~azure.core.pipeline.transport.HttpResponse
141+
:rtype: ~azure.core.rest.HttpResponse
164142
"""
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
143+
144+
request_copy = deepcopy(request)
145+
request_copy.url = self._client.format_url(request_copy.url)
146+
return self._client.send_request(request_copy, **kwargs)
172147

173148
def close(self):
174149
# type: () -> None

0 commit comments

Comments
 (0)