Skip to content

Commit cc0ff62

Browse files
author
SDKAuto
committed
CodeGen from PR 33881 in Azure/azure-rest-api-specs
Merge 75eee67128e57fc00f25eca195679e8db7cf2e96 into 69ddfb5117d394bc756fa63a0bf7b872fcb6bae0
1 parent 8b96068 commit cc0ff62

File tree

15 files changed

+55
-252
lines changed

15 files changed

+55
-252
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "812060f2268dc35ed8866bcbaf94aa767cf87c8d",
2+
"commit": "af51fab0cc00ba3eaee7e4710e8fec5894d4bb0c",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/deviceregistry/DeviceRegistry.Management",
5-
"@azure-tools/typespec-python": "0.38.4"
5+
"@azure-tools/typespec-python": "0.42.2"
66
}

sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_model_base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# coding=utf-8
33
# --------------------------------------------------------------------------
44
# Copyright (c) Microsoft Corporation. All rights reserved.
5-
# Licensed under the MIT License. See License.txt in the project root for
6-
# license information.
5+
# Licensed under the MIT License. See License.txt in the project root for license information.
6+
# Code generated by Microsoft (R) Python Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
78
# --------------------------------------------------------------------------
89
# pylint: disable=protected-access, broad-except
910

sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_patch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# ------------------------------------
2-
# Copyright (c) Microsoft Corporation.
3-
# Licensed under the MIT License.
4-
# ------------------------------------
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# --------------------------------------------------------------------------
56
"""Customize generated code here.
67
78
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize

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

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
11
# pylint: disable=line-too-long,useless-suppression,too-many-lines
2+
# coding=utf-8
23
# --------------------------------------------------------------------------
3-
#
44
# Copyright (c) Microsoft Corporation. All rights reserved.
5-
#
6-
# The MIT License (MIT)
7-
#
8-
# Permission is hereby granted, free of charge, to any person obtaining a copy
9-
# of this software and associated documentation files (the ""Software""), to
10-
# deal in the Software without restriction, including without limitation the
11-
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12-
# sell copies of the Software, and to permit persons to whom the Software is
13-
# furnished to do so, subject to the following conditions:
14-
#
15-
# The above copyright notice and this permission notice shall be included in
16-
# all copies or substantial portions of the Software.
17-
#
18-
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24-
# IN THE SOFTWARE.
25-
#
5+
# Licensed under the MIT License. See License.txt in the project root for license information.
6+
# Code generated by Microsoft (R) Python Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
268
# --------------------------------------------------------------------------
279

2810
# pyright: reportUnnecessaryTypeIgnoreComment=false
@@ -411,7 +393,7 @@ def from_dict(
411393
:param function key_extractors: A key extractor function.
412394
:param str content_type: JSON by default, set application/xml if XML.
413395
:returns: An instance of this model
414-
:raises: DeserializationError if something went wrong
396+
:raises DeserializationError: if something went wrong
415397
:rtype: Self
416398
"""
417399
deserializer = Deserializer(cls._infer_class_models())

sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_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 = "1.0.0"
9+
VERSION = "1.0.0b1"

sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/_patch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# ------------------------------------
2-
# Copyright (c) Microsoft Corporation.
3-
# Licensed under the MIT License.
4-
# ------------------------------------
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# --------------------------------------------------------------------------
56
"""Customize generated code here.
67
78
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize

sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/_operations.py

Lines changed: 8 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ def __init__(self, *args, **kwargs) -> None:
8484
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
8585

8686
@distributed_trace
87-
@api_version_validation(
88-
params_added_on={"2024-09-01-preview": ["base_url"]},
89-
)
9087
def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
9188
"""List the operations for the provider.
9289
@@ -146,7 +143,7 @@ def prepare_request(next_link=None):
146143

147144
async def extract_data(pipeline_response):
148145
deserialized = pipeline_response.http_response.json()
149-
list_of_elem = _deserialize(List[_models.Operation], deserialized["value"])
146+
list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", []))
150147
if cls:
151148
list_of_elem = cls(list_of_elem) # type: ignore
152149
return deserialized.get("nextLink") or None, AsyncList(list_of_elem)
@@ -188,9 +185,6 @@ def __init__(self, *args, **kwargs) -> None:
188185
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
189186

190187
@distributed_trace_async
191-
@api_version_validation(
192-
params_added_on={"2024-09-01-preview": ["base_url"]},
193-
)
194188
async def get(self, location: str, operation_id: str, **kwargs: Any) -> _models.OperationStatusResult:
195189
"""Returns the current status of an async operation.
196190
@@ -274,9 +268,6 @@ def __init__(self, *args, **kwargs) -> None:
274268
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
275269

276270
@distributed_trace_async
277-
@api_version_validation(
278-
params_added_on={"2024-09-01-preview": ["base_url"]},
279-
)
280271
async def get(self, resource_group_name: str, asset_name: str, **kwargs: Any) -> _models.Asset:
281272
"""Get a Asset.
282273
@@ -342,9 +333,6 @@ async def get(self, resource_group_name: str, asset_name: str, **kwargs: Any) ->
342333

343334
return deserialized # type: ignore
344335

345-
@api_version_validation(
346-
params_added_on={"2024-09-01-preview": ["base_url"]},
347-
)
348336
async def _create_or_replace_initial(
349337
self, resource_group_name: str, asset_name: str, resource: Union[_models.Asset, JSON, IO[bytes]], **kwargs: Any
350338
) -> AsyncIterator[bytes]:
@@ -499,9 +487,6 @@ async def begin_create_or_replace(
499487
"""
500488

501489
@distributed_trace_async
502-
@api_version_validation(
503-
params_added_on={"2024-09-01-preview": ["base_url"]},
504-
)
505490
async def begin_create_or_replace(
506491
self, resource_group_name: str, asset_name: str, resource: Union[_models.Asset, JSON, IO[bytes]], **kwargs: Any
507492
) -> AsyncLROPoller[_models.Asset]:
@@ -572,9 +557,6 @@ def get_long_running_output(pipeline_response):
572557
self._client, raw_result, get_long_running_output, polling_method # type: ignore
573558
)
574559

575-
@api_version_validation(
576-
params_added_on={"2024-09-01-preview": ["base_url"]},
577-
)
578560
async def _update_initial(
579561
self,
580562
resource_group_name: str,
@@ -731,9 +713,6 @@ async def begin_update(
731713
"""
732714

733715
@distributed_trace_async
734-
@api_version_validation(
735-
params_added_on={"2024-09-01-preview": ["base_url"]},
736-
)
737716
async def begin_update(
738717
self,
739718
resource_group_name: str,
@@ -808,9 +787,6 @@ def get_long_running_output(pipeline_response):
808787
self._client, raw_result, get_long_running_output, polling_method # type: ignore
809788
)
810789

811-
@api_version_validation(
812-
params_added_on={"2024-09-01-preview": ["base_url"]},
813-
)
814790
async def _delete_initial(self, resource_group_name: str, asset_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
815791
error_map: MutableMapping = {
816792
401: ClientAuthenticationError,
@@ -867,9 +843,6 @@ async def _delete_initial(self, resource_group_name: str, asset_name: str, **kwa
867843
return deserialized # type: ignore
868844

869845
@distributed_trace_async
870-
@api_version_validation(
871-
params_added_on={"2024-09-01-preview": ["base_url"]},
872-
)
873846
async def begin_delete(self, resource_group_name: str, asset_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
874847
"""Delete a Asset.
875848
@@ -927,9 +900,6 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
927900
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
928901

929902
@distributed_trace
930-
@api_version_validation(
931-
params_added_on={"2024-09-01-preview": ["base_url"]},
932-
)
933903
def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Asset"]:
934904
"""List Asset resources by resource group.
935905
@@ -994,7 +964,7 @@ def prepare_request(next_link=None):
994964

995965
async def extract_data(pipeline_response):
996966
deserialized = pipeline_response.http_response.json()
997-
list_of_elem = _deserialize(List[_models.Asset], deserialized["value"])
967+
list_of_elem = _deserialize(List[_models.Asset], deserialized.get("value", []))
998968
if cls:
999969
list_of_elem = cls(list_of_elem) # type: ignore
1000970
return deserialized.get("nextLink") or None, AsyncList(list_of_elem)
@@ -1018,9 +988,6 @@ async def get_next(next_link=None):
1018988
return AsyncItemPaged(get_next, extract_data)
1019989

1020990
@distributed_trace
1021-
@api_version_validation(
1022-
params_added_on={"2024-09-01-preview": ["base_url"]},
1023-
)
1024991
def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Asset"]:
1025992
"""List Asset resources by subscription ID.
1026993
@@ -1081,7 +1048,7 @@ def prepare_request(next_link=None):
10811048

10821049
async def extract_data(pipeline_response):
10831050
deserialized = pipeline_response.http_response.json()
1084-
list_of_elem = _deserialize(List[_models.Asset], deserialized["value"])
1051+
list_of_elem = _deserialize(List[_models.Asset], deserialized.get("value", []))
10851052
if cls:
10861053
list_of_elem = cls(list_of_elem) # type: ignore
10871054
return deserialized.get("nextLink") or None, AsyncList(list_of_elem)
@@ -1123,9 +1090,6 @@ def __init__(self, *args, **kwargs) -> None:
11231090
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
11241091

11251092
@distributed_trace_async
1126-
@api_version_validation(
1127-
params_added_on={"2024-09-01-preview": ["base_url"]},
1128-
)
11291093
async def get(
11301094
self, resource_group_name: str, asset_endpoint_profile_name: str, **kwargs: Any
11311095
) -> _models.AssetEndpointProfile:
@@ -1193,9 +1157,6 @@ async def get(
11931157

11941158
return deserialized # type: ignore
11951159

1196-
@api_version_validation(
1197-
params_added_on={"2024-09-01-preview": ["base_url"]},
1198-
)
11991160
async def _create_or_replace_initial(
12001161
self,
12011162
resource_group_name: str,
@@ -1357,9 +1318,6 @@ async def begin_create_or_replace(
13571318
"""
13581319

13591320
@distributed_trace_async
1360-
@api_version_validation(
1361-
params_added_on={"2024-09-01-preview": ["base_url"]},
1362-
)
13631321
async def begin_create_or_replace(
13641322
self,
13651323
resource_group_name: str,
@@ -1435,9 +1393,6 @@ def get_long_running_output(pipeline_response):
14351393
self._client, raw_result, get_long_running_output, polling_method # type: ignore
14361394
)
14371395

1438-
@api_version_validation(
1439-
params_added_on={"2024-09-01-preview": ["base_url"]},
1440-
)
14411396
async def _update_initial(
14421397
self,
14431398
resource_group_name: str,
@@ -1597,9 +1552,6 @@ async def begin_update(
15971552
"""
15981553

15991554
@distributed_trace_async
1600-
@api_version_validation(
1601-
params_added_on={"2024-09-01-preview": ["base_url"]},
1602-
)
16031555
async def begin_update(
16041556
self,
16051557
resource_group_name: str,
@@ -1676,9 +1628,6 @@ def get_long_running_output(pipeline_response):
16761628
self._client, raw_result, get_long_running_output, polling_method # type: ignore
16771629
)
16781630

1679-
@api_version_validation(
1680-
params_added_on={"2024-09-01-preview": ["base_url"]},
1681-
)
16821631
async def _delete_initial(
16831632
self, resource_group_name: str, asset_endpoint_profile_name: str, **kwargs: Any
16841633
) -> AsyncIterator[bytes]:
@@ -1737,9 +1686,6 @@ async def _delete_initial(
17371686
return deserialized # type: ignore
17381687

17391688
@distributed_trace_async
1740-
@api_version_validation(
1741-
params_added_on={"2024-09-01-preview": ["base_url"]},
1742-
)
17431689
async def begin_delete(
17441690
self, resource_group_name: str, asset_endpoint_profile_name: str, **kwargs: Any
17451691
) -> AsyncLROPoller[None]:
@@ -1799,9 +1745,6 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
17991745
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
18001746

18011747
@distributed_trace
1802-
@api_version_validation(
1803-
params_added_on={"2024-09-01-preview": ["base_url"]},
1804-
)
18051748
def list_by_resource_group(
18061749
self, resource_group_name: str, **kwargs: Any
18071750
) -> AsyncIterable["_models.AssetEndpointProfile"]:
@@ -1869,7 +1812,7 @@ def prepare_request(next_link=None):
18691812

18701813
async def extract_data(pipeline_response):
18711814
deserialized = pipeline_response.http_response.json()
1872-
list_of_elem = _deserialize(List[_models.AssetEndpointProfile], deserialized["value"])
1815+
list_of_elem = _deserialize(List[_models.AssetEndpointProfile], deserialized.get("value", []))
18731816
if cls:
18741817
list_of_elem = cls(list_of_elem) # type: ignore
18751818
return deserialized.get("nextLink") or None, AsyncList(list_of_elem)
@@ -1893,9 +1836,6 @@ async def get_next(next_link=None):
18931836
return AsyncItemPaged(get_next, extract_data)
18941837

18951838
@distributed_trace
1896-
@api_version_validation(
1897-
params_added_on={"2024-09-01-preview": ["base_url"]},
1898-
)
18991839
def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.AssetEndpointProfile"]:
19001840
"""List AssetEndpointProfile resources by subscription ID.
19011841
@@ -1957,7 +1897,7 @@ def prepare_request(next_link=None):
19571897

19581898
async def extract_data(pipeline_response):
19591899
deserialized = pipeline_response.http_response.json()
1960-
list_of_elem = _deserialize(List[_models.AssetEndpointProfile], deserialized["value"])
1900+
list_of_elem = _deserialize(List[_models.AssetEndpointProfile], deserialized.get("value", []))
19611901
if cls:
19621902
list_of_elem = cls(list_of_elem) # type: ignore
19631903
return deserialized.get("nextLink") or None, AsyncList(list_of_elem)
@@ -2001,9 +1941,7 @@ def __init__(self, *args, **kwargs) -> None:
20011941
@distributed_trace_async
20021942
@api_version_validation(
20031943
method_added_on="2024-09-01-preview",
2004-
params_added_on={
2005-
"2024-09-01-preview": ["base_url", "api_version", "subscription_id", "billing_container_name", "accept"]
2006-
},
1944+
params_added_on={"2024-09-01-preview": ["api_version", "subscription_id", "billing_container_name", "accept"]},
20071945
)
20081946
async def get(self, billing_container_name: str, **kwargs: Any) -> _models.BillingContainer:
20091947
"""Get a BillingContainer.
@@ -2069,7 +2007,7 @@ async def get(self, billing_container_name: str, **kwargs: Any) -> _models.Billi
20692007
@distributed_trace
20702008
@api_version_validation(
20712009
method_added_on="2024-09-01-preview",
2072-
params_added_on={"2024-09-01-preview": ["base_url", "api_version", "subscription_id", "accept"]},
2010+
params_added_on={"2024-09-01-preview": ["api_version", "subscription_id", "accept"]},
20732011
)
20742012
def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.BillingContainer"]:
20752013
"""List BillingContainer resources by subscription ID.
@@ -2132,7 +2070,7 @@ def prepare_request(next_link=None):
21322070

21332071
async def extract_data(pipeline_response):
21342072
deserialized = pipeline_response.http_response.json()
2135-
list_of_elem = _deserialize(List[_models.BillingContainer], deserialized["value"])
2073+
list_of_elem = _deserialize(List[_models.BillingContainer], deserialized.get("value", []))
21362074
if cls:
21372075
list_of_elem = cls(list_of_elem) # type: ignore
21382076
return deserialized.get("nextLink") or None, AsyncList(list_of_elem)

sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/_patch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# ------------------------------------
2-
# Copyright (c) Microsoft Corporation.
3-
# Licensed under the MIT License.
4-
# ------------------------------------
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# --------------------------------------------------------------------------
56
"""Customize generated code here.
67
78
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize

0 commit comments

Comments
 (0)