Skip to content

Commit 728f58a

Browse files
author
SDKAuto
committed
CodeGen from PR 25789 in Azure/azure-rest-api-specs
Merge 68b631b1461142c10212515706f75478c9742b1e into 3d59aae5716739a772ed9f1c5376f0d9005e1c4e
1 parent 377e9d2 commit 728f58a

File tree

89 files changed

+6694
-2562
lines changed

Some content is hidden

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

89 files changed

+6694
-2562
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "d70ba571ddb519a63aa2ad96a96faff04647f81c",
2+
"commit": "0e0fd616184236b24b9b7802fa39088eda0205e3",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.4.0",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.7.1",
7+
"@autorest/modelerfour@4.26.2"
88
],
9-
"autorest_command": "autorest specification/datafactory/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/datafactory/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/datafactory/resource-manager/readme.md"
1111
}

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
import sys
109
from typing import Any, TYPE_CHECKING
1110

1211
from azure.core.configuration import Configuration
@@ -15,11 +14,6 @@
1514

1615
from ._version import VERSION
1716

18-
if sys.version_info >= (3, 8):
19-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20-
else:
21-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22-
2317
if TYPE_CHECKING:
2418
# pylint: disable=unused-import,ungrouped-imports
2519
from azure.core.credentials import TokenCredential
@@ -42,7 +36,7 @@ class DataFactoryManagementClientConfiguration(Configuration): # pylint: disabl
4236

4337
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4438
super(DataFactoryManagementClientConfiguration, self).__init__(**kwargs)
45-
api_version: Literal["2018-06-01"] = kwargs.pop("api_version", "2018-06-01")
39+
api_version: str = kwargs.pop("api_version", "2018-06-01")
4640

4741
if credential is None:
4842
raise ValueError("Parameter 'credential' must not be None.")

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from ._serialization import Deserializer, Serializer
1818
from .operations import (
1919
ActivityRunsOperations,
20+
ChangeDataCaptureOperations,
2021
CredentialOperationsOperations,
2122
DataFlowDebugSessionOperations,
2223
DataFlowsOperations,
@@ -103,6 +104,8 @@ class DataFactoryManagementClient: # pylint: disable=client-accepts-api-version
103104
azure.mgmt.datafactory.operations.PrivateLinkResourcesOperations
104105
:ivar global_parameters: GlobalParametersOperations operations
105106
:vartype global_parameters: azure.mgmt.datafactory.operations.GlobalParametersOperations
107+
:ivar change_data_capture: ChangeDataCaptureOperations operations
108+
:vartype change_data_capture: azure.mgmt.datafactory.operations.ChangeDataCaptureOperations
106109
:param credential: Credential needed for the client to connect to Azure. Required.
107110
:type credential: ~azure.core.credentials.TokenCredential
108111
:param subscription_id: The subscription identifier. Required.
@@ -126,7 +129,7 @@ def __init__(
126129
self._config = DataFactoryManagementClientConfiguration(
127130
credential=credential, subscription_id=subscription_id, **kwargs
128131
)
129-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
132+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
130133

131134
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
132135
self._serialize = Serializer(client_models)
@@ -178,6 +181,9 @@ def __init__(
178181
self.global_parameters = GlobalParametersOperations(
179182
self._client, self._config, self._serialize, self._deserialize
180183
)
184+
self.change_data_capture = ChangeDataCaptureOperations(
185+
self._client, self._config, self._serialize, self._deserialize
186+
)
181187

182188
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
183189
"""Runs the network request through the client's chained policies.

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

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
629629
if xml_desc.get("attr", False):
630630
if xml_ns:
631631
ET.register_namespace(xml_prefix, xml_ns)
632-
xml_name = "{}{}".format(xml_ns, xml_name)
632+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
633633
serialized.set(xml_name, new_attr) # type: ignore
634634
continue
635635
if xml_desc.get("text", False):
@@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
662662
_serialized.update(_new_attr) # type: ignore
663663
_new_attr = _new_attr[k] # type: ignore
664664
_serialized = _serialized[k]
665-
except ValueError:
666-
continue
665+
except ValueError as err:
666+
if isinstance(err, SerializationError):
667+
raise
667668

668669
except (AttributeError, KeyError, TypeError) as err:
669670
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
@@ -741,6 +742,8 @@ def query(self, name, data, data_type, **kwargs):
741742
742743
:param data: The data to be serialized.
743744
:param str data_type: The type to be serialized from.
745+
:keyword bool skip_quote: Whether to skip quote the serialized result.
746+
Defaults to False.
744747
:rtype: str
745748
:raises: TypeError if serialization fails.
746749
:raises: ValueError if data is None
@@ -749,10 +752,8 @@ def query(self, name, data, data_type, **kwargs):
749752
# Treat the list aside, since we don't want to encode the div separator
750753
if data_type.startswith("["):
751754
internal_data_type = data_type[1:-1]
752-
data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data]
753-
if not kwargs.get("skip_quote", False):
754-
data = [quote(str(d), safe="") for d in data]
755-
return str(self.serialize_iter(data, internal_data_type, **kwargs))
755+
do_quote = not kwargs.get("skip_quote", False)
756+
return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs))
756757

757758
# Not a list, regular serialization
758759
output = self.serialize_data(data, data_type, **kwargs)
@@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
891892
not be None or empty.
892893
:param str div: If set, this str will be used to combine the elements
893894
in the iterable into a combined string. Default is 'None'.
895+
:keyword bool do_quote: Whether to quote the serialized result of each iterable element.
896+
Defaults to False.
894897
:rtype: list, str
895898
"""
896899
if isinstance(data, str):
@@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
903906
for d in data:
904907
try:
905908
serialized.append(self.serialize_data(d, iter_type, **kwargs))
906-
except ValueError:
909+
except ValueError as err:
910+
if isinstance(err, SerializationError):
911+
raise
907912
serialized.append(None)
908913

914+
if kwargs.get("do_quote", False):
915+
serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
916+
909917
if div:
910918
serialized = ["" if s is None else str(s) for s in serialized]
911919
serialized = div.join(serialized)
@@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs):
950958
for key, value in attr.items():
951959
try:
952960
serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs)
953-
except ValueError:
961+
except ValueError as err:
962+
if isinstance(err, SerializationError):
963+
raise
954964
serialized[self.serialize_unicode(key)] = None
955965

956966
if "xml" in serialization_ctxt:
@@ -1271,7 +1281,7 @@ def _extract_name_from_internal_type(internal_type):
12711281
xml_name = internal_type_xml_map.get("name", internal_type.__name__)
12721282
xml_ns = internal_type_xml_map.get("ns", None)
12731283
if xml_ns:
1274-
xml_name = "{}{}".format(xml_ns, xml_name)
1284+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
12751285
return xml_name
12761286

12771287

@@ -1295,7 +1305,7 @@ def xml_key_extractor(attr, attr_desc, data):
12951305
# Integrate namespace if necessary
12961306
xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None))
12971307
if xml_ns:
1298-
xml_name = "{}{}".format(xml_ns, xml_name)
1308+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
12991309

13001310
# If it's an attribute, that's simple
13011311
if xml_desc.get("attr", False):

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
66
# --------------------------------------------------------------------------
77

8-
from typing import List, cast
9-
108
from azure.core.pipeline.transport import HttpRequest
119

1210

@@ -16,15 +14,3 @@ def _convert_request(request, files=None):
1614
if files:
1715
request.set_formdata_body(files)
1816
return request
19-
20-
21-
def _format_url_section(template, **kwargs):
22-
components = template.split("/")
23-
while components:
24-
try:
25-
return template.format(**kwargs)
26-
except KeyError as key:
27-
# Need the cast, as for some reasons "split" is typed as list[str | Any]
28-
formatted_components = cast(List[str], template.split("/"))
29-
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
30-
template = "/".join(components)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "3.1.0"
9+
VERSION = "1.0.0"

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
import sys
109
from typing import Any, TYPE_CHECKING
1110

1211
from azure.core.configuration import Configuration
@@ -15,11 +14,6 @@
1514

1615
from .._version import VERSION
1716

18-
if sys.version_info >= (3, 8):
19-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20-
else:
21-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22-
2317
if TYPE_CHECKING:
2418
# pylint: disable=unused-import,ungrouped-imports
2519
from azure.core.credentials_async import AsyncTokenCredential
@@ -42,7 +36,7 @@ class DataFactoryManagementClientConfiguration(Configuration): # pylint: disabl
4236

4337
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
4438
super(DataFactoryManagementClientConfiguration, self).__init__(**kwargs)
45-
api_version: Literal["2018-06-01"] = kwargs.pop("api_version", "2018-06-01")
39+
api_version: str = kwargs.pop("api_version", "2018-06-01")
4640

4741
if credential is None:
4842
raise ValueError("Parameter 'credential' must not be None.")

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from ._configuration import DataFactoryManagementClientConfiguration
1818
from .operations import (
1919
ActivityRunsOperations,
20+
ChangeDataCaptureOperations,
2021
CredentialOperationsOperations,
2122
DataFlowDebugSessionOperations,
2223
DataFlowsOperations,
@@ -104,6 +105,8 @@ class DataFactoryManagementClient: # pylint: disable=client-accepts-api-version
104105
azure.mgmt.datafactory.aio.operations.PrivateLinkResourcesOperations
105106
:ivar global_parameters: GlobalParametersOperations operations
106107
:vartype global_parameters: azure.mgmt.datafactory.aio.operations.GlobalParametersOperations
108+
:ivar change_data_capture: ChangeDataCaptureOperations operations
109+
:vartype change_data_capture: azure.mgmt.datafactory.aio.operations.ChangeDataCaptureOperations
107110
:param credential: Credential needed for the client to connect to Azure. Required.
108111
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
109112
:param subscription_id: The subscription identifier. Required.
@@ -127,7 +130,7 @@ def __init__(
127130
self._config = DataFactoryManagementClientConfiguration(
128131
credential=credential, subscription_id=subscription_id, **kwargs
129132
)
130-
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
133+
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
131134

132135
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
133136
self._serialize = Serializer(client_models)
@@ -179,6 +182,9 @@ def __init__(
179182
self.global_parameters = GlobalParametersOperations(
180183
self._client, self._config, self._serialize, self._deserialize
181184
)
185+
self.change_data_capture = ChangeDataCaptureOperations(
186+
self._client, self._config, self._serialize, self._deserialize
187+
)
182188

183189
def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
184190
"""Runs the network request through the client's chained policies.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from ._private_endpoint_connection_operations import PrivateEndpointConnectionOperations
2929
from ._private_link_resources_operations import PrivateLinkResourcesOperations
3030
from ._global_parameters_operations import GlobalParametersOperations
31+
from ._change_data_capture_operations import ChangeDataCaptureOperations
3132

3233
from ._patch import __all__ as _patch_all
3334
from ._patch import * # pylint: disable=unused-wildcard-import
@@ -56,6 +57,7 @@
5657
"PrivateEndpointConnectionOperations",
5758
"PrivateLinkResourcesOperations",
5859
"GlobalParametersOperations",
60+
"ChangeDataCaptureOperations",
5961
]
6062
__all__.extend([p for p in _patch_all if p not in __all__])
6163
_patch_sdk()

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/operations/_activity_runs_operations.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Code generated by Microsoft (R) AutoRest Code Generator.
77
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
88
# --------------------------------------------------------------------------
9-
import sys
9+
from io import IOBase
1010
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
1111

1212
from azure.core.exceptions import (
@@ -28,10 +28,6 @@
2828
from ..._vendor import _convert_request
2929
from ...operations._activity_runs_operations import build_query_by_pipeline_run_request
3030

31-
if sys.version_info >= (3, 8):
32-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
33-
else:
34-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
3531
T = TypeVar("T")
3632
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
3733

@@ -154,16 +150,14 @@ async def query_by_pipeline_run(
154150
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
155151
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
156152

157-
api_version: Literal["2018-06-01"] = kwargs.pop(
158-
"api_version", _params.pop("api-version", self._config.api_version)
159-
)
153+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
160154
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
161155
cls: ClsType[_models.ActivityRunsQueryResponse] = kwargs.pop("cls", None)
162156

163157
content_type = content_type or "application/json"
164158
_json = None
165159
_content = None
166-
if isinstance(filter_parameters, (IO, bytes)):
160+
if isinstance(filter_parameters, (IOBase, bytes)):
167161
_content = filter_parameters
168162
else:
169163
_json = self._serialize.body(filter_parameters, "RunFilterParameters")
@@ -184,8 +178,9 @@ async def query_by_pipeline_run(
184178
request = _convert_request(request)
185179
request.url = self._client.format_url(request.url)
186180

181+
_stream = False
187182
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
188-
request, stream=False, **kwargs
183+
request, stream=_stream, **kwargs
189184
)
190185

191186
response = pipeline_response.http_response

0 commit comments

Comments
 (0)