diff --git a/sdk/dell/azure-mgmt-dellstorage/CHANGELOG.md b/sdk/dell/azure-mgmt-dellstorage/CHANGELOG.md index d4ad3d9c46be..e55103bfa905 100644 --- a/sdk/dell/azure-mgmt-dellstorage/CHANGELOG.md +++ b/sdk/dell/azure-mgmt-dellstorage/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 1.0.0 (2025-12-29) + +### Features Added + + - Model `DellStorageMgmtClient` added parameter `cloud_setting` in method `__init__` + ## 1.0.0b1 (2025-05-07) ### Other Changes diff --git a/sdk/dell/azure-mgmt-dellstorage/MANIFEST.in b/sdk/dell/azure-mgmt-dellstorage/MANIFEST.in index a82c44d4cf3d..81821fcf4912 100644 --- a/sdk/dell/azure-mgmt-dellstorage/MANIFEST.in +++ b/sdk/dell/azure-mgmt-dellstorage/MANIFEST.in @@ -1,8 +1,7 @@ -include _meta.json -recursive-include tests *.py *.json -recursive-include samples *.py *.md include *.md -include azure/__init__.py -include azure/mgmt/__init__.py include LICENSE include azure/mgmt/dellstorage/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/dell/azure-mgmt-dellstorage/_meta.json b/sdk/dell/azure-mgmt-dellstorage/_metadata.json similarity index 54% rename from sdk/dell/azure-mgmt-dellstorage/_meta.json rename to sdk/dell/azure-mgmt-dellstorage/_metadata.json index 0cdff1dd9cdb..4a6a41a8424b 100644 --- a/sdk/dell/azure-mgmt-dellstorage/_meta.json +++ b/sdk/dell/azure-mgmt-dellstorage/_metadata.json @@ -1,6 +1,7 @@ { - "commit": "a3baecd6571d7e4b979a7aef527d29a3509d4dc7", + "apiVersion": "2025-03-21", + "commit": "fb25c38a86b35dcf8bb03eaaa7844643bd92c5a2", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/dell/Dell.Storage.Management", - "@azure-tools/typespec-python": "0.44.1" + "emitterVersion": "0.56.1" } \ No newline at end of file diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/__init__.py b/sdk/dell/azure-mgmt-dellstorage/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/__init__.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/__init__.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/__init__.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_client.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_client.py index e66042ba0ef5..d4ce1fcc7181 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_client.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_client.py @@ -22,6 +22,7 @@ from .operations import FileSystemsOperations, Operations if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -38,19 +39,27 @@ class DellStorageMgmtClient: :type subscription_id: str :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is - "2025-03-21-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Default value is "2025-03-21". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any + self, + credential: "TokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any ) -> None: _endpoint = "{endpoint}" - _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: base_url = _endpoints["resource_manager"] @@ -59,6 +68,7 @@ def __init__( credential=credential, subscription_id=subscription_id, base_url=cast(str, base_url), + cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs ) diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_configuration.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_configuration.py index a076d2338a41..9141e2823a00 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_configuration.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_configuration.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -14,6 +14,7 @@ from ._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -29,9 +30,11 @@ class DellStorageMgmtClientConfiguration: # pylint: disable=too-many-instance-a :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is - "2025-03-21-preview". Note that overriding this default value may result in unsupported - behavior. + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Default value is "2025-03-21". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -40,9 +43,10 @@ def __init__( credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-03-21-preview") + api_version: str = kwargs.pop("api_version", "2025-03-21") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -52,6 +56,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-dellstorage/{}".format(VERSION)) diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_patch.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_patch.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_patch.py @@ -7,9 +7,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_utils/model_base.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_utils/model_base.py index 49d5c7259389..75b6936a909c 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_utils/model_base.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_utils/model_base.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -29,6 +29,7 @@ from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null +from azure.core.rest import HttpResponse _LOGGER = logging.getLogger(__name__) @@ -170,6 +171,21 @@ def default(self, o): # pylint: disable=too-many-return-statements r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" ) +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: """Deserialize ISO-8601 formatted string into Datetime object. @@ -314,6 +330,8 @@ def _deserialize_int_as_str(attr): def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore @@ -345,16 +363,46 @@ def _get_model(module_name: str, model_name: str): class _MyMutableMapping(MutableMapping[str, typing.Any]): - def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + def __init__(self, data: dict[str, typing.Any]) -> None: self._data = data def __contains__(self, key: typing.Any) -> bool: return key in self._data def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized return self._data.__getitem__(key) def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass self._data.__setitem__(key, value) def __delitem__(self, key: str) -> None: @@ -425,7 +473,7 @@ def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.pop(key) return self._data.pop(key, default) - def popitem(self) -> typing.Tuple[str, typing.Any]: + def popitem(self) -> tuple[str, typing.Any]: """ Removes and returns some (key, value) pair :returns: The (key, value) pair. @@ -482,6 +530,8 @@ def _is_model(obj: typing.Any) -> bool: def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) return [_serialize(x, format) for x in o] if isinstance(o, dict): return {k: _serialize(v, format) for k, v in o.items()} @@ -513,9 +563,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m return o -def _get_rest_field( - attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str -) -> typing.Optional["_RestField"]: +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: try: return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) except StopIteration: @@ -538,7 +586,7 @@ class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated # could not see _attr_to_rest_field directly because subclass inherits it from parent class - _calculated: typing.Set[str] = set() + _calculated: set[str] = set() def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ @@ -623,7 +671,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order - attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") } annotations = { @@ -638,7 +686,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) if not rf._rest_name_input: rf._rest_name_input = attr - cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -680,7 +728,7 @@ def _deserialize(cls, data, exist_discriminators): mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member return mapped_cls._deserialize(data, exist_discriminators) - def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. @@ -740,7 +788,7 @@ def _deserialize_with_union(deserializers, obj): def _deserialize_dict( value_deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], - obj: typing.Dict[typing.Any, typing.Any], + obj: dict[typing.Any, typing.Any], ): if obj is None: return obj @@ -750,7 +798,7 @@ def _deserialize_dict( def _deserialize_multiple_sequence( - entry_deserializers: typing.List[typing.Optional[typing.Callable]], + entry_deserializers: list[typing.Optional[typing.Callable]], module: typing.Optional[str], obj, ): @@ -768,17 +816,28 @@ def _deserialize_sequence( return obj if isinstance(obj, ET.Element): obj = list(obj) + try: + if ( + isinstance(obj, str) + and isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ): + # encoded string may be deserialized to sequence + return deserializer(obj) + except: # pylint: disable=bare-except + pass return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) -def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: return sorted( types, key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), ) -def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -843,7 +902,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur return functools.partial(_deserialize_with_union, deserializers) try: - if annotation._name == "Dict": # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": value_deserializer = _get_deserialize_callable_from_annotation( annotation.__args__[1], module, rf # pyright: ignore ) @@ -856,7 +918,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur except (AttributeError, IndexError): pass try: - if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: if len(annotation.__args__) > 1: # pyright: ignore entry_deserializers = [ _get_deserialize_callable_from_annotation(dt, module, rf) @@ -940,13 +1005,13 @@ def _deserialize( def _failsafe_deserialize( deserializer: typing.Any, - value: typing.Any, + response: HttpResponse, 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) + return _deserialize(deserializer, response.json(), module, rf, format) except DeserializationError: _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True @@ -956,10 +1021,10 @@ def _failsafe_deserialize( def _failsafe_deserialize_xml( deserializer: typing.Any, - value: typing.Any, + response: HttpResponse, ) -> typing.Any: try: - return _deserialize_xml(deserializer, value) + return _deserialize_xml(deserializer, response.text()) except DeserializationError: _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True @@ -974,11 +1039,11 @@ def __init__( name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin is_discriminator: bool = False, - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ): self._type = type self._rest_name_input = name @@ -993,7 +1058,11 @@ def __init__( @property def _class_type(self) -> typing.Any: - return getattr(self._type, "args", [None])[0] + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result @property def _rest_name(self) -> str: @@ -1004,14 +1073,37 @@ def _rest_name(self) -> str: def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class - item = obj.get(self._rest_name) + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name) if item is None: return item if self._is_model: return item - return _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + if value is None: # we want to wipe out entries if users set attr to None try: @@ -1036,11 +1128,11 @@ def rest_field( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField( name=name, @@ -1057,8 +1149,8 @@ def rest_discriminator( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) @@ -1077,9 +1169,9 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: def _get_element( o: typing.Any, exclude_readonly: bool = False, - parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, typing.List[ET.Element]]: +) -> typing.Union[ET.Element, list[ET.Element]]: if _is_model(o): model_meta = getattr(o, "_xml", {}) @@ -1168,7 +1260,7 @@ def _get_element( def _get_wrapped_element( v: typing.Any, exclude_readonly: bool, - meta: typing.Optional[typing.Dict[str, typing.Any]], + meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: wrapped_element = _create_xml_element( meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None @@ -1211,7 +1303,7 @@ def _deserialize_xml( def _convert_element(e: ET.Element): # dict case if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: - dict_result: typing.Dict[str, typing.Any] = {} + dict_result: dict[str, typing.Any] = {} for child in e: if dict_result.get(child.tag) is not None: if isinstance(dict_result[child.tag], list): @@ -1224,7 +1316,7 @@ def _convert_element(e: ET.Element): return dict_result # array case if len(e) > 0: - array_result: typing.List[typing.Any] = [] + array_result: list[typing.Any] = [] for child in e: array_result.append(_convert_element(child)) return array_result diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_utils/serialization.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_utils/serialization.py index eb86ea23c965..81ec1de5922b 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_utils/serialization.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_utils/serialization.py @@ -21,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -31,7 +30,6 @@ Mapping, Callable, MutableMapping, - List, ) try: @@ -229,12 +227,12 @@ class Model: serialization and deserialization. """ - _subtype_map: Dict[str, Dict[str, Any]] = {} - _attribute_map: Dict[str, Dict[str, Any]] = {} - _validation: Dict[str, Dict[str, Any]] = {} + _subtype_map: dict[str, dict[str, Any]] = {} + _attribute_map: dict[str, dict[str, Any]] = {} + _validation: dict[str, dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: - self.additional_properties: Optional[Dict[str, Any]] = {} + self.additional_properties: Optional[dict[str, Any]] = {} for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -311,7 +309,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -380,7 +378,7 @@ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: def from_dict( cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, ) -> Self: """Parse a dict using given key extractor return a model. @@ -414,7 +412,7 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access return result @classmethod @@ -528,7 +526,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -579,7 +577,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) + serialized |= target_obj.additional_properties continue try: @@ -789,7 +787,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -823,13 +821,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1184,7 +1189,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen while "." in key: # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1386,7 +1391,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1759,7 +1764,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises TypeError: if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1785,7 +1790,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_version.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_version.py index be71c81bd282..0ec13ea52bbf 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_version.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "1.0.0" diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/_client.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/_client.py index eb0c878457a9..e0af1fede7f3 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/_client.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/_client.py @@ -22,6 +22,7 @@ from .operations import FileSystemsOperations, Operations if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -38,19 +39,27 @@ class DellStorageMgmtClient: :type subscription_id: str :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is - "2025-03-21-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Default value is "2025-03-21". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any ) -> None: _endpoint = "{endpoint}" - _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: base_url = _endpoints["resource_manager"] @@ -59,6 +68,7 @@ def __init__( credential=credential, subscription_id=subscription_id, base_url=cast(str, base_url), + cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs ) diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/_configuration.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/_configuration.py index 27d587e97735..ee8206312590 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/_configuration.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/_configuration.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -14,6 +14,7 @@ from .._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -29,9 +30,11 @@ class DellStorageMgmtClientConfiguration: # pylint: disable=too-many-instance-a :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is - "2025-03-21-preview". Note that overriding this default value may result in unsupported - behavior. + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Default value is "2025-03-21". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -40,9 +43,10 @@ def __init__( credential: "AsyncTokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-03-21-preview") + api_version: str = kwargs.pop("api_version", "2025-03-21") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -52,6 +56,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-dellstorage/{}".format(VERSION)) diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/_patch.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/_patch.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/_patch.py @@ -7,9 +7,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/operations/_operations.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/operations/_operations.py index c0351581214e..dadad94b9698 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/operations/_operations.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/operations/_operations.py @@ -8,7 +8,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -47,8 +47,9 @@ from .._configuration import DellStorageMgmtClientConfiguration T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] JSON = MutableMapping[str, Any] +List = list class Operations: @@ -69,7 +70,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation @@ -144,7 +145,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -222,7 +226,10 @@ async def get(self, resource_group_name: str, filesystem_name: str, **kwargs: An except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -291,7 +298,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -620,7 +630,10 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -675,7 +688,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -750,7 +766,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.FileSystemResource"]: + ) -> AsyncItemPaged["_models.FileSystemResource"]: """List FileSystemResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -831,7 +847,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -839,7 +858,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.FileSystemResource"]: + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.FileSystemResource"]: """List FileSystemResource resources by subscription ID. :return: An iterator like instance of FileSystemResource @@ -916,7 +935,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/operations/_patch.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/operations/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/operations/_patch.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/aio/operations/_patch.py @@ -7,9 +7,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/models/_models.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/models/_models.py index e7b88f16ab3e..db1fa2d6575f 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/models/_models.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/models/_models.py @@ -9,7 +9,7 @@ # pylint: disable=useless-super-delegation import datetime -from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload +from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload from .._utils.model_base import Model as _Model, rest_field @@ -274,17 +274,16 @@ class ErrorDetail(_Model): """The error message.""" target: Optional[str] = rest_field(visibility=["read"]) """The error target.""" - details: Optional[List["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) """The error details.""" - additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = rest_field( + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( name="additionalInfo", visibility=["read"] ) """The error additional info.""" class ErrorResponse(_Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. + """Error response. :ivar error: The error object. :vartype error: ~azure.mgmt.dellstorage.models.ErrorDetail @@ -312,7 +311,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Resource(_Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. + """Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -340,8 +339,7 @@ class Resource(_Model): class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. + """Tracked Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -360,7 +358,7 @@ class TrackedResource(Resource): :vartype location: str """ - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" location: str = rest_field(visibility=["read", "create"]) """The geo-location where the resource lives. Required.""" @@ -370,7 +368,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -423,7 +421,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.FileSystemResourceProperties"] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, ) -> None: ... @@ -546,7 +544,7 @@ class FileSystemResourceUpdate(_Model): visibility=["read", "create", "update", "delete", "query"] ) """The managed service identities assigned to this resource.""" - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" properties: Optional["_models.FileSystemResourceUpdateProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -558,7 +556,7 @@ def __init__( self, *, identity: Optional["_models.ManagedServiceIdentityUpdate"] = None, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.FileSystemResourceUpdateProperties"] = None, ) -> None: ... @@ -643,7 +641,7 @@ class ManagedServiceIdentity(_Model): ) """The type of managed identity assigned to this resource. Required. Known values are: \"None\", \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = rest_field( + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] ) """The identities assigned to this resource by the user.""" @@ -653,7 +651,7 @@ def __init__( self, *, type: Union[str, "_models.ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, ) -> None: ... @overload @@ -683,7 +681,7 @@ class ManagedServiceIdentityUpdate(_Model): ) """The type of managed identity assigned to this resource. Known values are: \"None\", \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = rest_field( + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] ) """The identities assigned to this resource by the user.""" @@ -693,7 +691,7 @@ def __init__( self, *, type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, ) -> None: ... @overload @@ -786,7 +784,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Operation(_Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. + """REST API Operation. :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". @@ -943,16 +941,16 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class UserAssignedIdentity(_Model): """User assigned identity properties. - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str :ivar principal_id: The principal ID of the assigned identity. :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str """ - client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) - """The client ID of the assigned identity.""" principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" class UserDetails(_Model): diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/models/_patch.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/models/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/models/_patch.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/models/_patch.py @@ -7,9 +7,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/operations/_operations.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/operations/_operations.py index eb5be3c60dc8..8bd4945384a4 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/operations/_operations.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -38,8 +38,9 @@ from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] JSON = MutableMapping[str, Any] +List = list _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -49,7 +50,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +71,7 @@ def build_file_systems_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +100,7 @@ def build_file_systems_create_or_update_request( # pylint: disable=name-too-lon _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,7 +131,7 @@ def build_file_systems_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -157,12 +158,9 @@ def build_file_systems_update_request( def build_file_systems_delete_request( resource_group_name: str, filesystem_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName}" path_format_arguments = { @@ -176,10 +174,7 @@ def build_file_systems_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_file_systems_list_by_resource_group_request( # pylint: disable=name-too-long @@ -188,7 +183,7 @@ def build_file_systems_list_by_resource_group_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +210,7 @@ def build_file_systems_list_by_subscription_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-21")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +240,7 @@ class Operations: :attr:`operations` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: DellStorageMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") @@ -253,7 +248,7 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation @@ -328,7 +323,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -346,7 +344,7 @@ class FileSystemsOperations: :attr:`file_systems` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: DellStorageMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") @@ -406,7 +404,10 @@ def get(self, resource_group_name: str, filesystem_name: str, **kwargs: Any) -> except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -475,7 +476,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -804,7 +808,10 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -857,7 +864,10 @@ def _delete_initial(self, resource_group_name: str, filesystem_name: str, **kwar except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -930,7 +940,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.FileSystemResource"]: + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.FileSystemResource"]: """List FileSystemResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -1010,7 +1022,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1018,7 +1033,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.FileSystemResource"]: + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.FileSystemResource"]: """List FileSystemResource resources by subscription ID. :return: An iterator like instance of FileSystemResource @@ -1094,7 +1109,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/operations/_patch.py b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/operations/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/operations/_patch.py +++ b/sdk/dell/azure-mgmt-dellstorage/azure/mgmt/dellstorage/operations/_patch.py @@ -7,9 +7,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_create_or_update_maximum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_create_or_update_maximum_set_gen.py index 134bb72f36eb..747db3378e1d 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_create_or_update_maximum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_create_or_update_maximum_set_gen.py @@ -68,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-21-preview/FileSystems_CreateOrUpdate_MaximumSet_Gen.json +# x-ms-original-file: 2025-03-21/FileSystems_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_create_or_update_minimum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_create_or_update_minimum_set_gen.py index 04e0b3221579..abbbd4900741 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_create_or_update_minimum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_create_or_update_minimum_set_gen.py @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-21-preview/FileSystems_CreateOrUpdate_MinimumSet_Gen.json +# x-ms-original-file: 2025-03-21/FileSystems_CreateOrUpdate_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_delete_maximum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_delete_maximum_set_gen.py index 488a29d45818..3ab61f7cf72f 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_delete_maximum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_delete_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2025-03-21-preview/FileSystems_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-03-21/FileSystems_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_delete_minimum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_delete_minimum_set_gen.py index 30bb3233af42..a207834b5583 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_delete_minimum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_delete_minimum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2025-03-21-preview/FileSystems_Delete_MinimumSet_Gen.json +# x-ms-original-file: 2025-03-21/FileSystems_Delete_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_get_maximum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_get_maximum_set_gen.py index eb3b40bbe711..da4a5fb4f325 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_get_maximum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_get_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-21-preview/FileSystems_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-03-21/FileSystems_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_get_minimum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_get_minimum_set_gen.py index 3c2aebc413f9..bd9096ba07b5 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_get_minimum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_get_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-21-preview/FileSystems_Get_MinimumSet_Gen.json +# x-ms-original-file: 2025-03-21/FileSystems_Get_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_resource_group_maximum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_resource_group_maximum_set_gen.py index a4f1e4d5d2ed..c42681730af3 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_resource_group_maximum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_resource_group_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-21-preview/FileSystems_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-03-21/FileSystems_ListByResourceGroup_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_resource_group_minimum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_resource_group_minimum_set_gen.py index a4a55e2f060c..69bf0a3ec3cb 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_resource_group_minimum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_resource_group_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-21-preview/FileSystems_ListByResourceGroup_MinimumSet_Gen.json +# x-ms-original-file: 2025-03-21/FileSystems_ListByResourceGroup_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_subscription_maximum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_subscription_maximum_set_gen.py index 4bcdae3ad3b4..a5f189a725f8 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_subscription_maximum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_subscription_maximum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-21-preview/FileSystems_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-03-21/FileSystems_ListBySubscription_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_subscription_minimum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_subscription_minimum_set_gen.py index 731e941b60ae..d2153dad8d34 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_subscription_minimum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_list_by_subscription_minimum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-21-preview/FileSystems_ListBySubscription_MinimumSet_Gen.json +# x-ms-original-file: 2025-03-21/FileSystems_ListBySubscription_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_update_maximum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_update_maximum_set_gen.py index 369cfd8b6eb8..69f18e73cbe1 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_update_maximum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_update_maximum_set_gen.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-21-preview/FileSystems_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-03-21/FileSystems_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_update_minimum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_update_minimum_set_gen.py index c049d1c768c7..4be60633511b 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_update_minimum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/file_systems_update_minimum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-21-preview/FileSystems_Update_MinimumSet_Gen.json +# x-ms-original-file: 2025-03-21/FileSystems_Update_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/operations_list_maximum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/operations_list_maximum_set_gen.py index 4a8c0b918155..27227f74fdb9 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/operations_list_maximum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/operations_list_maximum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-21-preview/Operations_List_MaximumSet_Gen.json +# x-ms-original-file: 2025-03-21/Operations_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/generated_samples/operations_list_minimum_set_gen.py b/sdk/dell/azure-mgmt-dellstorage/generated_samples/operations_list_minimum_set_gen.py index 64fa658c5799..94e53e7bc562 100644 --- a/sdk/dell/azure-mgmt-dellstorage/generated_samples/operations_list_minimum_set_gen.py +++ b/sdk/dell/azure-mgmt-dellstorage/generated_samples/operations_list_minimum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-21-preview/Operations_List_MinimumSet_Gen.json +# x-ms-original-file: 2025-03-21/Operations_List_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dell/azure-mgmt-dellstorage/pyproject.toml b/sdk/dell/azure-mgmt-dellstorage/pyproject.toml index 42a7f73e0386..aee6aa322b89 100644 --- a/sdk/dell/azure-mgmt-dellstorage/pyproject.toml +++ b/sdk/dell/azure-mgmt-dellstorage/pyproject.toml @@ -1,2 +1,86 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-dellstorage" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Dellstorage Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", +] +requires-python = ">=3.9" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.dellstorage._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + [tool.azure-sdk-build] breaking = false +pyright = false +mypy = false + +[packaging] +package_name = "azure-mgmt-dellstorage" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Dellstorage Management" +package_doc_id = "" +is_stable = true +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +exclude_folders = "" +title = "DellStorageMgmtClient" diff --git a/sdk/dell/azure-mgmt-dellstorage/sdk_packaging.toml b/sdk/dell/azure-mgmt-dellstorage/sdk_packaging.toml deleted file mode 100644 index f4c2aaeb388a..000000000000 --- a/sdk/dell/azure-mgmt-dellstorage/sdk_packaging.toml +++ /dev/null @@ -1,12 +0,0 @@ -[packaging] -package_name = "azure-mgmt-dellstorage" -package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "Dellstorage Management" -package_doc_id = "" -is_stable = false -is_arm = true -need_msrestazure = false -need_azuremgmtcore = true -sample_link = "" -exclude_folders = "" -title = "DellStorageMgmtClient" diff --git a/sdk/dell/azure-mgmt-dellstorage/setup.py b/sdk/dell/azure-mgmt-dellstorage/setup.py deleted file mode 100644 index 76a1b8d8944e..000000000000 --- a/sdk/dell/azure-mgmt-dellstorage/setup.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -import re -import os.path -from io import open -from setuptools import find_packages, setup - -# Change the PACKAGE_NAME only to change folder and different name -PACKAGE_NAME = "azure-mgmt-dellstorage" -PACKAGE_PPRINT_NAME = "Dellstorage Management" - -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") -# a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace("-", ".") - -# Version extraction inspired from 'requests' -with open( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py"), - "r", -) as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - -with open("README.md", encoding="utf-8") as f: - readme = f.read() -with open("CHANGELOG.md", encoding="utf-8") as f: - changelog = f.read() - -setup( - name=PACKAGE_NAME, - version=version, - description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), - long_description=readme + "\n\n" + changelog, - long_description_content_type="text/markdown", - license="MIT License", - author="Microsoft Corporation", - author_email="azpysdkhelp@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python", - keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product - classifiers=[ - "Development Status :: 4 - Beta", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - packages=find_packages( - exclude=[ - "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.mgmt", - ] - ), - include_package_data=True, - package_data={ - "pytyped": ["py.typed"], - }, - install_requires=[ - "isodate>=0.6.1", - "typing-extensions>=4.6.0", - "azure-common>=1.1", - "azure-mgmt-core>=1.5.0", - ], - python_requires=">=3.9", -) diff --git a/sdk/dell/azure-mgmt-dellstorage/tsp-location.yaml b/sdk/dell/azure-mgmt-dellstorage/tsp-location.yaml index 70ff95837051..e3a07e9917b6 100644 --- a/sdk/dell/azure-mgmt-dellstorage/tsp-location.yaml +++ b/sdk/dell/azure-mgmt-dellstorage/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/dell/Dell.Storage.Management -commit: a3baecd6571d7e4b979a7aef527d29a3509d4dc7 +commit: fb25c38a86b35dcf8bb03eaaa7844643bd92c5a2 repo: Azure/azure-rest-api-specs additionalDirectories: