Skip to content

Commit 72a7103

Browse files
author
SDKAuto
committed
CodeGen from PR 3590 in test-repo-billy/azure-rest-api-specs
Merge bba679c7e712e86f7bf3c1aee4c0f00a99b1efde into 303e50ce42c8416bbd1bda5af623498501a5ada5
1 parent fac5c4e commit 72a7103

18 files changed

+61
-950
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "f06cffbda682a8cd225a8b16bc6f000d26d01612",
3-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
2+
"commit": "8430663f244cc1158781ee2ebb451a22d0e48161",
3+
"repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.26.4",
6+
"@autorest/python@6.27.4",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/datafactory/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.26.4 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/datafactory/resource-manager/readme.md --generate-sample=True --generate-test=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.27.4 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/datafactory/resource-manager/readme.md"
1111
}

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
LinkedServicesOperations,
3535
ManagedPrivateEndpointsOperations,
3636
ManagedVirtualNetworksOperations,
37-
Operations,
3837
PipelineRunsOperations,
3938
PipelinesOperations,
4039
PrivateEndPointConnectionsOperations,
@@ -52,12 +51,10 @@ class DataFactoryManagementClient: # pylint: disable=too-many-instance-attribut
5251
"""The Azure Data Factory V2 management API provides a RESTful set of web services that interact
5352
with Azure Data Factory V2 services.
5453
55-
:ivar operations: Operations operations
56-
:vartype operations: azure.mgmt.datafactory.operations.Operations
57-
:ivar factories: FactoriesOperations operations
58-
:vartype factories: azure.mgmt.datafactory.operations.FactoriesOperations
5954
:ivar exposure_control: ExposureControlOperations operations
6055
:vartype exposure_control: azure.mgmt.datafactory.operations.ExposureControlOperations
56+
:ivar factories: FactoriesOperations operations
57+
:vartype factories: azure.mgmt.datafactory.operations.FactoriesOperations
6158
:ivar integration_runtimes: IntegrationRuntimesOperations operations
6259
:vartype integration_runtimes: azure.mgmt.datafactory.operations.IntegrationRuntimesOperations
6360
:ivar integration_runtime_object_metadata: IntegrationRuntimeObjectMetadataOperations
@@ -155,11 +152,10 @@ def __init__(
155152
self._serialize = Serializer(client_models)
156153
self._deserialize = Deserializer(client_models)
157154
self._serialize.client_side_validation = False
158-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
159-
self.factories = FactoriesOperations(self._client, self._config, self._serialize, self._deserialize)
160155
self.exposure_control = ExposureControlOperations(
161156
self._client, self._config, self._serialize, self._deserialize
162157
)
158+
self.factories = FactoriesOperations(self._client, self._config, self._serialize, self._deserialize)
163159
self.integration_runtimes = IntegrationRuntimesOperations(
164160
self._client, self._config, self._serialize, self._deserialize
165161
)

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def _create_xml_node(tag, prefix=None, ns=None):
310310
return ET.Element(tag)
311311

312312

313-
class Model(object):
313+
class Model:
314314
"""Mixin for all client request body/response body models to support
315315
serialization and deserialization.
316316
"""
@@ -563,7 +563,7 @@ def _decode_attribute_map_key(key):
563563
return key.replace("\\.", ".")
564564

565565

566-
class Serializer(object): # pylint: disable=too-many-public-methods
566+
class Serializer: # pylint: disable=too-many-public-methods
567567
"""Request object model serializer."""
568568

569569
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -1441,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
14411441
return children[0]
14421442

14431443

1444-
class Deserializer(object):
1444+
class Deserializer:
14451445
"""Response object model deserializer.
14461446
14471447
:param dict classes: Class type dictionary for deserializing complex types.
@@ -1683,17 +1683,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
16831683
subtype = getattr(response, "_subtype_map", {})
16841684
try:
16851685
readonly = [
1686-
k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access
1686+
k
1687+
for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
1688+
if v.get("readonly")
16871689
]
16881690
const = [
1689-
k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
1691+
k
1692+
for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
1693+
if v.get("constant")
16901694
]
16911695
kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const}
16921696
response_obj = response(**kwargs)
16931697
for attr in readonly:
16941698
setattr(response_obj, attr, attrs.get(attr))
16951699
if additional_properties:
1696-
response_obj.additional_properties = additional_properties
1700+
response_obj.additional_properties = additional_properties # type: ignore
16971701
return response_obj
16981702
except TypeError as err:
16991703
msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore

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 = "9.1.0"
9+
VERSION = "1.0.0"

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
LinkedServicesOperations,
3535
ManagedPrivateEndpointsOperations,
3636
ManagedVirtualNetworksOperations,
37-
Operations,
3837
PipelineRunsOperations,
3938
PipelinesOperations,
4039
PrivateEndPointConnectionsOperations,
@@ -52,12 +51,10 @@ class DataFactoryManagementClient: # pylint: disable=too-many-instance-attribut
5251
"""The Azure Data Factory V2 management API provides a RESTful set of web services that interact
5352
with Azure Data Factory V2 services.
5453
55-
:ivar operations: Operations operations
56-
:vartype operations: azure.mgmt.datafactory.aio.operations.Operations
57-
:ivar factories: FactoriesOperations operations
58-
:vartype factories: azure.mgmt.datafactory.aio.operations.FactoriesOperations
5954
:ivar exposure_control: ExposureControlOperations operations
6055
:vartype exposure_control: azure.mgmt.datafactory.aio.operations.ExposureControlOperations
56+
:ivar factories: FactoriesOperations operations
57+
:vartype factories: azure.mgmt.datafactory.aio.operations.FactoriesOperations
6158
:ivar integration_runtimes: IntegrationRuntimesOperations operations
6259
:vartype integration_runtimes:
6360
azure.mgmt.datafactory.aio.operations.IntegrationRuntimesOperations
@@ -156,11 +153,10 @@ def __init__(
156153
self._serialize = Serializer(client_models)
157154
self._deserialize = Deserializer(client_models)
158155
self._serialize.client_side_validation = False
159-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
160-
self.factories = FactoriesOperations(self._client, self._config, self._serialize, self._deserialize)
161156
self.exposure_control = ExposureControlOperations(
162157
self._client, self._config, self._serialize, self._deserialize
163158
)
159+
self.factories = FactoriesOperations(self._client, self._config, self._serialize, self._deserialize)
164160
self.integration_runtimes = IntegrationRuntimesOperations(
165161
self._client, self._config, self._serialize, self._deserialize
166162
)

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
if TYPE_CHECKING:
1313
from ._patch import * # pylint: disable=unused-wildcard-import
1414

15-
from ._operations import Operations # type: ignore
16-
from ._factories_operations import FactoriesOperations # type: ignore
1715
from ._exposure_control_operations import ExposureControlOperations # type: ignore
16+
from ._factories_operations import FactoriesOperations # type: ignore
1817
from ._integration_runtimes_operations import IntegrationRuntimesOperations # type: ignore
1918
from ._integration_runtime_object_metadata_operations import IntegrationRuntimeObjectMetadataOperations # type: ignore
2019
from ._integration_runtime_nodes_operations import IntegrationRuntimeNodesOperations # type: ignore
@@ -41,9 +40,8 @@
4140
from ._patch import patch_sdk as _patch_sdk
4241

4342
__all__ = [
44-
"Operations",
45-
"FactoriesOperations",
4643
"ExposureControlOperations",
44+
"FactoriesOperations",
4745
"IntegrationRuntimesOperations",
4846
"IntegrationRuntimeObjectMetadataOperations",
4947
"IntegrationRuntimeNodesOperations",

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

Lines changed: 0 additions & 185 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@
2828

2929
from ... import models as _models
3030
from ...operations._factories_operations import (
31-
build_configure_factory_repo_request,
3231
build_create_or_update_request,
3332
build_delete_request,
3433
build_get_data_plane_access_request,
3534
build_get_git_hub_access_token_request,
3635
build_get_request,
3736
build_list_by_resource_group_request,
38-
build_list_request,
3937
build_update_request,
4038
)
4139

@@ -66,189 +64,6 @@ def __init__(self, *args, **kwargs) -> None:
6664
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
6765
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
6866

69-
@distributed_trace
70-
def list(self, **kwargs: Any) -> AsyncIterable["_models.Factory"]:
71-
"""Lists factories under the specified subscription.
72-
73-
:return: An iterator like instance of either Factory or the result of cls(response)
74-
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.Factory]
75-
:raises ~azure.core.exceptions.HttpResponseError:
76-
"""
77-
_headers = kwargs.pop("headers", {}) or {}
78-
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
79-
80-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
81-
cls: ClsType[_models.FactoryListResponse] = kwargs.pop("cls", None)
82-
83-
error_map: MutableMapping = {
84-
401: ClientAuthenticationError,
85-
404: ResourceNotFoundError,
86-
409: ResourceExistsError,
87-
304: ResourceNotModifiedError,
88-
}
89-
error_map.update(kwargs.pop("error_map", {}) or {})
90-
91-
def prepare_request(next_link=None):
92-
if not next_link:
93-
94-
_request = build_list_request(
95-
subscription_id=self._config.subscription_id,
96-
api_version=api_version,
97-
headers=_headers,
98-
params=_params,
99-
)
100-
_request.url = self._client.format_url(_request.url)
101-
102-
else:
103-
# make call to next link with the client's api-version
104-
_parsed_next_link = urllib.parse.urlparse(next_link)
105-
_next_request_params = case_insensitive_dict(
106-
{
107-
key: [urllib.parse.quote(v) for v in value]
108-
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
109-
}
110-
)
111-
_next_request_params["api-version"] = self._config.api_version
112-
_request = HttpRequest(
113-
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
114-
)
115-
_request.url = self._client.format_url(_request.url)
116-
_request.method = "GET"
117-
return _request
118-
119-
async def extract_data(pipeline_response):
120-
deserialized = self._deserialize("FactoryListResponse", pipeline_response)
121-
list_of_elem = deserialized.value
122-
if cls:
123-
list_of_elem = cls(list_of_elem) # type: ignore
124-
return deserialized.next_link or None, AsyncList(list_of_elem)
125-
126-
async def get_next(next_link=None):
127-
_request = prepare_request(next_link)
128-
129-
_stream = False
130-
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
131-
_request, stream=_stream, **kwargs
132-
)
133-
response = pipeline_response.http_response
134-
135-
if response.status_code not in [200]:
136-
map_error(status_code=response.status_code, response=response, error_map=error_map)
137-
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
138-
139-
return pipeline_response
140-
141-
return AsyncItemPaged(get_next, extract_data)
142-
143-
@overload
144-
async def configure_factory_repo(
145-
self,
146-
location_id: str,
147-
factory_repo_update: _models.FactoryRepoUpdate,
148-
*,
149-
content_type: str = "application/json",
150-
**kwargs: Any
151-
) -> _models.Factory:
152-
"""Updates a factory's repo information.
153-
154-
:param location_id: The location identifier. Required.
155-
:type location_id: str
156-
:param factory_repo_update: Update factory repo request definition. Required.
157-
:type factory_repo_update: ~azure.mgmt.datafactory.models.FactoryRepoUpdate
158-
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
159-
Default value is "application/json".
160-
:paramtype content_type: str
161-
:return: Factory or the result of cls(response)
162-
:rtype: ~azure.mgmt.datafactory.models.Factory
163-
:raises ~azure.core.exceptions.HttpResponseError:
164-
"""
165-
166-
@overload
167-
async def configure_factory_repo(
168-
self, location_id: str, factory_repo_update: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
169-
) -> _models.Factory:
170-
"""Updates a factory's repo information.
171-
172-
:param location_id: The location identifier. Required.
173-
:type location_id: str
174-
:param factory_repo_update: Update factory repo request definition. Required.
175-
:type factory_repo_update: IO[bytes]
176-
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
177-
Default value is "application/json".
178-
:paramtype content_type: str
179-
:return: Factory or the result of cls(response)
180-
:rtype: ~azure.mgmt.datafactory.models.Factory
181-
:raises ~azure.core.exceptions.HttpResponseError:
182-
"""
183-
184-
@distributed_trace_async
185-
async def configure_factory_repo(
186-
self, location_id: str, factory_repo_update: Union[_models.FactoryRepoUpdate, IO[bytes]], **kwargs: Any
187-
) -> _models.Factory:
188-
"""Updates a factory's repo information.
189-
190-
:param location_id: The location identifier. Required.
191-
:type location_id: str
192-
:param factory_repo_update: Update factory repo request definition. Is either a
193-
FactoryRepoUpdate type or a IO[bytes] type. Required.
194-
:type factory_repo_update: ~azure.mgmt.datafactory.models.FactoryRepoUpdate or IO[bytes]
195-
:return: Factory or the result of cls(response)
196-
:rtype: ~azure.mgmt.datafactory.models.Factory
197-
:raises ~azure.core.exceptions.HttpResponseError:
198-
"""
199-
error_map: MutableMapping = {
200-
401: ClientAuthenticationError,
201-
404: ResourceNotFoundError,
202-
409: ResourceExistsError,
203-
304: ResourceNotModifiedError,
204-
}
205-
error_map.update(kwargs.pop("error_map", {}) or {})
206-
207-
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
208-
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
209-
210-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
211-
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
212-
cls: ClsType[_models.Factory] = kwargs.pop("cls", None)
213-
214-
content_type = content_type or "application/json"
215-
_json = None
216-
_content = None
217-
if isinstance(factory_repo_update, (IOBase, bytes)):
218-
_content = factory_repo_update
219-
else:
220-
_json = self._serialize.body(factory_repo_update, "FactoryRepoUpdate")
221-
222-
_request = build_configure_factory_repo_request(
223-
location_id=location_id,
224-
subscription_id=self._config.subscription_id,
225-
api_version=api_version,
226-
content_type=content_type,
227-
json=_json,
228-
content=_content,
229-
headers=_headers,
230-
params=_params,
231-
)
232-
_request.url = self._client.format_url(_request.url)
233-
234-
_stream = False
235-
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
236-
_request, stream=_stream, **kwargs
237-
)
238-
239-
response = pipeline_response.http_response
240-
241-
if response.status_code not in [200]:
242-
map_error(status_code=response.status_code, response=response, error_map=error_map)
243-
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
244-
245-
deserialized = self._deserialize("Factory", pipeline_response.http_response)
246-
247-
if cls:
248-
return cls(pipeline_response, deserialized, {}) # type: ignore
249-
250-
return deserialized # type: ignore
251-
25267
@distributed_trace
25368
def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Factory"]:
25469
"""Lists factories.

0 commit comments

Comments
 (0)