Skip to content

Commit ed508d4

Browse files
author
SDKAuto
committed
CodeGen from PR 3330 in test-repo-billy/azure-rest-api-specs
Merge 39b325bd644dd489b69b1b889e9e5312dfb999a4 into 81c88e4fbc4fde08d14f7f3825933706bd6205d6
1 parent ae0a12d commit ed508d4

File tree

7 files changed

+20
-230
lines changed

7 files changed

+20
-230
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "9716e0c05a8c278ea44d8aa3f3b8ece46fb62ba2",
3-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
2+
"commit": "c2c4de6f0be3da0c86ab76190cffd1d421677ed1",
3+
"repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs",
44
"autorest": "3.9.7",
55
"use": [
66
"@autorest/[email protected]",
77
"@autorest/[email protected]"
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/[email protected] --use=@autorest/[email protected] --version=3.9.7 --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/[email protected] --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/datafactory/resource-manager/readme.md"
1111
}

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

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

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
build_get_git_hub_access_token_request,
3838
build_get_request,
3939
build_list_by_resource_group_request,
40-
build_list_request,
4140
build_update_request,
4241
)
4342

@@ -64,82 +63,6 @@ def __init__(self, *args, **kwargs) -> None:
6463
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
6564
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
6665

67-
@distributed_trace
68-
def list(self, **kwargs: Any) -> AsyncIterable["_models.Factory"]:
69-
"""Lists factories under the specified subscription.
70-
71-
:return: An iterator like instance of either Factory or the result of cls(response)
72-
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.Factory]
73-
:raises ~azure.core.exceptions.HttpResponseError:
74-
"""
75-
_headers = kwargs.pop("headers", {}) or {}
76-
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
77-
78-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
79-
cls: ClsType[_models.FactoryListResponse] = kwargs.pop("cls", None)
80-
81-
error_map = {
82-
401: ClientAuthenticationError,
83-
404: ResourceNotFoundError,
84-
409: ResourceExistsError,
85-
304: ResourceNotModifiedError,
86-
}
87-
error_map.update(kwargs.pop("error_map", {}) or {})
88-
89-
def prepare_request(next_link=None):
90-
if not next_link:
91-
92-
_request = build_list_request(
93-
subscription_id=self._config.subscription_id,
94-
api_version=api_version,
95-
headers=_headers,
96-
params=_params,
97-
)
98-
_request = _convert_request(_request)
99-
_request.url = self._client.format_url(_request.url)
100-
101-
else:
102-
# make call to next link with the client's api-version
103-
_parsed_next_link = urllib.parse.urlparse(next_link)
104-
_next_request_params = case_insensitive_dict(
105-
{
106-
key: [urllib.parse.quote(v) for v in value]
107-
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
108-
}
109-
)
110-
_next_request_params["api-version"] = self._config.api_version
111-
_request = HttpRequest(
112-
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
113-
)
114-
_request = _convert_request(_request)
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-
14366
@overload
14467
async def configure_factory_repo(
14568
self,

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/_data_factory_management_client_enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ class ScriptActivityParameterType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
809809

810810

811811
class ScriptType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
812-
"""The type of the query. Type: string."""
812+
"""The type of the ScriptActivityScriptBlock."""
813813

814814
QUERY = "Query"
815815
NON_QUERY = "NonQuery"

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/_models_py3.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38765,6 +38765,8 @@ class ManagedIdentityCredential(Credential):
3876538765
:vartype description: str
3876638766
:ivar annotations: List of tags that can be used for describing the Credential.
3876738767
:vartype annotations: list[JSON]
38768+
:ivar resource_id: The resource id of user assigned managed identity.
38769+
:vartype resource_id: str
3876838770
"""
3876938771

3877038772
_validation = {
@@ -38776,6 +38778,7 @@ class ManagedIdentityCredential(Credential):
3877638778
"type": {"key": "type", "type": "str"},
3877738779
"description": {"key": "description", "type": "str"},
3877838780
"annotations": {"key": "annotations", "type": "[object]"},
38781+
"resource_id": {"key": "typeProperties.resourceId", "type": "str"},
3877938782
}
3878038783

3878138784
def __init__(
@@ -38784,6 +38787,7 @@ def __init__(
3878438787
additional_properties: Optional[Dict[str, JSON]] = None,
3878538788
description: Optional[str] = None,
3878638789
annotations: Optional[List[JSON]] = None,
38790+
resource_id: Optional[str] = None,
3878738791
**kwargs: Any
3878838792
) -> None:
3878938793
"""
@@ -38794,11 +38798,14 @@ def __init__(
3879438798
:paramtype description: str
3879538799
:keyword annotations: List of tags that can be used for describing the Credential.
3879638800
:paramtype annotations: list[JSON]
38801+
:keyword resource_id: The resource id of user assigned managed identity.
38802+
:paramtype resource_id: str
3879738803
"""
3879838804
super().__init__(
3879938805
additional_properties=additional_properties, description=description, annotations=annotations, **kwargs
3880038806
)
3880138807
self.type: str = "ManagedIdentity"
38808+
self.resource_id = resource_id
3880238809

3880338810

3880438811
class ManagedIdentityCredentialResource(CredentialResource):
@@ -57548,9 +57555,9 @@ class ScriptActivityScriptBlock(_serialization.Model):
5754857555

5754957556
:ivar text: The query text. Type: string (or Expression with resultType string). Required.
5755057557
:vartype text: JSON
57551-
:ivar type: The type of the query. Type: string. Required. Known values are: "Query" and
57552-
"NonQuery".
57553-
:vartype type: str or ~azure.mgmt.datafactory.models.ScriptType
57558+
:ivar type: The type of the query. Please refer to the ScriptType for valid options. Type:
57559+
string (or Expression with resultType string). Required.
57560+
:vartype type: JSON
5755457561
:ivar parameters: Array of script parameters. Type: array.
5755557562
:vartype parameters: list[~azure.mgmt.datafactory.models.ScriptActivityParameter]
5755657563
"""
@@ -57562,24 +57569,24 @@ class ScriptActivityScriptBlock(_serialization.Model):
5756257569

5756357570
_attribute_map = {
5756457571
"text": {"key": "text", "type": "object"},
57565-
"type": {"key": "type", "type": "str"},
57572+
"type": {"key": "type", "type": "object"},
5756657573
"parameters": {"key": "parameters", "type": "[ScriptActivityParameter]"},
5756757574
}
5756857575

5756957576
def __init__(
5757057577
self,
5757157578
*,
5757257579
text: JSON,
57573-
type: Union[str, "_models.ScriptType"],
57580+
type: JSON,
5757457581
parameters: Optional[List["_models.ScriptActivityParameter"]] = None,
5757557582
**kwargs: Any
5757657583
) -> None:
5757757584
"""
5757857585
:keyword text: The query text. Type: string (or Expression with resultType string). Required.
5757957586
:paramtype text: JSON
57580-
:keyword type: The type of the query. Type: string. Required. Known values are: "Query" and
57581-
"NonQuery".
57582-
:paramtype type: str or ~azure.mgmt.datafactory.models.ScriptType
57587+
:keyword type: The type of the query. Please refer to the ScriptType for valid options. Type:
57588+
string (or Expression with resultType string). Required.
57589+
:paramtype type: JSON
5758357590
:keyword parameters: Array of script parameters. Type: array.
5758457591
:paramtype parameters: list[~azure.mgmt.datafactory.models.ScriptActivityParameter]
5758557592
"""

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

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,6 @@
3737
_SERIALIZER.client_side_validation = False
3838

3939

40-
def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest:
41-
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
42-
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
43-
44-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01"))
45-
accept = _headers.pop("Accept", "application/json")
46-
47-
# Construct URL
48-
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/factories")
49-
path_format_arguments = {
50-
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
51-
}
52-
53-
_url: str = _url.format(**path_format_arguments) # type: ignore
54-
55-
# Construct parameters
56-
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
57-
58-
# Construct headers
59-
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
60-
61-
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
62-
63-
6440
def build_configure_factory_repo_request(location_id: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
6541
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
6642
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -402,82 +378,6 @@ def __init__(self, *args, **kwargs):
402378
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
403379
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
404380

405-
@distributed_trace
406-
def list(self, **kwargs: Any) -> Iterable["_models.Factory"]:
407-
"""Lists factories under the specified subscription.
408-
409-
:return: An iterator like instance of either Factory or the result of cls(response)
410-
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datafactory.models.Factory]
411-
:raises ~azure.core.exceptions.HttpResponseError:
412-
"""
413-
_headers = kwargs.pop("headers", {}) or {}
414-
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
415-
416-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
417-
cls: ClsType[_models.FactoryListResponse] = kwargs.pop("cls", None)
418-
419-
error_map = {
420-
401: ClientAuthenticationError,
421-
404: ResourceNotFoundError,
422-
409: ResourceExistsError,
423-
304: ResourceNotModifiedError,
424-
}
425-
error_map.update(kwargs.pop("error_map", {}) or {})
426-
427-
def prepare_request(next_link=None):
428-
if not next_link:
429-
430-
_request = build_list_request(
431-
subscription_id=self._config.subscription_id,
432-
api_version=api_version,
433-
headers=_headers,
434-
params=_params,
435-
)
436-
_request = _convert_request(_request)
437-
_request.url = self._client.format_url(_request.url)
438-
439-
else:
440-
# make call to next link with the client's api-version
441-
_parsed_next_link = urllib.parse.urlparse(next_link)
442-
_next_request_params = case_insensitive_dict(
443-
{
444-
key: [urllib.parse.quote(v) for v in value]
445-
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
446-
}
447-
)
448-
_next_request_params["api-version"] = self._config.api_version
449-
_request = HttpRequest(
450-
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
451-
)
452-
_request = _convert_request(_request)
453-
_request.url = self._client.format_url(_request.url)
454-
_request.method = "GET"
455-
return _request
456-
457-
def extract_data(pipeline_response):
458-
deserialized = self._deserialize("FactoryListResponse", pipeline_response)
459-
list_of_elem = deserialized.value
460-
if cls:
461-
list_of_elem = cls(list_of_elem) # type: ignore
462-
return deserialized.next_link or None, iter(list_of_elem)
463-
464-
def get_next(next_link=None):
465-
_request = prepare_request(next_link)
466-
467-
_stream = False
468-
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
469-
_request, stream=_stream, **kwargs
470-
)
471-
response = pipeline_response.http_response
472-
473-
if response.status_code not in [200]:
474-
map_error(status_code=response.status_code, response=response, error_map=error_map)
475-
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
476-
477-
return pipeline_response
478-
479-
return ItemPaged(get_next, extract_data)
480-
481381
@overload
482382
def configure_factory_repo(
483383
self,

sdk/datafactory/azure-mgmt-datafactory/generated_samples/factories_list.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)