Skip to content

Commit fee1f71

Browse files
author
SDKAuto
committed
CodeGen from PR 33496 in Azure/azure-rest-api-specs
Merge 80a27661250a05a8cec420ddd35120c4be60b1c1 into a730aea13a0bb551748ab41f5d36f00956f0a4f6
1 parent fe0fc66 commit fee1f71

Some content is hidden

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

44 files changed

+753
-598
lines changed

sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 1.0.0 (2025-04-15)
4+
5+
### Features Added
6+
7+
- Method `Operation.__init__` has a new overload `def __init__(self: None, display: Optional[_models.OperationDisplay])`
8+
39
## 1.0.0b1 (2024-10-20)
410

511
### Other Changes

sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/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": "399cbac2de1bc0acbed4c9a0a864a9c84da3692e",
2+
"commit": "a6a86d80158ffd8b89caba4e07bd877fa2e3e19c",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/kubernetesruntime/KubernetesRuntime.Management",
5-
"@azure-tools/typespec-python": "0.33.0"
5+
"@azure-tools/typespec-python": "0.42.2"
66
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.KubernetesRuntime",
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.containerorchestratorruntime.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
5+
"azure.mgmt.containerorchestratorruntime.models.ExtensionResource": "Azure.ResourceManager.CommonTypes.ExtensionResource",
6+
"azure.mgmt.containerorchestratorruntime.models.BgpPeer": "Microsoft.KubernetesRuntime.BgpPeer",
7+
"azure.mgmt.containerorchestratorruntime.models.BgpPeerProperties": "Microsoft.KubernetesRuntime.BgpPeerProperties",
8+
"azure.mgmt.containerorchestratorruntime.models.StorageClassTypeProperties": "Microsoft.KubernetesRuntime.StorageClassTypeProperties",
9+
"azure.mgmt.containerorchestratorruntime.models.BlobStorageClassTypeProperties": "Microsoft.KubernetesRuntime.BlobStorageClassTypeProperties",
10+
"azure.mgmt.containerorchestratorruntime.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
11+
"azure.mgmt.containerorchestratorruntime.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
12+
"azure.mgmt.containerorchestratorruntime.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
13+
"azure.mgmt.containerorchestratorruntime.models.LoadBalancer": "Microsoft.KubernetesRuntime.LoadBalancer",
14+
"azure.mgmt.containerorchestratorruntime.models.LoadBalancerProperties": "Microsoft.KubernetesRuntime.LoadBalancerProperties",
15+
"azure.mgmt.containerorchestratorruntime.models.NativeStorageClassTypeProperties": "Microsoft.KubernetesRuntime.NativeStorageClassTypeProperties",
16+
"azure.mgmt.containerorchestratorruntime.models.NfsStorageClassTypeProperties": "Microsoft.KubernetesRuntime.NfsStorageClassTypeProperties",
17+
"azure.mgmt.containerorchestratorruntime.models.Operation": "Azure.ResourceManager.CommonTypes.Operation",
18+
"azure.mgmt.containerorchestratorruntime.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
19+
"azure.mgmt.containerorchestratorruntime.models.RwxStorageClassTypeProperties": "Microsoft.KubernetesRuntime.RwxStorageClassTypeProperties",
20+
"azure.mgmt.containerorchestratorruntime.models.ServiceProperties": "Microsoft.KubernetesRuntime.ServiceProperties",
21+
"azure.mgmt.containerorchestratorruntime.models.ServiceResource": "Microsoft.KubernetesRuntime.ServiceResource",
22+
"azure.mgmt.containerorchestratorruntime.models.SmbStorageClassTypeProperties": "Microsoft.KubernetesRuntime.SmbStorageClassTypeProperties",
23+
"azure.mgmt.containerorchestratorruntime.models.StorageClassProperties": "Microsoft.KubernetesRuntime.StorageClassProperties",
24+
"azure.mgmt.containerorchestratorruntime.models.StorageClassPropertiesUpdate": "Microsoft.KubernetesRuntime.StorageClassPropertiesUpdate",
25+
"azure.mgmt.containerorchestratorruntime.models.StorageClassResource": "Microsoft.KubernetesRuntime.StorageClassResource",
26+
"azure.mgmt.containerorchestratorruntime.models.StorageClassResourceUpdate": "Microsoft.KubernetesRuntime.StorageClassResourceUpdate",
27+
"azure.mgmt.containerorchestratorruntime.models.StorageClassTypePropertiesUpdate": "Microsoft.KubernetesRuntime.StorageClassTypePropertiesUpdate",
28+
"azure.mgmt.containerorchestratorruntime.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
29+
"azure.mgmt.containerorchestratorruntime.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
30+
"azure.mgmt.containerorchestratorruntime.models.VolumeExpansion": "Microsoft.KubernetesRuntime.VolumeExpansion",
31+
"azure.mgmt.containerorchestratorruntime.models.VolumeBindingMode": "Microsoft.KubernetesRuntime.VolumeBindingMode",
32+
"azure.mgmt.containerorchestratorruntime.models.AccessMode": "Microsoft.KubernetesRuntime.AccessMode",
33+
"azure.mgmt.containerorchestratorruntime.models.DataResilienceTier": "Microsoft.KubernetesRuntime.DataResilienceTier",
34+
"azure.mgmt.containerorchestratorruntime.models.FailoverTier": "Microsoft.KubernetesRuntime.FailoverTier",
35+
"azure.mgmt.containerorchestratorruntime.models.PerformanceTier": "Microsoft.KubernetesRuntime.PerformanceTier",
36+
"azure.mgmt.containerorchestratorruntime.models.SCType": "Microsoft.KubernetesRuntime.SCType",
37+
"azure.mgmt.containerorchestratorruntime.models.NfsDirectoryActionOnVolumeDeletion": "Microsoft.KubernetesRuntime.NfsDirectoryActionOnVolumeDeletion",
38+
"azure.mgmt.containerorchestratorruntime.models.ProvisioningState": "Microsoft.KubernetesRuntime.ProvisioningState",
39+
"azure.mgmt.containerorchestratorruntime.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
40+
"azure.mgmt.containerorchestratorruntime.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
41+
"azure.mgmt.containerorchestratorruntime.models.AdvertiseMode": "Microsoft.KubernetesRuntime.AdvertiseMode",
42+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.storage_class.get": "Microsoft.KubernetesRuntime.StorageClass.get",
43+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.storage_class.begin_create_or_update": "Microsoft.KubernetesRuntime.StorageClass.createOrUpdate",
44+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.storage_class.begin_update": "Microsoft.KubernetesRuntime.StorageClass.update",
45+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.storage_class.begin_delete": "Microsoft.KubernetesRuntime.StorageClass.delete",
46+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.storage_class.list": "Microsoft.KubernetesRuntime.StorageClass.list",
47+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.operations.list": "Azure.ResourceManager.Operations.list",
48+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.load_balancers.get": "Microsoft.KubernetesRuntime.LoadBalancers.get",
49+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.load_balancers.begin_create_or_update": "Microsoft.KubernetesRuntime.LoadBalancers.createOrUpdate",
50+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.load_balancers.delete": "Microsoft.KubernetesRuntime.LoadBalancers.delete",
51+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.load_balancers.list": "Microsoft.KubernetesRuntime.LoadBalancers.list",
52+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.bgp_peers.get": "Microsoft.KubernetesRuntime.BgpPeers.get",
53+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.bgp_peers.begin_create_or_update": "Microsoft.KubernetesRuntime.BgpPeers.createOrUpdate",
54+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.bgp_peers.delete": "Microsoft.KubernetesRuntime.BgpPeers.delete",
55+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.bgp_peers.list": "Microsoft.KubernetesRuntime.BgpPeers.list",
56+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.services.get": "Microsoft.KubernetesRuntime.Services.get",
57+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.services.create_or_update": "Microsoft.KubernetesRuntime.Services.createOrUpdate",
58+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.services.delete": "Microsoft.KubernetesRuntime.Services.delete",
59+
"azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.services.list": "Microsoft.KubernetesRuntime.Services.list"
60+
}
61+
}

sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._client import ContainerOrchestratorRuntimeMgmtClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import ContainerOrchestratorRuntimeMgmtClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"ContainerOrchestratorRuntimeMgmtClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@
2626
)
2727

2828
if TYPE_CHECKING:
29-
# pylint: disable=unused-import,ungrouped-imports
3029
from azure.core.credentials import TokenCredential
3130

3231

33-
class ContainerOrchestratorRuntimeMgmtClient: # pylint: disable=client-accepts-api-version-keyword
32+
class ContainerOrchestratorRuntimeMgmtClient:
3433
"""ContainerOrchestratorRuntimeMgmtClient.
3534
3635
:ivar storage_class: StorageClassOperations operations

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

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

Lines changed: 91 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
# pylint: disable=too-many-lines
12
# coding=utf-8
23
# --------------------------------------------------------------------------
34
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for
5-
# 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.
68
# --------------------------------------------------------------------------
7-
# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines
9+
# pylint: disable=protected-access, broad-except
810

911
import copy
1012
import calendar
@@ -372,15 +374,34 @@ def __ne__(self, other: typing.Any) -> bool:
372374
return not self.__eq__(other)
373375

374376
def keys(self) -> typing.KeysView[str]:
377+
"""
378+
:returns: a set-like object providing a view on D's keys
379+
:rtype: ~typing.KeysView
380+
"""
375381
return self._data.keys()
376382

377383
def values(self) -> typing.ValuesView[typing.Any]:
384+
"""
385+
:returns: an object providing a view on D's values
386+
:rtype: ~typing.ValuesView
387+
"""
378388
return self._data.values()
379389

380390
def items(self) -> typing.ItemsView[str, typing.Any]:
391+
"""
392+
:returns: set-like object providing a view on D's items
393+
:rtype: ~typing.ItemsView
394+
"""
381395
return self._data.items()
382396

383397
def get(self, key: str, default: typing.Any = None) -> typing.Any:
398+
"""
399+
Get the value for key if key is in the dictionary, else default.
400+
:param str key: The key to look up.
401+
:param any default: The value to return if key is not in the dictionary. Defaults to None
402+
:returns: D[k] if k in D, else d.
403+
:rtype: any
404+
"""
384405
try:
385406
return self[key]
386407
except KeyError:
@@ -396,17 +417,38 @@ def pop(self, key: str, default: _T) -> _T: ...
396417
def pop(self, key: str, default: typing.Any) -> typing.Any: ...
397418

398419
def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
420+
"""
421+
Removes specified key and return the corresponding value.
422+
:param str key: The key to pop.
423+
:param any default: The value to return if key is not in the dictionary
424+
:returns: The value corresponding to the key.
425+
:rtype: any
426+
:raises KeyError: If key is not found and default is not given.
427+
"""
399428
if default is _UNSET:
400429
return self._data.pop(key)
401430
return self._data.pop(key, default)
402431

403432
def popitem(self) -> typing.Tuple[str, typing.Any]:
433+
"""
434+
Removes and returns some (key, value) pair
435+
:returns: The (key, value) pair.
436+
:rtype: tuple
437+
:raises KeyError: if D is empty.
438+
"""
404439
return self._data.popitem()
405440

406441
def clear(self) -> None:
442+
"""
443+
Remove all items from D.
444+
"""
407445
self._data.clear()
408446

409447
def update(self, *args: typing.Any, **kwargs: typing.Any) -> None:
448+
"""
449+
Updates D from mapping/iterable E and F.
450+
:param any args: Either a mapping object or an iterable of key-value pairs.
451+
"""
410452
self._data.update(*args, **kwargs)
411453

412454
@typing.overload
@@ -416,6 +458,13 @@ def setdefault(self, key: str, default: None = None) -> None: ...
416458
def setdefault(self, key: str, default: typing.Any) -> typing.Any: ...
417459

418460
def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
461+
"""
462+
Same as calling D.get(k, d), and setting D[k]=d if k not found
463+
:param str key: The key to look up.
464+
:param any default: The value to set if key is not in the dictionary
465+
:returns: D[k] if k in D, else d.
466+
:rtype: any
467+
"""
419468
if default is _UNSET:
420469
return self._data.setdefault(key)
421470
return self._data.setdefault(key, default)
@@ -573,7 +622,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
573622
def copy(self) -> "Model":
574623
return Model(self.__dict__)
575624

576-
def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument
625+
def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self:
577626
if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated:
578627
# we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping',
579628
# 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object'
@@ -584,8 +633,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
584633
annotations = {
585634
k: v
586635
for mro_class in mros
587-
if hasattr(mro_class, "__annotations__") # pylint: disable=no-member
588-
for k, v in mro_class.__annotations__.items() # pylint: disable=no-member
636+
if hasattr(mro_class, "__annotations__")
637+
for k, v in mro_class.__annotations__.items()
589638
}
590639
for attr, rf in attr_to_rest_field.items():
591640
rf._module = cls.__module__
@@ -600,8 +649,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
600649

601650
def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None:
602651
for base in cls.__bases__:
603-
if hasattr(base, "__mapping__"): # pylint: disable=no-member
604-
base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member
652+
if hasattr(base, "__mapping__"):
653+
base.__mapping__[discriminator or cls.__name__] = cls # type: ignore
605654

606655
@classmethod
607656
def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]:
@@ -612,7 +661,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField
612661

613662
@classmethod
614663
def _deserialize(cls, data, exist_discriminators):
615-
if not hasattr(cls, "__mapping__"): # pylint: disable=no-member
664+
if not hasattr(cls, "__mapping__"):
616665
return cls(data)
617666
discriminator = cls._get_discriminator(exist_discriminators)
618667
if discriminator is None:
@@ -632,11 +681,11 @@ def _deserialize(cls, data, exist_discriminators):
632681
discriminator_value = data.find(xml_name).text # pyright: ignore
633682
else:
634683
discriminator_value = data.get(discriminator._rest_name)
635-
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member
684+
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore
636685
return mapped_cls._deserialize(data, exist_discriminators)
637686

638687
def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]:
639-
"""Return a dict that can be JSONify using json.dump.
688+
"""Return a dict that can be turned into json using json.dump.
640689
641690
:keyword bool exclude_readonly: Whether to remove the readonly properties.
642691
:returns: A dict JSON compatible object
@@ -733,7 +782,7 @@ def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.An
733782
)
734783

735784

736-
def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912
785+
def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches
737786
annotation: typing.Any,
738787
module: typing.Optional[str],
739788
rf: typing.Optional["_RestField"] = None,
@@ -753,7 +802,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915,
753802
except AttributeError:
754803
model_name = annotation
755804
if module is not None:
756-
annotation = _get_model(module, model_name)
805+
annotation = _get_model(module, model_name) # type: ignore
757806

758807
try:
759808
if module and _is_model(annotation):
@@ -893,6 +942,35 @@ def _deserialize(
893942
return _deserialize_with_callable(deserializer, value)
894943

895944

945+
def _failsafe_deserialize(
946+
deserializer: typing.Any,
947+
value: typing.Any,
948+
module: typing.Optional[str] = None,
949+
rf: typing.Optional["_RestField"] = None,
950+
format: typing.Optional[str] = None,
951+
) -> typing.Any:
952+
try:
953+
return _deserialize(deserializer, value, module, rf, format)
954+
except DeserializationError:
955+
_LOGGER.warning(
956+
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
957+
)
958+
return None
959+
960+
961+
def _failsafe_deserialize_xml(
962+
deserializer: typing.Any,
963+
value: typing.Any,
964+
) -> typing.Any:
965+
try:
966+
return _deserialize_xml(deserializer, value)
967+
except DeserializationError:
968+
_LOGGER.warning(
969+
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
970+
)
971+
return None
972+
973+
896974
class _RestField:
897975
def __init__(
898976
self,

0 commit comments

Comments
 (0)