Skip to content

Commit dd86af9

Browse files
author
SDKAuto
committed
CodeGen from PR 33346 in Azure/azure-rest-api-specs
Merge 8f149bdac217f1b385813fe9d49d2acddc99f899 into 8101a5323ca718856b5d462446107fdeabf28c6d
1 parent 2f95178 commit dd86af9

36 files changed

+703
-542
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "399cbac2de1bc0acbed4c9a0a864a9c84da3692e",
2+
"commit": "1677ed11e09b798a6ee4168aca8d149a86b44f0b",
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.39.1"
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: 88 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
# pylint: disable=too-many-lines
12
# coding=utf-8
23
# --------------------------------------------------------------------------
34
# Copyright (c) Microsoft Corporation. All rights reserved.
45
# Licensed under the MIT License. See License.txt in the project root for
56
# license information.
67
# --------------------------------------------------------------------------
7-
# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines
8+
# pylint: disable=protected-access, broad-except
89

910
import copy
1011
import calendar
@@ -372,15 +373,34 @@ def __ne__(self, other: typing.Any) -> bool:
372373
return not self.__eq__(other)
373374

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

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

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

383396
def get(self, key: str, default: typing.Any = None) -> typing.Any:
397+
"""
398+
Get the value for key if key is in the dictionary, else default.
399+
:param str key: The key to look up.
400+
:param any default: The value to return if key is not in the dictionary. Defaults to None
401+
:returns: D[k] if k in D, else d.
402+
:rtype: any
403+
"""
384404
try:
385405
return self[key]
386406
except KeyError:
@@ -396,17 +416,38 @@ def pop(self, key: str, default: _T) -> _T: ...
396416
def pop(self, key: str, default: typing.Any) -> typing.Any: ...
397417

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

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

406440
def clear(self) -> None:
441+
"""
442+
Remove all items from D.
443+
"""
407444
self._data.clear()
408445

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

412453
@typing.overload
@@ -416,6 +457,13 @@ def setdefault(self, key: str, default: None = None) -> None: ...
416457
def setdefault(self, key: str, default: typing.Any) -> typing.Any: ...
417458

418459
def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
460+
"""
461+
Same as calling D.get(k, d), and setting D[k]=d if k not found
462+
:param str key: The key to look up.
463+
:param any default: The value to set if key is not in the dictionary
464+
:returns: D[k] if k in D, else d.
465+
:rtype: any
466+
"""
419467
if default is _UNSET:
420468
return self._data.setdefault(key)
421469
return self._data.setdefault(key, default)
@@ -573,7 +621,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
573621
def copy(self) -> "Model":
574622
return Model(self.__dict__)
575623

576-
def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument
624+
def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self:
577625
if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated:
578626
# we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping',
579627
# 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object'
@@ -584,8 +632,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
584632
annotations = {
585633
k: v
586634
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
635+
if hasattr(mro_class, "__annotations__")
636+
for k, v in mro_class.__annotations__.items()
589637
}
590638
for attr, rf in attr_to_rest_field.items():
591639
rf._module = cls.__module__
@@ -600,8 +648,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
600648

601649
def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None:
602650
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
651+
if hasattr(base, "__mapping__"):
652+
base.__mapping__[discriminator or cls.__name__] = cls # type: ignore
605653

606654
@classmethod
607655
def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]:
@@ -612,7 +660,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField
612660

613661
@classmethod
614662
def _deserialize(cls, data, exist_discriminators):
615-
if not hasattr(cls, "__mapping__"): # pylint: disable=no-member
663+
if not hasattr(cls, "__mapping__"):
616664
return cls(data)
617665
discriminator = cls._get_discriminator(exist_discriminators)
618666
if discriminator is None:
@@ -632,11 +680,11 @@ def _deserialize(cls, data, exist_discriminators):
632680
discriminator_value = data.find(xml_name).text # pyright: ignore
633681
else:
634682
discriminator_value = data.get(discriminator._rest_name)
635-
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member
683+
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore
636684
return mapped_cls._deserialize(data, exist_discriminators)
637685

638686
def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]:
639-
"""Return a dict that can be JSONify using json.dump.
687+
"""Return a dict that can be turned into json using json.dump.
640688
641689
:keyword bool exclude_readonly: Whether to remove the readonly properties.
642690
:returns: A dict JSON compatible object
@@ -733,7 +781,7 @@ def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.An
733781
)
734782

735783

736-
def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912
784+
def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches
737785
annotation: typing.Any,
738786
module: typing.Optional[str],
739787
rf: typing.Optional["_RestField"] = None,
@@ -753,7 +801,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915,
753801
except AttributeError:
754802
model_name = annotation
755803
if module is not None:
756-
annotation = _get_model(module, model_name)
804+
annotation = _get_model(module, model_name) # type: ignore
757805

758806
try:
759807
if module and _is_model(annotation):
@@ -893,6 +941,35 @@ def _deserialize(
893941
return _deserialize_with_callable(deserializer, value)
894942

895943

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

0 commit comments

Comments
 (0)