diff --git a/sdk/standbypool/azure-mgmt-standbypool/_meta.json b/sdk/standbypool/azure-mgmt-standbypool/_meta.json index 3e4fe5c69a6f..848e80ed24af 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/_meta.json +++ b/sdk/standbypool/azure-mgmt-standbypool/_meta.json @@ -1,6 +1,6 @@ { - "commit": "e695076ad458a3eac3d6943f9e923544ff52b1e4", + "commit": "19115ed348edb428d4875154626a6fcf7365e2d4", "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.0" } \ 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..7f73b97b23ef 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 @@ -573,7 +574,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 +585,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 +601,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 +613,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 +633,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 +734,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 +754,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 +894,22 @@ 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 + + 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..b24ab2885450 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_serialization.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_serialization.py @@ -227,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore :param datetime.timedelta offset: offset in timedelta format """ - def __init__(self, offset): + def __init__(self, offset) -> None: self.__offset = offset def utcoffset(self, dt): @@ -310,7 +310,7 @@ def _create_xml_node(tag, prefix=None, ns=None): return ET.Element(tag) -class Model(object): +class Model: """Mixin for all client request body/response body models to support serialization and deserialization. """ @@ -507,7 +507,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 +518,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 +563,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 +598,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, @@ -1442,7 +1441,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 +1452,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, @@ -1684,17 +1683,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 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..94d73036dfff 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=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -9,21 +9,7 @@ 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.async_paging import AsyncItemPaged, AsyncList @@ -47,7 +33,7 @@ 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 ..._validation import api_version_validation from ...operations._operations import ( build_operations_list_request, @@ -74,7 +60,7 @@ 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 @@ -99,8 +85,7 @@ def __init__(self, *args, **kwargs) -> None: @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 +99,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 +162,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 @@ -204,16 +189,7 @@ def __init__(self, *args, **kwargs) -> None: @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 +206,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 +246,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 +260,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 +269,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 +318,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 +421,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 +500,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 +544,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 +561,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 +707,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 +732,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 +782,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 +797,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 +817,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 +882,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 +891,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 +906,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 +970,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 @@ -1071,17 +997,7 @@ def __init__(self, *args, **kwargs) -> None: @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 +1020,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 +1061,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 +1076,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 +1098,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 +1164,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 @@ -1283,6 +1190,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = 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 +1223,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 +1264,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,9 +1278,23 @@ 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"]: + # pylint: disable=line-too-long """List StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource. @@ -1378,7 +1313,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 +1381,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 @@ -1473,16 +1408,7 @@ def __init__(self, *args, **kwargs) -> None: @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 +1425,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 +1465,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 +1479,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 +1488,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 +1537,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 +1640,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 +1719,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 +1763,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 +1780,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 +1926,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 +1951,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 +2001,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 +2016,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 +2036,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 +2101,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 +2110,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 +2125,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 +2189,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 @@ -2339,6 +2215,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = 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 +2248,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 +2289,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,9 +2303,23 @@ 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"]: + # pylint: disable=line-too-long """List StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource. @@ -2434,7 +2338,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 +2406,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..56874d7d9839 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 @@ -# coding=utf-8 # 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. # 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 @@ -35,16 +35,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) @@ -69,16 +69,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) @@ -104,16 +104,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) @@ -181,16 +181,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 +223,13 @@ 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() """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 +237,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) @@ -306,16 +306,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) @@ -391,16 +391,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) @@ -439,16 +439,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) @@ -487,16 +487,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) @@ -534,16 +534,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) @@ -568,16 +568,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) @@ -607,16 +607,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) @@ -650,16 +650,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) @@ -714,16 +714,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) @@ -762,16 +762,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) @@ -819,16 +819,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) @@ -853,16 +853,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) @@ -899,16 +899,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) @@ -942,16 +942,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 +962,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 +977,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"] ) @@ -1023,16 +1016,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) @@ -1062,16 +1055,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) @@ -1091,16 +1084,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) @@ -1148,26 +1141,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 @@ -1190,14 +1180,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..759ac82ff286 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=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -9,7 +9,7 @@ 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.exceptions import ( @@ -32,14 +32,14 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._model_base import SdkJSONEncoder, _deserialize +from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._serialization import 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 @@ -641,8 +641,7 @@ def __init__(self, *args, **kwargs): @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 +655,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 +718,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 @@ -746,16 +745,7 @@ def __init__(self, *args, **kwargs): @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 +762,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 +802,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 +816,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 +825,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 +874,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 +977,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 +1056,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 +1100,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 +1117,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 +1263,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 +1288,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 +1338,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 +1353,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 +1373,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 +1438,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 +1447,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 +1462,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 +1526,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 @@ -1613,17 +1553,7 @@ def __init__(self, *args, **kwargs): @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 +1576,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 +1617,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 +1632,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 +1654,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 +1720,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 @@ -1825,6 +1746,20 @@ def __init__(self, *args, **kwargs): self._deserialize = 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 +1779,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 +1820,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 +1834,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 +1868,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 +1936,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 @@ -2015,16 +1963,7 @@ def __init__(self, *args, **kwargs): @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 +1980,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 +2020,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 +2034,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 +2043,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 +2092,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 +2195,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 +2274,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 +2318,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 +2335,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 +2481,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 +2506,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 +2556,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 +2571,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 +2591,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 +2656,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 +2665,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 +2680,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 +2744,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 @@ -2881,6 +2770,20 @@ def __init__(self, *args, **kwargs): self._deserialize = 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 +2803,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 +2844,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 +2858,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 +2892,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 +2960,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_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..f4f9c1a75556 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: 19115ed348edb428d4875154626a6fcf7365e2d4 repo: Azure/azure-rest-api-specs additionalDirectories: