diff --git a/sdk/standbypool/azure-mgmt-standbypool/_meta.json b/sdk/standbypool/azure-mgmt-standbypool/_meta.json index 3e4fe5c69a6f..b22b7be4a6bb 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/_meta.json +++ b/sdk/standbypool/azure-mgmt-standbypool/_meta.json @@ -1,6 +1,6 @@ { - "commit": "e695076ad458a3eac3d6943f9e923544ff52b1e4", + "commit": "605911b2bdd478dadd4b68f5f97d9491131c74e2", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/standbypool/StandbyPool.Management", - "@azure-tools/typespec-python": "0.31.1" + "@azure-tools/typespec-python": "0.38.4" } \ No newline at end of file diff --git a/sdk/standbypool/azure-mgmt-standbypool/apiview-properties.json b/sdk/standbypool/azure-mgmt-standbypool/apiview-properties.json new file mode 100644 index 000000000000..78c9481c28a1 --- /dev/null +++ b/sdk/standbypool/azure-mgmt-standbypool/apiview-properties.json @@ -0,0 +1,61 @@ +{ + "CrossLanguagePackageId": "Microsoft.StandbyPool", + "CrossLanguageDefinitionId": { + "azure.mgmt.standbypool.models.ContainerGroupInstanceCountSummary": "Microsoft.StandbyPool.ContainerGroupInstanceCountSummary", + "azure.mgmt.standbypool.models.ContainerGroupProfile": "Microsoft.StandbyPool.ContainerGroupProfile", + "azure.mgmt.standbypool.models.ContainerGroupProperties": "Microsoft.StandbyPool.ContainerGroupProperties", + "azure.mgmt.standbypool.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.standbypool.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.standbypool.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.standbypool.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.standbypool.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.standbypool.models.PoolResourceStateCount": "Microsoft.StandbyPool.PoolResourceStateCount", + "azure.mgmt.standbypool.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.standbypool.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.standbypool.models.StandbyContainerGroupPoolElasticityProfile": "Microsoft.StandbyPool.StandbyContainerGroupPoolElasticityProfile", + "azure.mgmt.standbypool.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.standbypool.models.StandbyContainerGroupPoolResource": "Microsoft.StandbyPool.StandbyContainerGroupPoolResource", + "azure.mgmt.standbypool.models.StandbyContainerGroupPoolResourceProperties": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties", + "azure.mgmt.standbypool.models.StandbyContainerGroupPoolResourceUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.standbypool.models.StandbyContainerGroupPoolResourceUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.standbypool.models.StandbyContainerGroupPoolRuntimeViewResource": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResource", + "azure.mgmt.standbypool.models.StandbyContainerGroupPoolRuntimeViewResourceProperties": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties", + "azure.mgmt.standbypool.models.StandbyVirtualMachinePoolElasticityProfile": "Microsoft.StandbyPool.StandbyVirtualMachinePoolElasticityProfile", + "azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResource": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResource", + "azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResourceProperties": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties", + "azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResourceUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResourceUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.standbypool.models.StandbyVirtualMachinePoolRuntimeViewResource": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResource", + "azure.mgmt.standbypool.models.StandbyVirtualMachinePoolRuntimeViewResourceProperties": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties", + "azure.mgmt.standbypool.models.StandbyVirtualMachineResource": "Microsoft.StandbyPool.StandbyVirtualMachineResource", + "azure.mgmt.standbypool.models.StandbyVirtualMachineResourceProperties": "Microsoft.StandbyPool.StandbyVirtualMachineResourceProperties", + "azure.mgmt.standbypool.models.Subnet": "Microsoft.StandbyPool.Subnet", + "azure.mgmt.standbypool.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.standbypool.models.VirtualMachineInstanceCountSummary": "Microsoft.StandbyPool.VirtualMachineInstanceCountSummary", + "azure.mgmt.standbypool.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.standbypool.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.standbypool.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.standbypool.models.VirtualMachineState": "Microsoft.StandbyPool.VirtualMachineState", + "azure.mgmt.standbypool.models.ProvisioningState": "Microsoft.StandbyPool.ProvisioningState", + "azure.mgmt.standbypool.models.RefillPolicy": "Microsoft.StandbyPool.RefillPolicy", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pools.get": "Microsoft.StandbyPool.StandbyVirtualMachinePools.get", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pools.begin_create_or_update": "Microsoft.StandbyPool.StandbyVirtualMachinePools.createOrUpdate", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pools.begin_delete": "Microsoft.StandbyPool.StandbyVirtualMachinePools.delete", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pools.update": "Microsoft.StandbyPool.StandbyVirtualMachinePools.update", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pools.list_by_resource_group": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listByResourceGroup", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pools.list_by_subscription": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listBySubscription", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machines.get": "Microsoft.StandbyPool.StandbyVirtualMachines.get", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machines.list_by_standby_virtual_machine_pool_resource": "Microsoft.StandbyPool.StandbyVirtualMachines.listByStandbyVirtualMachinePoolResource", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pool_runtime_views.get": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.get", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pool_runtime_views.list_by_standby_pool": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.listByStandbyPool", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pools.get": "Microsoft.StandbyPool.StandbyContainerGroupPools.get", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pools.begin_create_or_update": "Microsoft.StandbyPool.StandbyContainerGroupPools.createOrUpdate", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pools.begin_delete": "Microsoft.StandbyPool.StandbyContainerGroupPools.delete", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pools.update": "Microsoft.StandbyPool.StandbyContainerGroupPools.update", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pools.list_by_resource_group": "Microsoft.StandbyPool.StandbyContainerGroupPools.listByResourceGroup", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pools.list_by_subscription": "Microsoft.StandbyPool.StandbyContainerGroupPools.listBySubscription", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pool_runtime_views.get": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.get", + "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pool_runtime_views.list_by_standby_pool": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.listByStandbyPool" + } +} \ No newline at end of file diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/__init__.py index a3ea11613bb0..74bce6678210 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/__init__.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/__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 StandbyPoolMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import StandbyPoolMgmtClient # 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__ = [ "StandbyPoolMgmtClient", ] -__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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_client.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_client.py index 7aa263829c91..700b4c30d7af 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_client.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_client.py @@ -27,11 +27,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class StandbyPoolMgmtClient: # pylint: disable=client-accepts-api-version-keyword +class StandbyPoolMgmtClient: """StandbyPoolMgmtClient. :ivar operations: Operations operations diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_configuration.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_configuration.py index e8956f714462..3c547c85940c 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_configuration.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_configuration.py @@ -14,11 +14,10 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class StandbyPoolMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class StandbyPoolMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for StandbyPoolMgmtClient. Note that all parameters used to create this instance are saved as instance diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_model_base.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_model_base.py index 12ad7f29c71e..3072ee252ed9 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_model_base.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_serialization.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_serialization.py index 01a226bd7f14..e2a20b1d534c 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_serialization.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_version.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_version.py index 0ec13ea52bbf..be71c81bd282 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_version.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/__init__.py index 91b6ee862656..87a5f090533e 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/__init__.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/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 StandbyPoolMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import StandbyPoolMgmtClient # 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__ = [ "StandbyPoolMgmtClient", ] -__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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_client.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_client.py index 68015b82e8d6..1e3b26fb9af5 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_client.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_client.py @@ -27,11 +27,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class StandbyPoolMgmtClient: # pylint: disable=client-accepts-api-version-keyword +class StandbyPoolMgmtClient: """StandbyPoolMgmtClient. :ivar operations: Operations operations diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_configuration.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_configuration.py index 5125e06ebbb8..38789a9312e6 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_configuration.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_configuration.py @@ -14,11 +14,10 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class StandbyPoolMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class StandbyPoolMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for StandbyPoolMgmtClient. Note that all parameters used to create this instance are saved as instance diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/__init__.py index 12acea673adc..71fe7806df8e 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/__init__.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/__init__.py @@ -5,16 +5,22 @@ # 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 Operations -from ._operations import StandbyVirtualMachinePoolsOperations -from ._operations import StandbyVirtualMachinesOperations -from ._operations import StandbyVirtualMachinePoolRuntimeViewsOperations -from ._operations import StandbyContainerGroupPoolsOperations -from ._operations import StandbyContainerGroupPoolRuntimeViewsOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import StandbyVirtualMachinePoolsOperations # type: ignore +from ._operations import StandbyVirtualMachinesOperations # type: ignore +from ._operations import StandbyVirtualMachinePoolRuntimeViewsOperations # type: ignore +from ._operations import StandbyContainerGroupPoolsOperations # type: ignore +from ._operations import StandbyContainerGroupPoolRuntimeViewsOperations # 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__ = [ @@ -25,5 +31,5 @@ "StandbyContainerGroupPoolsOperations", "StandbyContainerGroupPoolRuntimeViewsOperations", ] -__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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_operations.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_operations.py index f8bd49760400..148e9d499c78 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_operations.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,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_operations_list_request, @@ -70,11 +58,12 @@ build_standby_virtual_machines_get_request, build_standby_virtual_machines_list_by_standby_virtual_machine_pool_resource_request, ) +from .._configuration import StandbyPoolMgmtClientConfiguration 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 T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -92,15 +81,14 @@ 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """List the operations for the provider. @@ -114,7 +102,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, @@ -177,7 +165,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 @@ -197,23 +185,14 @@ class StandbyVirtualMachinePoolsOperations: 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def get( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any @@ -230,7 +209,7 @@ async def get( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -270,7 +249,7 @@ async def get( 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: @@ -284,17 +263,7 @@ async def get( return deserialized # type: ignore @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def _create_or_update_initial( self, @@ -303,7 +272,7 @@ async def _create_or_update_initial( resource: Union[_models.StandbyVirtualMachinePoolResource, 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, @@ -352,7 +321,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 = {} @@ -455,17 +424,7 @@ async def begin_create_or_update( @distributed_trace_async @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def begin_create_or_update( self, @@ -544,21 +503,12 @@ def get_long_running_output(pipeline_response): ) @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def _delete_initial( self, resource_group_name: str, standby_virtual_machine_pool_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, @@ -597,7 +547,7 @@ async def _delete_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 = {} @@ -614,16 +564,7 @@ async def _delete_initial( @distributed_trace_async @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def begin_delete( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any @@ -769,17 +710,7 @@ async def update( @distributed_trace_async @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def update( self, @@ -804,7 +735,7 @@ async def update( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -854,7 +785,7 @@ async def 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: @@ -869,8 +800,7 @@ async def update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_resource_group( self, resource_group_name: str, **kwargs: Any @@ -890,7 +820,7 @@ def list_by_resource_group( cls: ClsType[List[_models.StandbyVirtualMachinePoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -955,7 +885,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 @@ -964,8 +894,7 @@ async def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.StandbyVirtualMachinePoolResource"]: """List StandbyVirtualMachinePoolResource resources by subscription ID. @@ -980,7 +909,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.StandbyV cls: ClsType[List[_models.StandbyVirtualMachinePoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1044,7 +973,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 @@ -1064,24 +993,14 @@ class StandbyVirtualMachinesOperations: 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "standby_virtual_machine_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def get( self, @@ -1104,7 +1023,7 @@ async def get( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachineResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1145,7 +1064,7 @@ async def get( 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: @@ -1160,17 +1079,8 @@ async def get( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, - ) # pylint: disable=name-too-long + params_added_on={"2024-03-01-preview": ["base_url"]}, + ) def list_by_standby_virtual_machine_pool_resource( # pylint: disable=name-too-long self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any ) -> AsyncIterable["_models.StandbyVirtualMachineResource"]: @@ -1191,7 +1101,7 @@ def list_by_standby_virtual_machine_pool_resource( # pylint: disable=name-too-l cls: ClsType[List[_models.StandbyVirtualMachineResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1257,7 +1167,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 @@ -1277,12 +1187,26 @@ class StandbyVirtualMachinePoolRuntimeViewsOperations: # pylint: disable=name-t 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: StandbyPoolMgmtClientConfiguration = 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 + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_virtual_machine_pool_name", + "runtime_view", + "accept", + ] + }, + ) async def get( self, resource_group_name: str, standby_virtual_machine_pool_name: str, runtime_view: str, **kwargs: Any ) -> _models.StandbyVirtualMachinePoolRuntimeViewResource: @@ -1302,7 +1226,7 @@ async def get( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolRuntimeViewResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1343,7 +1267,7 @@ async def get( 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: @@ -1357,6 +1281,19 @@ async def get( return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_virtual_machine_pool_name", + "accept", + ] + }, + ) def list_by_standby_pool( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any ) -> AsyncIterable["_models.StandbyVirtualMachinePoolRuntimeViewResource"]: @@ -1378,7 +1315,7 @@ def list_by_standby_pool( cls: ClsType[List[_models.StandbyVirtualMachinePoolRuntimeViewResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1446,7 +1383,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 @@ -1466,23 +1403,14 @@ class StandbyContainerGroupPoolsOperations: 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def get( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any @@ -1499,7 +1427,7 @@ async def get( :rtype: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1539,7 +1467,7 @@ async def get( 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: @@ -1553,17 +1481,7 @@ async def get( return deserialized # type: ignore @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def _create_or_update_initial( self, @@ -1572,7 +1490,7 @@ async def _create_or_update_initial( resource: Union[_models.StandbyContainerGroupPoolResource, 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, @@ -1621,7 +1539,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 = {} @@ -1724,17 +1642,7 @@ async def begin_create_or_update( @distributed_trace_async @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def begin_create_or_update( self, @@ -1813,21 +1721,12 @@ def get_long_running_output(pipeline_response): ) @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def _delete_initial( self, resource_group_name: str, standby_container_group_pool_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, @@ -1866,7 +1765,7 @@ async def _delete_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 = {} @@ -1883,16 +1782,7 @@ async def _delete_initial( @distributed_trace_async @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def begin_delete( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any @@ -2038,17 +1928,7 @@ async def update( @distributed_trace_async @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def update( self, @@ -2073,7 +1953,7 @@ async def update( :rtype: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2123,7 +2003,7 @@ async def 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: @@ -2138,8 +2018,7 @@ async def update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_resource_group( self, resource_group_name: str, **kwargs: Any @@ -2159,7 +2038,7 @@ def list_by_resource_group( cls: ClsType[List[_models.StandbyContainerGroupPoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2224,7 +2103,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 @@ -2233,8 +2112,7 @@ async def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.StandbyContainerGroupPoolResource"]: """List StandbyContainerGroupPoolResource resources by subscription ID. @@ -2249,7 +2127,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.StandbyC cls: ClsType[List[_models.StandbyContainerGroupPoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2313,7 +2191,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 @@ -2333,12 +2211,26 @@ class StandbyContainerGroupPoolRuntimeViewsOperations: # pylint: disable=name-t 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: StandbyPoolMgmtClientConfiguration = 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 + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_container_group_pool_name", + "runtime_view", + "accept", + ] + }, + ) async def get( self, resource_group_name: str, standby_container_group_pool_name: str, runtime_view: str, **kwargs: Any ) -> _models.StandbyContainerGroupPoolRuntimeViewResource: @@ -2358,7 +2250,7 @@ async def get( :rtype: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolRuntimeViewResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2399,7 +2291,7 @@ async def get( 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: @@ -2413,6 +2305,19 @@ async def get( return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_container_group_pool_name", + "accept", + ] + }, + ) def list_by_standby_pool( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any ) -> AsyncIterable["_models.StandbyContainerGroupPoolRuntimeViewResource"]: @@ -2434,7 +2339,7 @@ def list_by_standby_pool( cls: ClsType[List[_models.StandbyContainerGroupPoolRuntimeViewResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2502,7 +2407,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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/__init__.py index 5e5cac3af9c9..33f2def4980e 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/__init__.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/__init__.py @@ -5,47 +5,58 @@ # 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 ContainerGroupInstanceCountSummary -from ._models import ContainerGroupProfile -from ._models import ContainerGroupProperties -from ._models import ErrorAdditionalInfo -from ._models import ErrorDetail -from ._models import ErrorResponse -from ._models import Operation -from ._models import OperationDisplay -from ._models import PoolResourceStateCount -from ._models import ProxyResource -from ._models import Resource -from ._models import StandbyContainerGroupPoolElasticityProfile -from ._models import StandbyContainerGroupPoolResource -from ._models import StandbyContainerGroupPoolResourceProperties -from ._models import StandbyContainerGroupPoolResourceUpdate -from ._models import StandbyContainerGroupPoolResourceUpdateProperties -from ._models import StandbyContainerGroupPoolRuntimeViewResource -from ._models import StandbyContainerGroupPoolRuntimeViewResourceProperties -from ._models import StandbyVirtualMachinePoolElasticityProfile -from ._models import StandbyVirtualMachinePoolResource -from ._models import StandbyVirtualMachinePoolResourceProperties -from ._models import StandbyVirtualMachinePoolResourceUpdate -from ._models import StandbyVirtualMachinePoolResourceUpdateProperties -from ._models import StandbyVirtualMachinePoolRuntimeViewResource -from ._models import StandbyVirtualMachinePoolRuntimeViewResourceProperties -from ._models import StandbyVirtualMachineResource -from ._models import StandbyVirtualMachineResourceProperties -from ._models import Subnet -from ._models import SystemData -from ._models import TrackedResource -from ._models import VirtualMachineInstanceCountSummary +from typing import TYPE_CHECKING -from ._enums import ActionType -from ._enums import CreatedByType -from ._enums import Origin -from ._enums import ProvisioningState -from ._enums import RefillPolicy -from ._enums import VirtualMachineState +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + ContainerGroupInstanceCountSummary, + ContainerGroupProfile, + ContainerGroupProperties, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Operation, + OperationDisplay, + PoolResourceStateCount, + ProxyResource, + Resource, + StandbyContainerGroupPoolElasticityProfile, + StandbyContainerGroupPoolResource, + StandbyContainerGroupPoolResourceProperties, + StandbyContainerGroupPoolResourceUpdate, + StandbyContainerGroupPoolResourceUpdateProperties, + StandbyContainerGroupPoolRuntimeViewResource, + StandbyContainerGroupPoolRuntimeViewResourceProperties, + StandbyVirtualMachinePoolElasticityProfile, + StandbyVirtualMachinePoolResource, + StandbyVirtualMachinePoolResourceProperties, + StandbyVirtualMachinePoolResourceUpdate, + StandbyVirtualMachinePoolResourceUpdateProperties, + StandbyVirtualMachinePoolRuntimeViewResource, + StandbyVirtualMachinePoolRuntimeViewResourceProperties, + StandbyVirtualMachineResource, + StandbyVirtualMachineResourceProperties, + Subnet, + SystemData, + TrackedResource, + VirtualMachineInstanceCountSummary, +) + +from ._enums import ( # type: ignore + ActionType, + CreatedByType, + Origin, + ProvisioningState, + RefillPolicy, + VirtualMachineState, +) 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__ = [ @@ -87,5 +98,5 @@ "RefillPolicy", "VirtualMachineState", ] -__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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_models.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_models.py index d502d546afec..e0fc9614fe69 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_models.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/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, Mapping, Optional, TYPE_CHECKING, Union, overload @@ -14,7 +15,6 @@ from .._model_base import rest_field if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models @@ -27,7 +27,9 @@ class ContainerGroupInstanceCountSummary(_model_base.Model): :vartype instance_counts_by_state: list[~azure.mgmt.standbypool.models.PoolResourceStateCount] """ - instance_counts_by_state: List["_models.PoolResourceStateCount"] = rest_field(name="instanceCountsByState") + instance_counts_by_state: List["_models.PoolResourceStateCount"] = rest_field( + name="instanceCountsByState", visibility=["read", "create", "update", "delete", "query"] + ) """The count of pooled resources in each state. Required.""" @overload @@ -35,16 +37,16 @@ def __init__( self, *, instance_counts_by_state: List["_models.PoolResourceStateCount"], - ): ... + ) -> 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) @@ -58,9 +60,9 @@ class ContainerGroupProfile(_model_base.Model): :vartype revision: int """ - id: str = rest_field() + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Specifies container group profile id of standby container groups. Required.""" - revision: Optional[int] = rest_field() + revision: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Specifies revision of container group profile.""" @overload @@ -69,16 +71,16 @@ def __init__( *, id: str, # pylint: disable=redefined-builtin revision: 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) @@ -93,9 +95,13 @@ class ContainerGroupProperties(_model_base.Model): :vartype subnet_ids: list[~azure.mgmt.standbypool.models.Subnet] """ - container_group_profile: "_models.ContainerGroupProfile" = rest_field(name="containerGroupProfile") + container_group_profile: "_models.ContainerGroupProfile" = rest_field( + name="containerGroupProfile", visibility=["read", "create", "update", "delete", "query"] + ) """Specifies container group profile of standby container groups. Required.""" - subnet_ids: Optional[List["_models.Subnet"]] = rest_field(name="subnetIds") + subnet_ids: Optional[List["_models.Subnet"]] = rest_field( + name="subnetIds", visibility=["read", "create", "update", "delete", "query"] + ) """Specifies subnet Ids for container group.""" @overload @@ -104,16 +110,16 @@ def __init__( *, container_group_profile: "_models.ContainerGroupProfile", subnet_ids: Optional[List["_models.Subnet"]] = 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) @@ -173,7 +179,7 @@ class ErrorResponse(_model_base.Model): :vartype error: ~azure.mgmt.standbypool.models.ErrorDetail """ - error: Optional["_models.ErrorDetail"] = rest_field() + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The error object.""" @overload @@ -181,16 +187,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) @@ -223,13 +229,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\"""" @@ -237,17 +245,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) @@ -295,9 +303,9 @@ class PoolResourceStateCount(_model_base.Model): :vartype count: int """ - state: str = rest_field() + state: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The state that the pooled resources count is for. Required.""" - count: int = rest_field() + count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The count of pooled resources in the given state. Required.""" @overload @@ -306,16 +314,16 @@ def __init__( *, state: str, count: int, - ): ... + ) -> 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) @@ -325,7 +333,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 @@ -339,7 +347,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"]) @@ -356,7 +364,7 @@ class ProxyResource(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 @@ -380,9 +388,13 @@ class StandbyContainerGroupPoolElasticityProfile(_model_base.Model): # pylint: :vartype refill_policy: str or ~azure.mgmt.standbypool.models.RefillPolicy """ - max_ready_capacity: int = rest_field(name="maxReadyCapacity") + max_ready_capacity: int = rest_field( + name="maxReadyCapacity", visibility=["read", "create", "update", "delete", "query"] + ) """Specifies maximum number of standby container groups in the standby pool. Required.""" - refill_policy: Optional[Union[str, "_models.RefillPolicy"]] = rest_field(name="refillPolicy") + refill_policy: Optional[Union[str, "_models.RefillPolicy"]] = rest_field( + name="refillPolicy", visibility=["read", "create", "update", "delete", "query"] + ) """Specifies refill policy of the pool. \"always\"""" @overload @@ -391,16 +403,16 @@ def __init__( *, max_ready_capacity: int, refill_policy: Optional[Union[str, "_models.RefillPolicy"]] = 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) @@ -412,7 +424,7 @@ class TrackedResource(Resource): :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 @@ -428,7 +440,7 @@ class TrackedResource(Resource): :vartype location: str """ - tags: Optional[Dict[str, str]] = rest_field() + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" location: str = rest_field(visibility=["read", "create"]) """The geo-location where the resource lives. Required.""" @@ -439,16 +451,16 @@ def __init__( *, location: str, tags: Optional[Dict[str, 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) @@ -459,7 +471,7 @@ class StandbyContainerGroupPoolResource(TrackedResource): :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 @@ -477,7 +489,9 @@ class StandbyContainerGroupPoolResource(TrackedResource): :vartype properties: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolResourceProperties """ - properties: Optional["_models.StandbyContainerGroupPoolResourceProperties"] = rest_field() + properties: Optional["_models.StandbyContainerGroupPoolResourceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -487,16 +501,16 @@ def __init__( location: str, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.StandbyContainerGroupPoolResourceProperties"] = 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) @@ -518,9 +532,13 @@ class StandbyContainerGroupPoolResourceProperties(_model_base.Model): # pylint: :vartype provisioning_state: str or ~azure.mgmt.standbypool.models.ProvisioningState """ - elasticity_profile: "_models.StandbyContainerGroupPoolElasticityProfile" = rest_field(name="elasticityProfile") + elasticity_profile: "_models.StandbyContainerGroupPoolElasticityProfile" = rest_field( + name="elasticityProfile", visibility=["read", "create", "update", "delete", "query"] + ) """Specifies elasticity profile of standby container group pools. Required.""" - container_group_properties: "_models.ContainerGroupProperties" = rest_field(name="containerGroupProperties") + container_group_properties: "_models.ContainerGroupProperties" = rest_field( + name="containerGroupProperties", visibility=["read", "create", "update", "delete", "query"] + ) """Specifies container group properties of standby container group pools. Required.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] @@ -534,16 +552,16 @@ def __init__( *, elasticity_profile: "_models.StandbyContainerGroupPoolElasticityProfile", container_group_properties: "_models.ContainerGroupProperties", - ): ... + ) -> 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) @@ -557,9 +575,11 @@ class StandbyContainerGroupPoolResourceUpdate(_model_base.Model): ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolResourceUpdateProperties """ - tags: Optional[Dict[str, str]] = rest_field() + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" - properties: Optional["_models.StandbyContainerGroupPoolResourceUpdateProperties"] = rest_field() + properties: Optional["_models.StandbyContainerGroupPoolResourceUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -568,16 +588,16 @@ def __init__( *, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.StandbyContainerGroupPoolResourceUpdateProperties"] = 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) @@ -593,11 +613,11 @@ class StandbyContainerGroupPoolResourceUpdateProperties(_model_base.Model): # p """ elasticity_profile: Optional["_models.StandbyContainerGroupPoolElasticityProfile"] = rest_field( - name="elasticityProfile" + name="elasticityProfile", visibility=["read", "create", "update", "delete", "query"] ) """Specifies elasticity profile of standby container group pools.""" container_group_properties: Optional["_models.ContainerGroupProperties"] = rest_field( - name="containerGroupProperties" + name="containerGroupProperties", visibility=["read", "create", "update", "delete", "query"] ) """Specifies container group properties of standby container group pools.""" @@ -607,16 +627,16 @@ def __init__( *, elasticity_profile: Optional["_models.StandbyContainerGroupPoolElasticityProfile"] = None, container_group_properties: Optional["_models.ContainerGroupProperties"] = 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) @@ -627,7 +647,7 @@ class StandbyContainerGroupPoolRuntimeViewResource(ProxyResource): # pylint: di 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 @@ -642,7 +662,9 @@ class StandbyContainerGroupPoolRuntimeViewResource(ProxyResource): # pylint: di ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolRuntimeViewResourceProperties """ - properties: Optional["_models.StandbyContainerGroupPoolRuntimeViewResourceProperties"] = rest_field() + properties: Optional["_models.StandbyContainerGroupPoolRuntimeViewResourceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -650,16 +672,16 @@ def __init__( self, *, properties: Optional["_models.StandbyContainerGroupPoolRuntimeViewResourceProperties"] = 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) @@ -702,9 +724,13 @@ class StandbyVirtualMachinePoolElasticityProfile(_model_base.Model): # pylint: :vartype min_ready_capacity: int """ - max_ready_capacity: int = rest_field(name="maxReadyCapacity") + max_ready_capacity: int = rest_field( + name="maxReadyCapacity", visibility=["read", "create", "update", "delete", "query"] + ) """Specifies the maximum number of virtual machines in the standby virtual machine pool. Required.""" - min_ready_capacity: Optional[int] = rest_field(name="minReadyCapacity") + min_ready_capacity: Optional[int] = rest_field( + name="minReadyCapacity", visibility=["read", "create", "update", "delete", "query"] + ) """Specifies the desired minimum number of virtual machines in the standby virtual machine pool. MinReadyCapacity cannot exceed MaxReadyCapacity.""" @@ -714,16 +740,16 @@ def __init__( *, max_ready_capacity: int, min_ready_capacity: 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) @@ -734,7 +760,7 @@ class StandbyVirtualMachinePoolResource(TrackedResource): :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 @@ -752,7 +778,9 @@ class StandbyVirtualMachinePoolResource(TrackedResource): :vartype properties: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResourceProperties """ - properties: Optional["_models.StandbyVirtualMachinePoolResourceProperties"] = rest_field() + properties: Optional["_models.StandbyVirtualMachinePoolResourceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -762,16 +790,16 @@ def __init__( location: str, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.StandbyVirtualMachinePoolResourceProperties"] = 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) @@ -797,13 +825,17 @@ class StandbyVirtualMachinePoolResourceProperties(_model_base.Model): # pylint: """ elasticity_profile: Optional["_models.StandbyVirtualMachinePoolElasticityProfile"] = rest_field( - name="elasticityProfile" + name="elasticityProfile", visibility=["read", "create", "update", "delete", "query"] ) """Specifies the elasticity profile of the standby virtual machine pools.""" - virtual_machine_state: Union[str, "_models.VirtualMachineState"] = rest_field(name="virtualMachineState") + virtual_machine_state: Union[str, "_models.VirtualMachineState"] = rest_field( + name="virtualMachineState", visibility=["read", "create", "update", "delete", "query"] + ) """Specifies the desired state of virtual machines in the pool. Required. Known values are: \"Running\" and \"Deallocated\".""" - attached_virtual_machine_scale_set_id: Optional[str] = rest_field(name="attachedVirtualMachineScaleSetId") + attached_virtual_machine_scale_set_id: Optional[str] = rest_field( + name="attachedVirtualMachineScaleSetId", visibility=["read", "create", "update", "delete", "query"] + ) """Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( @@ -819,16 +851,16 @@ def __init__( virtual_machine_state: Union[str, "_models.VirtualMachineState"], elasticity_profile: Optional["_models.StandbyVirtualMachinePoolElasticityProfile"] = None, attached_virtual_machine_scale_set_id: 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) @@ -842,9 +874,11 @@ class StandbyVirtualMachinePoolResourceUpdate(_model_base.Model): ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResourceUpdateProperties """ - tags: Optional[Dict[str, str]] = rest_field() + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" - properties: Optional["_models.StandbyVirtualMachinePoolResourceUpdateProperties"] = rest_field() + properties: Optional["_models.StandbyVirtualMachinePoolResourceUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -853,16 +887,16 @@ def __init__( *, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.StandbyVirtualMachinePoolResourceUpdateProperties"] = 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) @@ -882,13 +916,17 @@ class StandbyVirtualMachinePoolResourceUpdateProperties(_model_base.Model): # p """ elasticity_profile: Optional["_models.StandbyVirtualMachinePoolElasticityProfile"] = rest_field( - name="elasticityProfile" + name="elasticityProfile", visibility=["read", "create", "update", "delete", "query"] ) """Specifies the elasticity profile of the standby virtual machine pools.""" - virtual_machine_state: Optional[Union[str, "_models.VirtualMachineState"]] = rest_field(name="virtualMachineState") + virtual_machine_state: Optional[Union[str, "_models.VirtualMachineState"]] = rest_field( + name="virtualMachineState", visibility=["read", "create", "update", "delete", "query"] + ) """Specifies the desired state of virtual machines in the pool. Known values are: \"Running\" and \"Deallocated\".""" - attached_virtual_machine_scale_set_id: Optional[str] = rest_field(name="attachedVirtualMachineScaleSetId") + attached_virtual_machine_scale_set_id: Optional[str] = rest_field( + name="attachedVirtualMachineScaleSetId", visibility=["read", "create", "update", "delete", "query"] + ) """Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.""" @@ -899,16 +937,16 @@ def __init__( elasticity_profile: Optional["_models.StandbyVirtualMachinePoolElasticityProfile"] = None, virtual_machine_state: Optional[Union[str, "_models.VirtualMachineState"]] = None, attached_virtual_machine_scale_set_id: 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) @@ -919,7 +957,7 @@ class StandbyVirtualMachinePoolRuntimeViewResource(ProxyResource): # pylint: di 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 @@ -934,7 +972,9 @@ class StandbyVirtualMachinePoolRuntimeViewResource(ProxyResource): # pylint: di ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolRuntimeViewResourceProperties """ - properties: Optional["_models.StandbyVirtualMachinePoolRuntimeViewResourceProperties"] = rest_field() + properties: Optional["_models.StandbyVirtualMachinePoolRuntimeViewResourceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -942,16 +982,16 @@ def __init__( self, *, properties: Optional["_models.StandbyVirtualMachinePoolRuntimeViewResourceProperties"] = 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) @@ -962,11 +1002,8 @@ class StandbyVirtualMachinePoolRuntimeViewResourceProperties(_model_base.Model): :ivar instance_count_summary: A list containing the counts of virtual machines in each possible - power state for each zone if enabled, as known by the StandbyPool resource provider. - If zones are not enabled on the attached VMSS, the list will contain a single entry with null - zone values. - Note: any updates to pool resources outside of StandbyPoolRP (i.e deleting a VM through - portal) are not reflected here. + power state for each zone if enabled, as known by the StandbyPool resource provider. If zones + are not enabled on the attached VMSS, the list will contain a single entry without zone values. Note: any resources in the Running state may still be installing extensions / not fully provisioned. Required. :vartype instance_count_summary: @@ -980,13 +1017,9 @@ class StandbyVirtualMachinePoolRuntimeViewResourceProperties(_model_base.Model): name="instanceCountSummary", visibility=["read"] ) """A list containing the counts of virtual machines in each possible power state for each zone if - enabled, as known by the StandbyPool resource provider. - If zones are not enabled on the attached VMSS, the list will contain a single entry with null - zone values. - Note: any updates to pool resources outside of StandbyPoolRP (i.e deleting a VM through portal) - are not reflected here. - Note: any resources in the Running state may still be installing extensions / not fully - provisioned. Required.""" + enabled, as known by the StandbyPool resource provider. If zones are not enabled on the + attached VMSS, the list will contain a single entry without zone values. Note: any resources in + the Running state may still be installing extensions / not fully provisioned. Required.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) @@ -1001,7 +1034,7 @@ class StandbyVirtualMachineResource(ProxyResource): 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 @@ -1015,7 +1048,9 @@ class StandbyVirtualMachineResource(ProxyResource): :vartype properties: ~azure.mgmt.standbypool.models.StandbyVirtualMachineResourceProperties """ - properties: Optional["_models.StandbyVirtualMachineResourceProperties"] = rest_field() + properties: Optional["_models.StandbyVirtualMachineResourceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -1023,16 +1058,16 @@ def __init__( self, *, properties: Optional["_models.StandbyVirtualMachineResourceProperties"] = 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) @@ -1049,7 +1084,9 @@ class StandbyVirtualMachineResourceProperties(_model_base.Model): :vartype provisioning_state: str or ~azure.mgmt.standbypool.models.ProvisioningState """ - virtual_machine_resource_id: str = rest_field(name="virtualMachineResourceId") + virtual_machine_resource_id: str = rest_field( + name="virtualMachineResourceId", visibility=["read", "create", "update", "delete", "query"] + ) """Resource id of the virtual machine. Required.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] @@ -1062,16 +1099,16 @@ def __init__( self, *, virtual_machine_resource_id: 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) @@ -1083,7 +1120,7 @@ class Subnet(_model_base.Model): :vartype id: str """ - id: str = rest_field() + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Specifies ARM resource id of the subnet. Required.""" @overload @@ -1091,16 +1128,16 @@ def __init__( self, *, id: str, # pylint: disable=redefined-builtin - ): ... + ) -> 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) @@ -1123,19 +1160,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 @@ -1148,26 +1195,23 @@ 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) class VirtualMachineInstanceCountSummary(_model_base.Model): """Contains the counts of VMs in each power state in a given zone, fault domain, as known by the - StandbyPool resource provider. - Note: any updates to pool resources outside of StandbyPoolRP (i.e deleting a VM through portal) - are not reflected here. - Note: any resources in the Running state may still be installing extensions / not fully - provisioned. + StandbyPool resource provider. Note: any resources in the Running state may still be installing + extensions / not fully provisioned. :ivar zone: The zone that the provided counts are in. This is null if zones are not enabled on @@ -1178,10 +1222,12 @@ class VirtualMachineInstanceCountSummary(_model_base.Model): :vartype instance_counts_by_state: list[~azure.mgmt.standbypool.models.PoolResourceStateCount] """ - zone: Optional[int] = rest_field() + zone: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The zone that the provided counts are in. This is null if zones are not enabled on the attached VMSS.""" - instance_counts_by_state: List["_models.PoolResourceStateCount"] = rest_field(name="instanceCountsByState") + instance_counts_by_state: List["_models.PoolResourceStateCount"] = rest_field( + name="instanceCountsByState", visibility=["read", "create", "update", "delete", "query"] + ) """The count of pooled resources in each state for the given zone. Required.""" @overload @@ -1190,14 +1236,14 @@ def __init__( *, instance_counts_by_state: List["_models.PoolResourceStateCount"], zone: 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) diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/__init__.py index 12acea673adc..71fe7806df8e 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/__init__.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/__init__.py @@ -5,16 +5,22 @@ # 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 Operations -from ._operations import StandbyVirtualMachinePoolsOperations -from ._operations import StandbyVirtualMachinesOperations -from ._operations import StandbyVirtualMachinePoolRuntimeViewsOperations -from ._operations import StandbyContainerGroupPoolsOperations -from ._operations import StandbyContainerGroupPoolRuntimeViewsOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import StandbyVirtualMachinePoolsOperations # type: ignore +from ._operations import StandbyVirtualMachinesOperations # type: ignore +from ._operations import StandbyVirtualMachinePoolRuntimeViewsOperations # type: ignore +from ._operations import StandbyContainerGroupPoolsOperations # type: ignore +from ._operations import StandbyContainerGroupPoolRuntimeViewsOperations # 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__ = [ @@ -25,5 +31,5 @@ "StandbyContainerGroupPoolsOperations", "StandbyContainerGroupPoolRuntimeViewsOperations", ] -__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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_operations.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_operations.py index 3fb867658d96..aa725784ccb4 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_operations.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,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 StandbyPoolMgmtClientConfiguration +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 T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -77,7 +79,7 @@ def build_standby_virtual_machine_pools_get_request( # pylint: disable=name-too accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -108,7 +110,7 @@ def build_standby_virtual_machine_pools_create_or_update_request( # pylint: dis accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -140,7 +142,7 @@ def build_standby_virtual_machine_pools_delete_request( # pylint: disable=name- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -171,7 +173,7 @@ def build_standby_virtual_machine_pools_update_request( # pylint: disable=name- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -203,7 +205,7 @@ def build_standby_virtual_machine_pools_list_by_resource_group_request( # pylin accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -260,7 +262,7 @@ def build_standby_virtual_machines_get_request( # pylint: disable=name-too-long accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines/{standbyVirtualMachineName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines/{standbyVirtualMachineName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -293,7 +295,7 @@ def build_standby_virtual_machines_list_by_standby_virtual_machine_pool_resource accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -327,7 +329,7 @@ def build_standby_virtual_machine_pool_runtime_views_get_request( # pylint: dis accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/runtimeViews/{runtimeView}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/runtimeViews/{runtimeView}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -358,7 +360,7 @@ def build_standby_virtual_machine_pool_runtime_views_list_by_standby_pool_reques accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/runtimeViews" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/runtimeViews" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -388,7 +390,7 @@ def build_standby_container_group_pools_get_request( # pylint: disable=name-too accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -419,7 +421,7 @@ def build_standby_container_group_pools_create_or_update_request( # pylint: dis accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -451,7 +453,7 @@ def build_standby_container_group_pools_delete_request( # pylint: disable=name- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -482,7 +484,7 @@ def build_standby_container_group_pools_update_request( # pylint: disable=name- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -514,7 +516,7 @@ def build_standby_container_group_pools_list_by_resource_group_request( # pylin accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -571,7 +573,7 @@ def build_standby_container_group_pool_runtime_views_get_request( # pylint: dis accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}/runtimeViews/{runtimeView}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}/runtimeViews/{runtimeView}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -602,7 +604,7 @@ def build_standby_container_group_pool_runtime_views_list_by_standby_pool_reques accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}/runtimeViews" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}/runtimeViews" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -634,15 +636,14 @@ 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: """List the operations for the provider. @@ -656,7 +657,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, @@ -719,7 +720,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 @@ -739,23 +740,14 @@ class StandbyVirtualMachinePoolsOperations: 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def get( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any @@ -772,7 +764,7 @@ def get( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -812,7 +804,7 @@ def get( 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: @@ -826,17 +818,7 @@ def get( return deserialized # type: ignore @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def _create_or_update_initial( self, @@ -845,7 +827,7 @@ def _create_or_update_initial( resource: Union[_models.StandbyVirtualMachinePoolResource, 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, @@ -894,7 +876,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 = {} @@ -997,17 +979,7 @@ def begin_create_or_update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def begin_create_or_update( self, @@ -1086,21 +1058,12 @@ def get_long_running_output(pipeline_response): ) @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def _delete_initial( self, resource_group_name: str, standby_virtual_machine_pool_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, @@ -1139,7 +1102,7 @@ def _delete_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 = {} @@ -1156,16 +1119,7 @@ def _delete_initial( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def begin_delete( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any @@ -1311,17 +1265,7 @@ def update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def update( self, @@ -1346,7 +1290,7 @@ def update( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1396,7 +1340,7 @@ def 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: @@ -1411,8 +1355,7 @@ def update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_resource_group( self, resource_group_name: str, **kwargs: Any @@ -1432,7 +1375,7 @@ def list_by_resource_group( cls: ClsType[List[_models.StandbyVirtualMachinePoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1497,7 +1440,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 @@ -1506,8 +1449,7 @@ def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.StandbyVirtualMachinePoolResource"]: """List StandbyVirtualMachinePoolResource resources by subscription ID. @@ -1522,7 +1464,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.StandbyVirtua cls: ClsType[List[_models.StandbyVirtualMachinePoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1586,7 +1528,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 @@ -1606,24 +1548,14 @@ class StandbyVirtualMachinesOperations: 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "standby_virtual_machine_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def get( self, @@ -1646,7 +1578,7 @@ def get( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachineResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1687,7 +1619,7 @@ def get( 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: @@ -1702,17 +1634,8 @@ def get( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, - ) # pylint: disable=name-too-long + params_added_on={"2024-03-01-preview": ["base_url"]}, + ) def list_by_standby_virtual_machine_pool_resource( # pylint: disable=name-too-long self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any ) -> Iterable["_models.StandbyVirtualMachineResource"]: @@ -1733,7 +1656,7 @@ def list_by_standby_virtual_machine_pool_resource( # pylint: disable=name-too-l cls: ClsType[List[_models.StandbyVirtualMachineResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1799,7 +1722,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 @@ -1819,12 +1742,26 @@ class StandbyVirtualMachinePoolRuntimeViewsOperations: # pylint: disable=name-t 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: StandbyPoolMgmtClientConfiguration = 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 + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_virtual_machine_pool_name", + "runtime_view", + "accept", + ] + }, + ) def get( self, resource_group_name: str, standby_virtual_machine_pool_name: str, runtime_view: str, **kwargs: Any ) -> _models.StandbyVirtualMachinePoolRuntimeViewResource: @@ -1844,7 +1781,7 @@ def get( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolRuntimeViewResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1885,7 +1822,7 @@ def get( 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: @@ -1899,6 +1836,19 @@ def get( return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_virtual_machine_pool_name", + "accept", + ] + }, + ) def list_by_standby_pool( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any ) -> Iterable["_models.StandbyVirtualMachinePoolRuntimeViewResource"]: @@ -1920,7 +1870,7 @@ def list_by_standby_pool( cls: ClsType[List[_models.StandbyVirtualMachinePoolRuntimeViewResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1988,7 +1938,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 @@ -2008,23 +1958,14 @@ class StandbyContainerGroupPoolsOperations: 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def get( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any @@ -2041,7 +1982,7 @@ def get( :rtype: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2081,7 +2022,7 @@ def get( 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: @@ -2095,17 +2036,7 @@ def get( return deserialized # type: ignore @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def _create_or_update_initial( self, @@ -2114,7 +2045,7 @@ def _create_or_update_initial( resource: Union[_models.StandbyContainerGroupPoolResource, 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, @@ -2163,7 +2094,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 = {} @@ -2266,17 +2197,7 @@ def begin_create_or_update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def begin_create_or_update( self, @@ -2355,21 +2276,12 @@ def get_long_running_output(pipeline_response): ) @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def _delete_initial( self, resource_group_name: str, standby_container_group_pool_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, @@ -2408,7 +2320,7 @@ def _delete_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 = {} @@ -2425,16 +2337,7 @@ def _delete_initial( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def begin_delete( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any @@ -2580,17 +2483,7 @@ def update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def update( self, @@ -2615,7 +2508,7 @@ def update( :rtype: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2665,7 +2558,7 @@ def 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: @@ -2680,8 +2573,7 @@ def update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_resource_group( self, resource_group_name: str, **kwargs: Any @@ -2701,7 +2593,7 @@ def list_by_resource_group( cls: ClsType[List[_models.StandbyContainerGroupPoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2766,7 +2658,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 @@ -2775,8 +2667,7 @@ def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.StandbyContainerGroupPoolResource"]: """List StandbyContainerGroupPoolResource resources by subscription ID. @@ -2791,7 +2682,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.StandbyContai cls: ClsType[List[_models.StandbyContainerGroupPoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2855,7 +2746,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 @@ -2875,12 +2766,26 @@ class StandbyContainerGroupPoolRuntimeViewsOperations: # pylint: disable=name-t 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: StandbyPoolMgmtClientConfiguration = 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 + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_container_group_pool_name", + "runtime_view", + "accept", + ] + }, + ) def get( self, resource_group_name: str, standby_container_group_pool_name: str, runtime_view: str, **kwargs: Any ) -> _models.StandbyContainerGroupPoolRuntimeViewResource: @@ -2900,7 +2805,7 @@ def get( :rtype: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolRuntimeViewResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2941,7 +2846,7 @@ def get( 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: @@ -2955,6 +2860,19 @@ def get( return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_container_group_pool_name", + "accept", + ] + }, + ) def list_by_standby_pool( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any ) -> Iterable["_models.StandbyContainerGroupPoolRuntimeViewResource"]: @@ -2976,7 +2894,7 @@ def list_by_standby_pool( cls: ClsType[List[_models.StandbyContainerGroupPoolRuntimeViewResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3044,7 +2962,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/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_create_or_update.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_create_or_update.py index ac0b79d29e31..d7168061ec74 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_create_or_update.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_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/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_update.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_update.py index 37adaaef3a94..1560ce5995a0 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_update.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_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/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_create_or_update.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_create_or_update.py index 9a0425b5cd9d..3b550105fdf1 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_create_or_update.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_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/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_update.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_update.py index 3402366f8507..cbfeda521516 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_update.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_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/standbypool/azure-mgmt-standbypool/generated_tests/conftest.py b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/conftest.py index 80945e8ce12b..4c351c014dbf 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/conftest.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/conftest.py @@ -18,7 +18,7 @@ load_dotenv() -# aovid record sensitive identity information in recordings +# For security, please avoid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) def add_sanitizers(test_proxy): standbypoolmgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") diff --git a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_async_test.py b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_async_test.py index a1daf5b0e706..39e3c18194b2 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_async_test.py +++ b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_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/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_test.py b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_test.py index 69788a00a400..98d944308665 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_test.py +++ b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_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/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async_test.py b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async_test.py index b2b3a1821d27..6e142f1bff2a 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async_test.py +++ b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async_test.py @@ -27,4 +27,3 @@ async def test_standby_virtual_machine_pools_list_by_resource_group(self, resour ) result = [r async for r in response] assert result == [] - \ No newline at end of file diff --git a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_test.py b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_test.py index 85ea698d3c97..2bfec7afd334 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_test.py +++ b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_test.py @@ -26,4 +26,3 @@ def test_standby_virtual_machine_pools_list_by_resource_group(self, resource_gro ) result = [r for r in response] assert result == [] - \ No newline at end of file diff --git a/sdk/standbypool/azure-mgmt-standbypool/tsp-location.yaml b/sdk/standbypool/azure-mgmt-standbypool/tsp-location.yaml index 555c0f7f3a08..1368425f0467 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/tsp-location.yaml +++ b/sdk/standbypool/azure-mgmt-standbypool/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/standbypool/StandbyPool.Management -commit: e695076ad458a3eac3d6943f9e923544ff52b1e4 +commit: 605911b2bdd478dadd4b68f5f97d9491131c74e2 repo: Azure/azure-rest-api-specs additionalDirectories: