diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/_meta.json b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/_meta.json index 8c7a48b226b..794202a8903 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/_meta.json +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/_meta.json @@ -1,6 +1,6 @@ { - "commit": "399cbac2de1bc0acbed4c9a0a864a9c84da3692e", + "commit": "c0d702050e711d4c52d5fe6744191c5c6ca1df4c", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/kubernetesruntime/KubernetesRuntime.Management", - "@azure-tools/typespec-python": "0.33.0" + "@azure-tools/typespec-python": "0.38.4" } \ No newline at end of file diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/apiview-properties.json b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/apiview-properties.json new file mode 100644 index 00000000000..dee582bd90f --- /dev/null +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/apiview-properties.json @@ -0,0 +1,61 @@ +{ + "CrossLanguagePackageId": "Microsoft.KubernetesRuntime", + "CrossLanguageDefinitionId": { + "azure.mgmt.containerorchestratorruntime.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.containerorchestratorruntime.models.ExtensionResource": "Azure.ResourceManager.CommonTypes.ExtensionResource", + "azure.mgmt.containerorchestratorruntime.models.BgpPeer": "Microsoft.KubernetesRuntime.BgpPeer", + "azure.mgmt.containerorchestratorruntime.models.BgpPeerProperties": "Microsoft.KubernetesRuntime.BgpPeerProperties", + "azure.mgmt.containerorchestratorruntime.models.StorageClassTypeProperties": "Microsoft.KubernetesRuntime.StorageClassTypeProperties", + "azure.mgmt.containerorchestratorruntime.models.BlobStorageClassTypeProperties": "Microsoft.KubernetesRuntime.BlobStorageClassTypeProperties", + "azure.mgmt.containerorchestratorruntime.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.containerorchestratorruntime.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.containerorchestratorruntime.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.containerorchestratorruntime.models.LoadBalancer": "Microsoft.KubernetesRuntime.LoadBalancer", + "azure.mgmt.containerorchestratorruntime.models.LoadBalancerProperties": "Microsoft.KubernetesRuntime.LoadBalancerProperties", + "azure.mgmt.containerorchestratorruntime.models.NativeStorageClassTypeProperties": "Microsoft.KubernetesRuntime.NativeStorageClassTypeProperties", + "azure.mgmt.containerorchestratorruntime.models.NfsStorageClassTypeProperties": "Microsoft.KubernetesRuntime.NfsStorageClassTypeProperties", + "azure.mgmt.containerorchestratorruntime.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.containerorchestratorruntime.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.containerorchestratorruntime.models.RwxStorageClassTypeProperties": "Microsoft.KubernetesRuntime.RwxStorageClassTypeProperties", + "azure.mgmt.containerorchestratorruntime.models.ServiceProperties": "Microsoft.KubernetesRuntime.ServiceProperties", + "azure.mgmt.containerorchestratorruntime.models.ServiceResource": "Microsoft.KubernetesRuntime.ServiceResource", + "azure.mgmt.containerorchestratorruntime.models.SmbStorageClassTypeProperties": "Microsoft.KubernetesRuntime.SmbStorageClassTypeProperties", + "azure.mgmt.containerorchestratorruntime.models.StorageClassProperties": "Microsoft.KubernetesRuntime.StorageClassProperties", + "azure.mgmt.containerorchestratorruntime.models.StorageClassPropertiesUpdate": "Microsoft.KubernetesRuntime.StorageClassPropertiesUpdate", + "azure.mgmt.containerorchestratorruntime.models.StorageClassResource": "Microsoft.KubernetesRuntime.StorageClassResource", + "azure.mgmt.containerorchestratorruntime.models.StorageClassResourceUpdate": "Microsoft.KubernetesRuntime.StorageClassResourceUpdate", + "azure.mgmt.containerorchestratorruntime.models.StorageClassTypePropertiesUpdate": "Microsoft.KubernetesRuntime.StorageClassTypePropertiesUpdate", + "azure.mgmt.containerorchestratorruntime.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.containerorchestratorruntime.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.containerorchestratorruntime.models.VolumeExpansion": "Microsoft.KubernetesRuntime.VolumeExpansion", + "azure.mgmt.containerorchestratorruntime.models.VolumeBindingMode": "Microsoft.KubernetesRuntime.VolumeBindingMode", + "azure.mgmt.containerorchestratorruntime.models.AccessMode": "Microsoft.KubernetesRuntime.AccessMode", + "azure.mgmt.containerorchestratorruntime.models.DataResilienceTier": "Microsoft.KubernetesRuntime.DataResilienceTier", + "azure.mgmt.containerorchestratorruntime.models.FailoverTier": "Microsoft.KubernetesRuntime.FailoverTier", + "azure.mgmt.containerorchestratorruntime.models.PerformanceTier": "Microsoft.KubernetesRuntime.PerformanceTier", + "azure.mgmt.containerorchestratorruntime.models.SCType": "Microsoft.KubernetesRuntime.SCType", + "azure.mgmt.containerorchestratorruntime.models.NfsDirectoryActionOnVolumeDeletion": "Microsoft.KubernetesRuntime.NfsDirectoryActionOnVolumeDeletion", + "azure.mgmt.containerorchestratorruntime.models.ProvisioningState": "Microsoft.KubernetesRuntime.ProvisioningState", + "azure.mgmt.containerorchestratorruntime.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.containerorchestratorruntime.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.containerorchestratorruntime.models.AdvertiseMode": "Microsoft.KubernetesRuntime.AdvertiseMode", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.storage_class.get": "Microsoft.KubernetesRuntime.StorageClass.get", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.storage_class.begin_create_or_update": "Microsoft.KubernetesRuntime.StorageClass.createOrUpdate", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.storage_class.begin_update": "Microsoft.KubernetesRuntime.StorageClass.update", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.storage_class.begin_delete": "Microsoft.KubernetesRuntime.StorageClass.delete", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.storage_class.list": "Microsoft.KubernetesRuntime.StorageClass.list", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.load_balancers.get": "Microsoft.KubernetesRuntime.LoadBalancers.get", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.load_balancers.begin_create_or_update": "Microsoft.KubernetesRuntime.LoadBalancers.createOrUpdate", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.load_balancers.delete": "Microsoft.KubernetesRuntime.LoadBalancers.delete", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.load_balancers.list": "Microsoft.KubernetesRuntime.LoadBalancers.list", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.bgp_peers.get": "Microsoft.KubernetesRuntime.BgpPeers.get", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.bgp_peers.begin_create_or_update": "Microsoft.KubernetesRuntime.BgpPeers.createOrUpdate", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.bgp_peers.delete": "Microsoft.KubernetesRuntime.BgpPeers.delete", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.bgp_peers.list": "Microsoft.KubernetesRuntime.BgpPeers.list", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.services.get": "Microsoft.KubernetesRuntime.Services.get", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.services.create_or_update": "Microsoft.KubernetesRuntime.Services.createOrUpdate", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.services.delete": "Microsoft.KubernetesRuntime.Services.delete", + "azure.mgmt.containerorchestratorruntime.ContainerOrchestratorRuntimeMgmtClient.services.list": "Microsoft.KubernetesRuntime.Services.list" + } +} \ No newline at end of file diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/__init__.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/__init__.py index 9e857e4dd10..bb6040f4d4b 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/__init__.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._client import ContainerOrchestratorRuntimeMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import ContainerOrchestratorRuntimeMgmtClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "ContainerOrchestratorRuntimeMgmtClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_client.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_client.py index dfd6622878d..b6c0322bafc 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_client.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_client.py @@ -26,11 +26,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class ContainerOrchestratorRuntimeMgmtClient: # pylint: disable=client-accepts-api-version-keyword +class ContainerOrchestratorRuntimeMgmtClient: """ContainerOrchestratorRuntimeMgmtClient. :ivar storage_class: StorageClassOperations operations diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_configuration.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_configuration.py index f2333260573..2d83382c758 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_configuration.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_configuration.py @@ -14,7 +14,6 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_model_base.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_model_base.py index 12ad7f29c71..3072ee252ed 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_model_base.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_model_base.py @@ -1,10 +1,11 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines +# pylint: disable=protected-access, broad-except import copy import calendar @@ -372,15 +373,34 @@ def __ne__(self, other: typing.Any) -> bool: return not self.__eq__(other) def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ return self._data.items() def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ try: return self[key] except KeyError: @@ -396,17 +416,38 @@ def pop(self, key: str, default: _T) -> _T: ... def pop(self, key: str, default: typing.Any) -> typing.Any: ... def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ if default is _UNSET: return self._data.pop(key) return self._data.pop(key, default) def popitem(self) -> typing.Tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ return self._data.popitem() def clear(self) -> None: + """ + Remove all items from D. + """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ self._data.update(*args, **kwargs) @typing.overload @@ -416,6 +457,13 @@ def setdefault(self, key: str, default: None = None) -> None: ... def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ if default is _UNSET: return self._data.setdefault(key) return self._data.setdefault(key, default) @@ -573,7 +621,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: def copy(self) -> "Model": return Model(self.__dict__) - def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' @@ -584,8 +632,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di annotations = { k: v for mro_class in mros - if hasattr(mro_class, "__annotations__") # pylint: disable=no-member - for k, v in mro_class.__annotations__.items() # pylint: disable=no-member + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() } for attr, rf in attr_to_rest_field.items(): rf._module = cls.__module__ @@ -600,8 +648,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: - if hasattr(base, "__mapping__"): # pylint: disable=no-member - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore @classmethod def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: @@ -612,7 +660,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField @classmethod def _deserialize(cls, data, exist_discriminators): - if not hasattr(cls, "__mapping__"): # pylint: disable=no-member + if not hasattr(cls, "__mapping__"): return cls(data) discriminator = cls._get_discriminator(exist_discriminators) if discriminator is None: @@ -632,11 +680,11 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore return mapped_cls._deserialize(data, exist_discriminators) def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: - """Return a dict that can be JSONify using json.dump. + """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. :returns: A dict JSON compatible object @@ -733,7 +781,7 @@ def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.An ) -def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912 +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -753,7 +801,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, except AttributeError: model_name = annotation if module is not None: - annotation = _get_model(module, model_name) + annotation = _get_model(module, model_name) # type: ignore try: if module and _is_model(annotation): @@ -893,6 +941,35 @@ def _deserialize( return _deserialize_with_callable(deserializer, value) +def _failsafe_deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, value, module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + value: typing.Any, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, value) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + class _RestField: def __init__( self, diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_serialization.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_serialization.py index 01a226bd7f1..e2a20b1d534 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_serialization.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/_serialization.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. @@ -48,9 +48,7 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, List, ) @@ -61,13 +59,13 @@ import xml.etree.ElementTree as ET import isodate # type: ignore +from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -185,73 +183,7 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], except NameError: _long_type = int - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0. - - :param datetime.datetime dt: The datetime - :returns: The offset - :rtype: datetime.timedelta - """ - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation. - - :param datetime.datetime dt: The datetime - :returns: The timestamp representation - :rtype: str - """ - return "Z" - - def dst(self, dt): - """No daylight saving for UTC. - - :param datetime.datetime dt: The datetime - :returns: The daylight saving time - :rtype: datetime.timedelta - """ - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset): - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -480,7 +412,7 @@ def from_dict( :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong - :rtype: ModelType + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -507,7 +439,6 @@ def _flatten_subtype(cls, key, objects): def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. :param dict response: The initial data :param dict objects: The class objects @@ -519,7 +450,7 @@ def _classify(cls, response, objects): if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -564,7 +495,7 @@ def _decode_attribute_map_key(key): return key.replace("\\.", ".") -class Serializer(object): # pylint: disable=too-many-public-methods +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -599,7 +530,7 @@ class Serializer(object): # pylint: disable=too-many-public-methods "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -627,7 +558,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict - :raises: SerializationError if serialization fails. + :raises SerializationError: if serialization fails. :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) @@ -737,8 +668,8 @@ def body(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized request body """ @@ -782,8 +713,8 @@ def url(self, name, data, data_type, **kwargs): :param str data_type: The type to be serialized from. :rtype: str :returns: The serialized URL path - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -806,8 +737,8 @@ def query(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized query parameter """ try: @@ -836,8 +767,8 @@ def header(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized header """ try: @@ -856,9 +787,9 @@ def serialize_data(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. :returns: The serialized data. :rtype: str, int, float, bool, dict, list """ @@ -1193,7 +1124,7 @@ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. :return: serialized rfc """ try: @@ -1219,7 +1150,7 @@ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. :return: serialized iso """ if isinstance(attr, str): @@ -1252,7 +1183,7 @@ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: int - :raises: SerializationError if format invalid + :raises SerializationError: if format invalid :return: serialied unix """ if isinstance(attr, int): @@ -1430,7 +1361,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument # Iter and wrapped, should have found one node only (the wrap one) if len(children) != 1: raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( xml_name ) ) @@ -1442,7 +1373,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1453,7 +1384,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1489,7 +1420,7 @@ def __call__(self, target_obj, response_data, content_type=None): :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1503,7 +1434,7 @@ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1684,17 +1615,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None): subtype = getattr(response, "_subtype_map", {}) try: readonly = [ - k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") ] const = [ - k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore @@ -1714,7 +1649,7 @@ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return- :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1796,7 +1731,7 @@ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return :param dict attr: Dictionary to be deserialized. :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1842,7 +1777,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1933,7 +1868,7 @@ def deserialize_bytearray(attr): :param str attr: response string to be deserialized. :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1946,7 +1881,7 @@ def deserialize_base64(attr): :param str attr: response string to be deserialized. :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1961,7 +1896,7 @@ def deserialize_decimal(attr): :param str attr: response string to be deserialized. :return: Deserialized decimal - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. :rtype: decimal """ if isinstance(attr, ET.Element): @@ -1979,7 +1914,7 @@ def deserialize_long(attr): :param str attr: response string to be deserialized. :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1992,7 +1927,7 @@ def deserialize_duration(attr): :param str attr: response string to be deserialized. :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2010,7 +1945,7 @@ def deserialize_date(attr): :param str attr: response string to be deserialized. :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2026,7 +1961,7 @@ def deserialize_time(attr): :param str attr: response string to be deserialized. :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2041,14 +1976,14 @@ def deserialize_rfc(attr): :param str attr: response string to be deserialized. :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) @@ -2064,7 +1999,7 @@ def deserialize_iso(attr): :param str attr: response string to be deserialized. :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2102,7 +2037,7 @@ def deserialize_unix(attr): :param int attr: Object to be serialized. :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/__init__.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/__init__.py index 2199cfd0975..6d8ebd0134f 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/__init__.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/__init__.py @@ -5,12 +5,18 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._client import ContainerOrchestratorRuntimeMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import ContainerOrchestratorRuntimeMgmtClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "ContainerOrchestratorRuntimeMgmtClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/_client.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/_client.py index f4c63aa42e1..4ed42a32c28 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/_client.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/_client.py @@ -26,11 +26,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class ContainerOrchestratorRuntimeMgmtClient: # pylint: disable=client-accepts-api-version-keyword +class ContainerOrchestratorRuntimeMgmtClient: """ContainerOrchestratorRuntimeMgmtClient. :ivar storage_class: StorageClassOperations operations diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/_configuration.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/_configuration.py index 348ac25eb7a..311317aaf44 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/_configuration.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/_configuration.py @@ -14,7 +14,6 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/operations/__init__.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/operations/__init__.py index d5be48a83d1..24996bcbb3d 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/operations/__init__.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/operations/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import StorageClassOperations -from ._operations import Operations -from ._operations import LoadBalancersOperations -from ._operations import BgpPeersOperations -from ._operations import ServicesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import StorageClassOperations # type: ignore +from ._operations import Operations # type: ignore +from ._operations import LoadBalancersOperations # type: ignore +from ._operations import BgpPeersOperations # type: ignore +from ._operations import ServicesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -23,5 +29,5 @@ "BgpPeersOperations", "ServicesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/operations/_operations.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/operations/_operations.py index 95b897ec88f..4f80555e24a 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/operations/_operations.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -9,23 +9,10 @@ from io import IOBase import json import sys -from typing import ( - Any, - AsyncIterable, - AsyncIterator, - Callable, - Dict, - IO, - List, - Optional, - Type, - TypeVar, - Union, - cast, - overload, -) +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -47,7 +34,8 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize +from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._serialization import Deserializer, Serializer from ..._validation import api_version_validation from ...operations._operations import ( build_bgp_peers_create_or_update_request, @@ -69,11 +57,12 @@ build_storage_class_list_request, build_storage_class_update_request, ) +from .._configuration import ContainerOrchestratorRuntimeMgmtClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,10 +80,12 @@ class StorageClassOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerOrchestratorRuntimeMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get(self, resource_uri: str, storage_class_name: str, **kwargs: Any) -> _models.StorageClassResource: @@ -109,7 +100,7 @@ async def get(self, resource_uri: str, storage_class_name: str, **kwargs: Any) - :rtype: ~azure.mgmt.containerorchestratorruntime.models.StorageClassResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -148,7 +139,7 @@ async def get(self, resource_uri: str, storage_class_name: str, **kwargs: Any) - except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -168,7 +159,7 @@ async def _create_or_update_initial( resource: Union[_models.StorageClassResource, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -216,7 +207,7 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -401,7 +392,7 @@ async def _update_initial( properties: Union[_models.StorageClassResourceUpdate, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +440,7 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -629,7 +620,7 @@ def get_long_running_output(pipeline_response): ) async def _delete_initial(self, resource_uri: str, storage_class_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -667,7 +658,7 @@ async def _delete_initial(self, resource_uri: str, storage_class_name: str, **kw except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -756,7 +747,7 @@ def list(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_models.Stora cls: ClsType[List[_models.StorageClassResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -820,7 +811,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -840,10 +831,12 @@ class Operations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerOrchestratorRuntimeMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -859,7 +852,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -922,7 +915,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -942,10 +935,12 @@ class LoadBalancersOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerOrchestratorRuntimeMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get(self, resource_uri: str, load_balancer_name: str, **kwargs: Any) -> _models.LoadBalancer: @@ -960,7 +955,7 @@ async def get(self, resource_uri: str, load_balancer_name: str, **kwargs: Any) - :rtype: ~azure.mgmt.containerorchestratorruntime.models.LoadBalancer :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -999,7 +994,7 @@ async def get(self, resource_uri: str, load_balancer_name: str, **kwargs: Any) - except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1019,7 +1014,7 @@ async def _create_or_update_initial( resource: Union[_models.LoadBalancer, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1067,7 +1062,7 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1249,10 +1244,8 @@ def get_long_running_output(pipeline_response): @api_version_validation( method_added_on="2024-03-01", params_added_on={"2024-03-01": ["api_version", "resource_uri", "load_balancer_name", "accept"]}, - ) # pylint: disable=inconsistent-return-statements - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_uri: str, load_balancer_name: str, **kwargs: Any - ) -> None: + ) + async def delete(self, resource_uri: str, load_balancer_name: str, **kwargs: Any) -> None: """Delete a LoadBalancer. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -1264,7 +1257,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1298,7 +1291,7 @@ async def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -1321,7 +1314,7 @@ def list(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_models.LoadB cls: ClsType[List[_models.LoadBalancer]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1385,7 +1378,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1405,10 +1398,12 @@ class BgpPeersOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerOrchestratorRuntimeMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get(self, resource_uri: str, bgp_peer_name: str, **kwargs: Any) -> _models.BgpPeer: @@ -1423,7 +1418,7 @@ async def get(self, resource_uri: str, bgp_peer_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.containerorchestratorruntime.models.BgpPeer :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1462,7 +1457,7 @@ async def get(self, resource_uri: str, bgp_peer_name: str, **kwargs: Any) -> _mo except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1478,7 +1473,7 @@ async def get(self, resource_uri: str, bgp_peer_name: str, **kwargs: Any) -> _mo async def _create_or_update_initial( self, resource_uri: str, bgp_peer_name: str, resource: Union[_models.BgpPeer, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1526,7 +1521,7 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1703,10 +1698,8 @@ def get_long_running_output(pipeline_response): @api_version_validation( method_added_on="2024-03-01", params_added_on={"2024-03-01": ["api_version", "resource_uri", "bgp_peer_name", "accept"]}, - ) # pylint: disable=inconsistent-return-statements - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_uri: str, bgp_peer_name: str, **kwargs: Any - ) -> None: + ) + async def delete(self, resource_uri: str, bgp_peer_name: str, **kwargs: Any) -> None: """Delete a BgpPeer. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -1718,7 +1711,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1752,7 +1745,7 @@ async def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -1775,7 +1768,7 @@ def list(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_models.BgpPe cls: ClsType[List[_models.BgpPeer]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1839,7 +1832,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1859,10 +1852,12 @@ class ServicesOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerOrchestratorRuntimeMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get(self, resource_uri: str, service_name: str, **kwargs: Any) -> _models.ServiceResource: @@ -1877,7 +1872,7 @@ async def get(self, resource_uri: str, service_name: str, **kwargs: Any) -> _mod :rtype: ~azure.mgmt.containerorchestratorruntime.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1916,7 +1911,7 @@ async def get(self, resource_uri: str, service_name: str, **kwargs: Any) -> _mod except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2033,7 +2028,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerorchestratorruntime.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2082,7 +2077,7 @@ async def create_or_update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2096,9 +2091,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_uri: str, service_name: str, **kwargs: Any - ) -> None: + async def delete(self, resource_uri: str, service_name: str, **kwargs: Any) -> None: """Delete a ServiceResource. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -2110,7 +2103,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2144,7 +2137,7 @@ async def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -2167,7 +2160,7 @@ def list(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_models.Servi cls: ClsType[List[_models.ServiceResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2231,7 +2224,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/models/__init__.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/models/__init__.py index 32da6892512..63de6f947b3 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/models/__init__.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/models/__init__.py @@ -5,48 +5,59 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models import BgpPeer -from ._models import BgpPeerProperties -from ._models import BlobStorageClassTypeProperties -from ._models import ErrorAdditionalInfo -from ._models import ErrorDetail -from ._models import ErrorResponse -from ._models import ExtensionResource -from ._models import LoadBalancer -from ._models import LoadBalancerProperties -from ._models import NativeStorageClassTypeProperties -from ._models import NfsStorageClassTypeProperties -from ._models import Operation -from ._models import OperationDisplay -from ._models import Resource -from ._models import RwxStorageClassTypeProperties -from ._models import ServiceProperties -from ._models import ServiceResource -from ._models import SmbStorageClassTypeProperties -from ._models import StorageClassProperties -from ._models import StorageClassPropertiesUpdate -from ._models import StorageClassResource -from ._models import StorageClassResourceUpdate -from ._models import StorageClassTypeProperties -from ._models import StorageClassTypePropertiesUpdate -from ._models import SystemData +from typing import TYPE_CHECKING -from ._enums import AccessMode -from ._enums import ActionType -from ._enums import AdvertiseMode -from ._enums import CreatedByType -from ._enums import DataResilienceTier -from ._enums import FailoverTier -from ._enums import NfsDirectoryActionOnVolumeDeletion -from ._enums import Origin -from ._enums import PerformanceTier -from ._enums import ProvisioningState -from ._enums import SCType -from ._enums import VolumeBindingMode -from ._enums import VolumeExpansion +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + BgpPeer, + BgpPeerProperties, + BlobStorageClassTypeProperties, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + ExtensionResource, + LoadBalancer, + LoadBalancerProperties, + NativeStorageClassTypeProperties, + NfsStorageClassTypeProperties, + Operation, + OperationDisplay, + Resource, + RwxStorageClassTypeProperties, + ServiceProperties, + ServiceResource, + SmbStorageClassTypeProperties, + StorageClassProperties, + StorageClassPropertiesUpdate, + StorageClassResource, + StorageClassResourceUpdate, + StorageClassTypeProperties, + StorageClassTypePropertiesUpdate, + SystemData, +) + +from ._enums import ( # type: ignore + AccessMode, + ActionType, + AdvertiseMode, + CreatedByType, + DataResilienceTier, + FailoverTier, + NfsDirectoryActionOnVolumeDeletion, + Origin, + PerformanceTier, + ProvisioningState, + SCType, + VolumeBindingMode, + VolumeExpansion, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -89,5 +100,5 @@ "VolumeBindingMode", "VolumeExpansion", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/models/_models.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/models/_models.py index d8a3a5b8103..cca1dbdf455 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/models/_models.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/models/_models.py @@ -1,11 +1,12 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 -# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation import datetime from typing import Any, Dict, List, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload @@ -15,7 +16,6 @@ from ._enums import SCType if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models @@ -25,7 +25,7 @@ class Resource(_model_base.Model): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -39,7 +39,7 @@ class Resource(_model_base.Model): id: Optional[str] = rest_field(visibility=["read"]) """Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long""" + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" name: Optional[str] = rest_field(visibility=["read"]) """The name of the resource.""" type: Optional[str] = rest_field(visibility=["read"]) @@ -55,7 +55,7 @@ class ExtensionResource(Resource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -74,7 +74,7 @@ class BgpPeer(ExtensionResource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -88,7 +88,9 @@ class BgpPeer(ExtensionResource): :vartype properties: ~azure.mgmt.containerorchestratorruntime.models.BgpPeerProperties """ - properties: Optional["_models.BgpPeerProperties"] = rest_field() + properties: Optional["_models.BgpPeerProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -96,16 +98,16 @@ def __init__( self, *, properties: Optional["_models.BgpPeerProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -127,11 +129,11 @@ class BgpPeerProperties(_model_base.Model): ~azure.mgmt.containerorchestratorruntime.models.ProvisioningState """ - my_asn: int = rest_field(name="myAsn") + my_asn: int = rest_field(name="myAsn", visibility=["read", "create", "update", "delete", "query"]) """My ASN. Required.""" - peer_asn: int = rest_field(name="peerAsn") + peer_asn: int = rest_field(name="peerAsn", visibility=["read", "create", "update", "delete", "query"]) """Peer ASN. Required.""" - peer_address: str = rest_field(name="peerAddress") + peer_address: str = rest_field(name="peerAddress", visibility=["read", "create", "update", "delete", "query"]) """Peer Address. Required.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] @@ -146,16 +148,16 @@ def __init__( my_asn: int, peer_asn: int, peer_address: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -173,7 +175,7 @@ class StorageClassTypeProperties(_model_base.Model): """ __mapping__: Dict[str, _model_base.Model] = {} - type: str = rest_discriminator(name="type") + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) """Type of the storage class. Required. Known values are: \"Native\", \"RWX\", \"Blob\", \"NFS\", and \"SMB\".""" @@ -182,16 +184,16 @@ def __init__( self, *, type: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -207,11 +209,15 @@ class BlobStorageClassTypeProperties(StorageClassTypeProperties, discriminator=" :vartype azure_storage_account_key: str """ - type: Literal[SCType.BLOB] = rest_discriminator(name="type") # type: ignore + type: Literal[SCType.BLOB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Blob StorageClass. Required. Blob storage class""" - azure_storage_account_name: str = rest_field(name="azureStorageAccountName") + azure_storage_account_name: str = rest_field( + name="azureStorageAccountName", visibility=["read", "create", "update", "delete", "query"] + ) """Azure Storage Account Name. Required.""" - azure_storage_account_key: str = rest_field(name="azureStorageAccountKey") + azure_storage_account_key: str = rest_field( + name="azureStorageAccountKey", visibility=["read", "create", "update", "delete", "query"] + ) """Azure Storage Account Key. Required.""" @overload @@ -220,16 +226,16 @@ def __init__( *, azure_storage_account_name: str, azure_storage_account_key: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, type=SCType.BLOB, **kwargs) @@ -290,7 +296,7 @@ class ErrorResponse(_model_base.Model): :vartype error: ~azure.mgmt.containerorchestratorruntime.models.ErrorDetail """ - error: Optional["_models.ErrorDetail"] = rest_field() + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The error object.""" @overload @@ -298,16 +304,16 @@ def __init__( self, *, error: Optional["_models.ErrorDetail"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -317,7 +323,7 @@ class LoadBalancer(ExtensionResource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -331,7 +337,9 @@ class LoadBalancer(ExtensionResource): :vartype properties: ~azure.mgmt.containerorchestratorruntime.models.LoadBalancerProperties """ - properties: Optional["_models.LoadBalancerProperties"] = rest_field() + properties: Optional["_models.LoadBalancerProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -339,16 +347,16 @@ def __init__( self, *, properties: Optional["_models.LoadBalancerProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -375,14 +383,20 @@ class LoadBalancerProperties(_model_base.Model): ~azure.mgmt.containerorchestratorruntime.models.ProvisioningState """ - addresses: List[str] = rest_field() + addresses: List[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """IP Range. Required.""" - service_selector: Optional[Dict[str, str]] = rest_field(name="serviceSelector") + service_selector: Optional[Dict[str, str]] = rest_field( + name="serviceSelector", visibility=["read", "create", "update", "delete", "query"] + ) """A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label \"a=b\", then please specify {\"a\": \"b\"} in the field.""" - advertise_mode: Union[str, "_models.AdvertiseMode"] = rest_field(name="advertiseMode") + advertise_mode: Union[str, "_models.AdvertiseMode"] = rest_field( + name="advertiseMode", visibility=["read", "create", "update", "delete", "query"] + ) """Advertise Mode. Required. Known values are: \"ARP\", \"BGP\", and \"Both\".""" - bgp_peers: Optional[List[str]] = rest_field(name="bgpPeers") + bgp_peers: Optional[List[str]] = rest_field( + name="bgpPeers", visibility=["read", "create", "update", "delete", "query"] + ) """The list of BGP peers it should advertise to. Null or empty means to advertise to all peers.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] @@ -398,16 +412,16 @@ def __init__( advertise_mode: Union[str, "_models.AdvertiseMode"], service_selector: Optional[Dict[str, str]] = None, bgp_peers: Optional[List[str]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -419,22 +433,22 @@ class NativeStorageClassTypeProperties(StorageClassTypeProperties, discriminator :vartype type: str or ~azure.mgmt.containerorchestratorruntime.models.NATIVE """ - type: Literal[SCType.NATIVE] = rest_discriminator(name="type") # type: ignore + type: Literal[SCType.NATIVE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Native StorageClass. Required. Native storage class""" @overload def __init__( self, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, type=SCType.NATIVE, **kwargs) @@ -460,18 +474,22 @@ class NfsStorageClassTypeProperties(StorageClassTypeProperties, discriminator="N ~azure.mgmt.containerorchestratorruntime.models.NfsDirectoryActionOnVolumeDeletion """ - type: Literal[SCType.NFS] = rest_discriminator(name="type") # type: ignore + type: Literal[SCType.NFS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """NFS StorageClass. Required. NFS storage class""" - server: str = rest_field() + server: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """NFS Server. Required.""" - share: str = rest_field() + share: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """NFS share. Required.""" - sub_dir: Optional[str] = rest_field(name="subDir") + sub_dir: Optional[str] = rest_field(name="subDir", visibility=["read", "create", "update", "delete", "query"]) """Sub directory under share. If the sub directory doesn't exist, driver will create it.""" - mount_permissions: Optional[str] = rest_field(name="mountPermissions") + mount_permissions: Optional[str] = rest_field( + name="mountPermissions", visibility=["read", "create", "update", "delete", "query"] + ) """Mounted folder permissions. Default is 0. If set as non-zero, driver will perform ``chmod`` after mount.""" - on_delete: Optional[Union[str, "_models.NfsDirectoryActionOnVolumeDeletion"]] = rest_field(name="onDelete") + on_delete: Optional[Union[str, "_models.NfsDirectoryActionOnVolumeDeletion"]] = rest_field( + name="onDelete", visibility=["read", "create", "update", "delete", "query"] + ) """The action to take when a NFS volume is deleted. Default is Delete. Known values are: \"Delete\" and \"Retain\".""" @@ -484,16 +502,16 @@ def __init__( sub_dir: Optional[str] = None, mount_permissions: Optional[str] = None, on_delete: Optional[Union[str, "_models.NfsDirectoryActionOnVolumeDeletion"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, type=SCType.NFS, **kwargs) @@ -526,13 +544,15 @@ class Operation(_model_base.Model): is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.""" - display: Optional["_models.OperationDisplay"] = rest_field(visibility=["read"]) + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Localized display information for this particular operation.""" origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and \"user,system\".""" - action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType") + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. \"Internal\"""" @@ -540,17 +560,17 @@ class Operation(_model_base.Model): def __init__( self, *, - action_type: Optional[Union[str, "_models.ActionType"]] = None, - ): ... + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -598,9 +618,11 @@ class RwxStorageClassTypeProperties(StorageClassTypeProperties, discriminator="R :vartype backing_storage_class_name: str """ - type: Literal[SCType.RWX] = rest_discriminator(name="type") # type: ignore + type: Literal[SCType.RWX] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """RWX StorageClass. Required. RWX storage class""" - backing_storage_class_name: str = rest_field(name="backingStorageClassName") + backing_storage_class_name: str = rest_field( + name="backingStorageClassName", visibility=["read", "create", "update", "delete", "query"] + ) """The backing storageclass used to create new storageclass. Required.""" @overload @@ -608,16 +630,16 @@ def __init__( self, *, backing_storage_class_name: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, type=SCType.RWX, **kwargs) @@ -649,7 +671,7 @@ class ServiceResource(ExtensionResource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -663,7 +685,9 @@ class ServiceResource(ExtensionResource): :vartype properties: ~azure.mgmt.containerorchestratorruntime.models.ServiceProperties """ - properties: Optional["_models.ServiceProperties"] = rest_field() + properties: Optional["_models.ServiceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -671,16 +695,16 @@ def __init__( self, *, properties: Optional["_models.ServiceProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -703,17 +727,17 @@ class SmbStorageClassTypeProperties(StorageClassTypeProperties, discriminator="S :vartype domain: str """ - type: Literal[SCType.SMB] = rest_discriminator(name="type") # type: ignore + type: Literal[SCType.SMB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """SMB StorageClass. Required. SMB storage class""" - source: str = rest_field() + source: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """SMB Source. Required.""" - sub_dir: Optional[str] = rest_field(name="subDir") + sub_dir: Optional[str] = rest_field(name="subDir", visibility=["read", "create", "update", "delete", "query"]) """Sub directory under share. If the sub directory doesn't exist, driver will create it.""" - username: Optional[str] = rest_field() + username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Server username.""" - password: Optional[str] = rest_field() + password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Server password.""" - domain: Optional[str] = rest_field() + domain: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Server domain.""" @overload @@ -725,20 +749,20 @@ def __init__( username: Optional[str] = None, password: Optional[str] = None, domain: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, type=SCType.SMB, **kwargs) -class StorageClassProperties(_model_base.Model): # pylint: disable=too-many-instance-attributes +class StorageClassProperties(_model_base.Model): """Details of the StorageClass StorageClass. Readonly variables are only populated by the server, and will be ignored when sending a request. @@ -782,9 +806,13 @@ class StorageClassProperties(_model_base.Model): # pylint: disable=too-many-ins ~azure.mgmt.containerorchestratorruntime.models.ProvisioningState """ - allow_volume_expansion: Optional[Union[str, "_models.VolumeExpansion"]] = rest_field(name="allowVolumeExpansion") + allow_volume_expansion: Optional[Union[str, "_models.VolumeExpansion"]] = rest_field( + name="allowVolumeExpansion", visibility=["read", "create", "update", "delete", "query"] + ) """Volume can be expanded or not. Known values are: \"Allow\" and \"Disallow\".""" - mount_options: Optional[List[str]] = rest_field(name="mountOptions") + mount_options: Optional[List[str]] = rest_field( + name="mountOptions", visibility=["read", "create", "update", "delete", "query"] + ) """Additional mount options.""" provisioner: Optional[str] = rest_field(visibility=["read", "create"]) """Provisioner name.""" @@ -793,19 +821,27 @@ class StorageClassProperties(_model_base.Model): # pylint: disable=too-many-ins ) """Binding mode of volumes: Immediate, WaitForFirstConsumer. Known values are: \"Immediate\" and \"WaitForFirstConsumer\".""" - access_modes: Optional[List[Union[str, "_models.AccessMode"]]] = rest_field(name="accessModes") + access_modes: Optional[List[Union[str, "_models.AccessMode"]]] = rest_field( + name="accessModes", visibility=["read", "create", "update", "delete", "query"] + ) """The access mode: [ReadWriteOnce, ReadWriteMany] or [ReadWriteOnce].""" - data_resilience: Optional[Union[str, "_models.DataResilienceTier"]] = rest_field(name="dataResilience") + data_resilience: Optional[Union[str, "_models.DataResilienceTier"]] = rest_field( + name="dataResilience", visibility=["read", "create", "update", "delete", "query"] + ) """Allow single data node failure. Known values are: \"NotDataResilient\" and \"DataResilient\".""" - failover_speed: Optional[Union[str, "_models.FailoverTier"]] = rest_field(name="failoverSpeed") + failover_speed: Optional[Union[str, "_models.FailoverTier"]] = rest_field( + name="failoverSpeed", visibility=["read", "create", "update", "delete", "query"] + ) """Failover speed: NA, Slow, Fast. Known values are: \"NotAvailable\", \"Slow\", \"Fast\", and \"Super\".""" - limitations: Optional[List[str]] = rest_field() + limitations: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Limitations of the storage class.""" - performance: Optional[Union[str, "_models.PerformanceTier"]] = rest_field() + performance: Optional[Union[str, "_models.PerformanceTier"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Performance tier. Known values are: \"Undefined\", \"Basic\", \"Standard\", \"Premium\", and \"Ultra\".""" - priority: Optional[int] = rest_field() + priority: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Selection priority when multiple storage classes meet the criteria. 0: Highest, -1: Never use.""" type_properties: "_models.StorageClassTypeProperties" = rest_field( name="typeProperties", visibility=["read", "create"] @@ -832,16 +868,16 @@ def __init__( limitations: Optional[List[str]] = None, performance: Optional[Union[str, "_models.PerformanceTier"]] = None, priority: Optional[int] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -876,25 +912,39 @@ class StorageClassPropertiesUpdate(_model_base.Model): ~azure.mgmt.containerorchestratorruntime.models.StorageClassTypePropertiesUpdate """ - allow_volume_expansion: Optional[Union[str, "_models.VolumeExpansion"]] = rest_field(name="allowVolumeExpansion") + allow_volume_expansion: Optional[Union[str, "_models.VolumeExpansion"]] = rest_field( + name="allowVolumeExpansion", visibility=["read", "create", "update", "delete", "query"] + ) """Volume can be expanded or not. Known values are: \"Allow\" and \"Disallow\".""" - mount_options: Optional[List[str]] = rest_field(name="mountOptions") + mount_options: Optional[List[str]] = rest_field( + name="mountOptions", visibility=["read", "create", "update", "delete", "query"] + ) """Additional mount options.""" - access_modes: Optional[List[Union[str, "_models.AccessMode"]]] = rest_field(name="accessModes") + access_modes: Optional[List[Union[str, "_models.AccessMode"]]] = rest_field( + name="accessModes", visibility=["read", "create", "update", "delete", "query"] + ) """The access mode: [ReadWriteOnce, ReadWriteMany] or [ReadWriteOnce].""" - data_resilience: Optional[Union[str, "_models.DataResilienceTier"]] = rest_field(name="dataResilience") + data_resilience: Optional[Union[str, "_models.DataResilienceTier"]] = rest_field( + name="dataResilience", visibility=["read", "create", "update", "delete", "query"] + ) """Allow single data node failure. Known values are: \"NotDataResilient\" and \"DataResilient\".""" - failover_speed: Optional[Union[str, "_models.FailoverTier"]] = rest_field(name="failoverSpeed") + failover_speed: Optional[Union[str, "_models.FailoverTier"]] = rest_field( + name="failoverSpeed", visibility=["read", "create", "update", "delete", "query"] + ) """Failover speed: NA, Slow, Fast. Known values are: \"NotAvailable\", \"Slow\", \"Fast\", and \"Super\".""" - limitations: Optional[List[str]] = rest_field() + limitations: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Limitations of the storage class.""" - performance: Optional[Union[str, "_models.PerformanceTier"]] = rest_field() + performance: Optional[Union[str, "_models.PerformanceTier"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Performance tier. Known values are: \"Undefined\", \"Basic\", \"Standard\", \"Premium\", and \"Ultra\".""" - priority: Optional[int] = rest_field() + priority: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Selection priority when multiple storage classes meet the criteria. 0: Highest, -1: Never use.""" - type_properties: Optional["_models.StorageClassTypePropertiesUpdate"] = rest_field(name="typeProperties") + type_properties: Optional["_models.StorageClassTypePropertiesUpdate"] = rest_field( + name="typeProperties", visibility=["read", "create", "update", "delete", "query"] + ) """New storage class type of storageClass.""" @overload @@ -910,16 +960,16 @@ def __init__( performance: Optional[Union[str, "_models.PerformanceTier"]] = None, priority: Optional[int] = None, type_properties: Optional["_models.StorageClassTypePropertiesUpdate"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -929,7 +979,7 @@ class StorageClassResource(ExtensionResource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -943,7 +993,9 @@ class StorageClassResource(ExtensionResource): :vartype properties: ~azure.mgmt.containerorchestratorruntime.models.StorageClassProperties """ - properties: Optional["_models.StorageClassProperties"] = rest_field() + properties: Optional["_models.StorageClassProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -951,16 +1003,16 @@ def __init__( self, *, properties: Optional["_models.StorageClassProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -972,7 +1024,9 @@ class StorageClassResourceUpdate(_model_base.Model): ~azure.mgmt.containerorchestratorruntime.models.StorageClassPropertiesUpdate """ - properties: Optional["_models.StorageClassPropertiesUpdate"] = rest_field() + properties: Optional["_models.StorageClassPropertiesUpdate"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The properties of StorageClass.""" @overload @@ -980,20 +1034,20 @@ def __init__( self, *, properties: Optional["_models.StorageClassPropertiesUpdate"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StorageClassTypePropertiesUpdate(_model_base.Model): # pylint: disable=too-many-instance-attributes +class StorageClassTypePropertiesUpdate(_model_base.Model): """The model for update a storageClass. :ivar backing_storage_class_name: The backing storageclass used to create new storageclass. @@ -1026,31 +1080,41 @@ class StorageClassTypePropertiesUpdate(_model_base.Model): # pylint: disable=to :vartype domain: str """ - backing_storage_class_name: Optional[str] = rest_field(name="backingStorageClassName") + backing_storage_class_name: Optional[str] = rest_field( + name="backingStorageClassName", visibility=["read", "create", "update", "delete", "query"] + ) """The backing storageclass used to create new storageclass.""" - azure_storage_account_name: Optional[str] = rest_field(name="azureStorageAccountName") + azure_storage_account_name: Optional[str] = rest_field( + name="azureStorageAccountName", visibility=["read", "create", "update", "delete", "query"] + ) """Azure Storage Account Name.""" - azure_storage_account_key: Optional[str] = rest_field(name="azureStorageAccountKey") + azure_storage_account_key: Optional[str] = rest_field( + name="azureStorageAccountKey", visibility=["read", "create", "update", "delete", "query"] + ) """Azure Storage Account Key.""" - server: Optional[str] = rest_field() + server: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """NFS Server.""" - share: Optional[str] = rest_field() + share: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """NFS share.""" - sub_dir: Optional[str] = rest_field(name="subDir") + sub_dir: Optional[str] = rest_field(name="subDir", visibility=["read", "create", "update", "delete", "query"]) """Sub directory under share. If the sub directory doesn't exist, driver will create it.""" - mount_permissions: Optional[str] = rest_field(name="mountPermissions") + mount_permissions: Optional[str] = rest_field( + name="mountPermissions", visibility=["read", "create", "update", "delete", "query"] + ) """Mounted folder permissions. Default is 0. If set as non-zero, driver will perform ``chmod`` after mount.""" - on_delete: Optional[Union[str, "_models.NfsDirectoryActionOnVolumeDeletion"]] = rest_field(name="onDelete") + on_delete: Optional[Union[str, "_models.NfsDirectoryActionOnVolumeDeletion"]] = rest_field( + name="onDelete", visibility=["read", "create", "update", "delete", "query"] + ) """The action to take when a NFS volume is deleted. Default is Delete. Known values are: \"Delete\" and \"Retain\".""" - source: Optional[str] = rest_field() + source: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """SMB Source.""" - username: Optional[str] = rest_field() + username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Server username.""" - password: Optional[str] = rest_field() + password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Server password.""" - domain: Optional[str] = rest_field() + domain: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Server domain.""" @overload @@ -1069,16 +1133,16 @@ def __init__( username: Optional[str] = None, password: Optional[str] = None, domain: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1102,19 +1166,29 @@ class SystemData(_model_base.Model): :vartype last_modified_at: ~datetime.datetime """ - created_by: Optional[str] = rest_field(name="createdBy") + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) """The identity that created the resource.""" - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="createdByType") + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) """The type of identity that created the resource. Known values are: \"User\", \"Application\", \"ManagedIdentity\", and \"Key\".""" - created_at: Optional[datetime.datetime] = rest_field(name="createdAt", format="rfc3339") + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """The timestamp of resource creation (UTC).""" - last_modified_by: Optional[str] = rest_field(name="lastModifiedBy") + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) """The identity that last modified the resource.""" - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="lastModifiedByType") + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) """The type of identity that last modified the resource. Known values are: \"User\", \"Application\", \"ManagedIdentity\", and \"Key\".""" - last_modified_at: Optional[datetime.datetime] = rest_field(name="lastModifiedAt", format="rfc3339") + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """The timestamp of resource last modification (UTC).""" @overload @@ -1127,14 +1201,14 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/operations/__init__.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/operations/__init__.py index d5be48a83d1..24996bcbb3d 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/operations/__init__.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/operations/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import StorageClassOperations -from ._operations import Operations -from ._operations import LoadBalancersOperations -from ._operations import BgpPeersOperations -from ._operations import ServicesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import StorageClassOperations # type: ignore +from ._operations import Operations # type: ignore +from ._operations import LoadBalancersOperations # type: ignore +from ._operations import BgpPeersOperations # type: ignore +from ._operations import ServicesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -23,5 +29,5 @@ "BgpPeersOperations", "ServicesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/operations/_operations.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/operations/_operations.py index 6b70f5b753b..8d1240190a5 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/operations/_operations.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/azure/mgmt/containerorchestratorruntime/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -9,9 +9,10 @@ from io import IOBase import json import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -32,14 +33,15 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Serializer +from .._configuration import ContainerOrchestratorRuntimeMgmtClientConfiguration +from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._serialization import Deserializer, Serializer from .._validation import api_version_validation if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -58,7 +60,7 @@ def build_storage_class_get_request(resource_uri: str, storage_class_name: str, # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName}" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), "storageClassName": _SERIALIZER.url("storage_class_name", storage_class_name, "str"), } @@ -86,7 +88,7 @@ def build_storage_class_create_or_update_request( # pylint: disable=name-too-lo # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName}" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), "storageClassName": _SERIALIZER.url("storage_class_name", storage_class_name, "str"), } @@ -114,7 +116,7 @@ def build_storage_class_update_request(resource_uri: str, storage_class_name: st # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName}" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), "storageClassName": _SERIALIZER.url("storage_class_name", storage_class_name, "str"), } @@ -141,7 +143,7 @@ def build_storage_class_delete_request(resource_uri: str, storage_class_name: st # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName}" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), "storageClassName": _SERIALIZER.url("storage_class_name", storage_class_name, "str"), } @@ -166,7 +168,7 @@ def build_storage_class_list_request(resource_uri: str, **kwargs: Any) -> HttpRe # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -209,7 +211,7 @@ def build_load_balancers_get_request(resource_uri: str, load_balancer_name: str, # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName}" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), } @@ -237,7 +239,7 @@ def build_load_balancers_create_or_update_request( # pylint: disable=name-too-l # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName}" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), } @@ -264,7 +266,7 @@ def build_load_balancers_delete_request(resource_uri: str, load_balancer_name: s # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName}" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), } @@ -289,7 +291,7 @@ def build_load_balancers_list_request(resource_uri: str, **kwargs: Any) -> HttpR # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -313,7 +315,7 @@ def build_bgp_peers_get_request(resource_uri: str, bgp_peer_name: str, **kwargs: # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName}" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), "bgpPeerName": _SERIALIZER.url("bgp_peer_name", bgp_peer_name, "str"), } @@ -339,7 +341,7 @@ def build_bgp_peers_create_or_update_request(resource_uri: str, bgp_peer_name: s # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName}" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), "bgpPeerName": _SERIALIZER.url("bgp_peer_name", bgp_peer_name, "str"), } @@ -366,7 +368,7 @@ def build_bgp_peers_delete_request(resource_uri: str, bgp_peer_name: str, **kwar # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName}" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), "bgpPeerName": _SERIALIZER.url("bgp_peer_name", bgp_peer_name, "str"), } @@ -391,7 +393,7 @@ def build_bgp_peers_list_request(resource_uri: str, **kwargs: Any) -> HttpReques # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -415,7 +417,7 @@ def build_services_get_request(resource_uri: str, service_name: str, **kwargs: A # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName}" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), "serviceName": _SERIALIZER.url("service_name", service_name, "str"), } @@ -441,7 +443,7 @@ def build_services_create_or_update_request(resource_uri: str, service_name: str # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName}" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), "serviceName": _SERIALIZER.url("service_name", service_name, "str"), } @@ -468,7 +470,7 @@ def build_services_delete_request(resource_uri: str, service_name: str, **kwargs # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName}" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), "serviceName": _SERIALIZER.url("service_name", service_name, "str"), } @@ -493,7 +495,7 @@ def build_services_list_request(resource_uri: str, **kwargs: Any) -> HttpRequest # Construct URL _url = "/{resourceUri}/providers/Microsoft.KubernetesRuntime/services" path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str"), + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -519,10 +521,12 @@ class StorageClassOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerOrchestratorRuntimeMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get(self, resource_uri: str, storage_class_name: str, **kwargs: Any) -> _models.StorageClassResource: @@ -537,7 +541,7 @@ def get(self, resource_uri: str, storage_class_name: str, **kwargs: Any) -> _mod :rtype: ~azure.mgmt.containerorchestratorruntime.models.StorageClassResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -576,7 +580,7 @@ def get(self, resource_uri: str, storage_class_name: str, **kwargs: Any) -> _mod except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -596,7 +600,7 @@ def _create_or_update_initial( resource: Union[_models.StorageClassResource, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -644,7 +648,7 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -829,7 +833,7 @@ def _update_initial( properties: Union[_models.StorageClassResourceUpdate, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -877,7 +881,7 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1057,7 +1061,7 @@ def get_long_running_output(pipeline_response): ) def _delete_initial(self, resource_uri: str, storage_class_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1095,7 +1099,7 @@ def _delete_initial(self, resource_uri: str, storage_class_name: str, **kwargs: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1184,7 +1188,7 @@ def list(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.StorageCla cls: ClsType[List[_models.StorageClassResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1248,7 +1252,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1268,10 +1272,12 @@ class Operations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerOrchestratorRuntimeMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -1286,7 +1292,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1349,7 +1355,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1369,10 +1375,12 @@ class LoadBalancersOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerOrchestratorRuntimeMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get(self, resource_uri: str, load_balancer_name: str, **kwargs: Any) -> _models.LoadBalancer: @@ -1387,7 +1395,7 @@ def get(self, resource_uri: str, load_balancer_name: str, **kwargs: Any) -> _mod :rtype: ~azure.mgmt.containerorchestratorruntime.models.LoadBalancer :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1426,7 +1434,7 @@ def get(self, resource_uri: str, load_balancer_name: str, **kwargs: Any) -> _mod except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1446,7 +1454,7 @@ def _create_or_update_initial( resource: Union[_models.LoadBalancer, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1494,7 +1502,7 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1676,7 +1684,7 @@ def get_long_running_output(pipeline_response): @api_version_validation( method_added_on="2024-03-01", params_added_on={"2024-03-01": ["api_version", "resource_uri", "load_balancer_name", "accept"]}, - ) # pylint: disable=inconsistent-return-statements + ) def delete( # pylint: disable=inconsistent-return-statements self, resource_uri: str, load_balancer_name: str, **kwargs: Any ) -> None: @@ -1691,7 +1699,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1725,7 +1733,7 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -1748,7 +1756,7 @@ def list(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.LoadBalanc cls: ClsType[List[_models.LoadBalancer]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1812,7 +1820,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1832,10 +1840,12 @@ class BgpPeersOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerOrchestratorRuntimeMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get(self, resource_uri: str, bgp_peer_name: str, **kwargs: Any) -> _models.BgpPeer: @@ -1850,7 +1860,7 @@ def get(self, resource_uri: str, bgp_peer_name: str, **kwargs: Any) -> _models.B :rtype: ~azure.mgmt.containerorchestratorruntime.models.BgpPeer :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1889,7 +1899,7 @@ def get(self, resource_uri: str, bgp_peer_name: str, **kwargs: Any) -> _models.B except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1905,7 +1915,7 @@ def get(self, resource_uri: str, bgp_peer_name: str, **kwargs: Any) -> _models.B def _create_or_update_initial( self, resource_uri: str, bgp_peer_name: str, resource: Union[_models.BgpPeer, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1953,7 +1963,7 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2126,7 +2136,7 @@ def get_long_running_output(pipeline_response): @api_version_validation( method_added_on="2024-03-01", params_added_on={"2024-03-01": ["api_version", "resource_uri", "bgp_peer_name", "accept"]}, - ) # pylint: disable=inconsistent-return-statements + ) def delete( # pylint: disable=inconsistent-return-statements self, resource_uri: str, bgp_peer_name: str, **kwargs: Any ) -> None: @@ -2141,7 +2151,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2175,7 +2185,7 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -2197,7 +2207,7 @@ def list(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.BgpPeer"]: cls: ClsType[List[_models.BgpPeer]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2261,7 +2271,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2281,10 +2291,12 @@ class ServicesOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerOrchestratorRuntimeMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get(self, resource_uri: str, service_name: str, **kwargs: Any) -> _models.ServiceResource: @@ -2299,7 +2311,7 @@ def get(self, resource_uri: str, service_name: str, **kwargs: Any) -> _models.Se :rtype: ~azure.mgmt.containerorchestratorruntime.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2338,7 +2350,7 @@ def get(self, resource_uri: str, service_name: str, **kwargs: Any) -> _models.Se except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2455,7 +2467,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerorchestratorruntime.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2504,7 +2516,7 @@ def create_or_update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2532,7 +2544,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2566,7 +2578,7 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -2589,7 +2601,7 @@ def list(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.ServiceRes cls: ClsType[List[_models.ServiceResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2653,7 +2665,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_create_or_update.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_create_or_update.py index ed9d2896640..e906687469d 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_create_or_update.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_delete.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_delete.py index 298e26dab49..9d2c5683912 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_delete.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_get.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_get.py index 3472f7ace8a..6449b07a187 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_get.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_list.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_list.py index 9811f88579b..0539a98be00 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_list.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/bgp_peers_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_create_or_update.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_create_or_update.py index 63d6d22e9fc..1573396614c 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_create_or_update.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_delete.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_delete.py index 5fee0135f06..75bdb8da001 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_delete.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_get.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_get.py index 76cb1d21ffd..1589635078c 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_get.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_list.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_list.py index 87123453150..d69c1bf7b89 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_list.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/load_balancers_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_create_or_update.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_create_or_update.py index 72da9a29129..4a3606290b2 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_create_or_update.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_delete.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_delete.py index a9a012cf94e..897b89989f9 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_delete.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_get.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_get.py index 7ab1943a5fe..72210dc2203 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_get.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_list.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_list.py index 2d4303cd520..9f351d6bcf3 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_list.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/services_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_create_or_update.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_create_or_update.py index 69784cfb520..32e303064b5 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_create_or_update.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_delete.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_delete.py index dfc7e2bc606..967e96a1791 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_delete.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_get.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_get.py index 03a18c70b12..48cebf90a47 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_get.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_list.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_list.py index aa0df8e1a11..daef633ad88 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_list.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_update.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_update.py index a34094deef6..7c3957fad00 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_update.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/generated_samples/storage_class_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/tests/test_container_orchestrator_runtime_mgmt_operations_async_test.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/tests/test_container_orchestrator_runtime_mgmt_operations_async_test.py index 75b4c2717ed..75b01e431bc 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/tests/test_container_orchestrator_runtime_mgmt_operations_async_test.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/tests/test_container_orchestrator_runtime_mgmt_operations_async_test.py @@ -25,4 +25,3 @@ async def test_operations_list(self, resource_group): response = self.client.operations.list() result = [r async for r in response] assert result - diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/tests/test_container_orchestrator_runtime_mgmt_operations_test.py b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/tests/test_container_orchestrator_runtime_mgmt_operations_test.py index 48443dc6cc6..3b4efd21a4a 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/tests/test_container_orchestrator_runtime_mgmt_operations_test.py +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/tests/test_container_orchestrator_runtime_mgmt_operations_test.py @@ -24,4 +24,3 @@ def test_operations_list(self, resource_group): response = self.client.operations.list() result = [r for r in response] assert result - diff --git a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/tsp-location.yaml b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/tsp-location.yaml index ce77567f6c9..2664abc1b04 100644 --- a/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/tsp-location.yaml +++ b/sdk/containerorchestratorruntime/azure-mgmt-containerorchestratorruntime/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/kubernetesruntime/KubernetesRuntime.Management -commit: 399cbac2de1bc0acbed4c9a0a864a9c84da3692e +commit: c0d702050e711d4c52d5fe6744191c5c6ca1df4c repo: Azure/azure-rest-api-specs additionalDirectories: