diff --git a/sdk/storage/azure-mgmt-storagecache/_meta.json b/sdk/storage/azure-mgmt-storagecache/_meta.json index 558c8a76e778..fff852f30794 100644 --- a/sdk/storage/azure-mgmt-storagecache/_meta.json +++ b/sdk/storage/azure-mgmt-storagecache/_meta.json @@ -1,11 +1,11 @@ { - "commit": "23b62d4e4dab07dccda851cfe50f6c6afb705a3b", + "commit": "ff19fed90ce730541601cf73d65d5308f0c9f898", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.7", + "@autorest/python@6.2.16", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/storagecache/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/storagecache/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.2.16 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/storagecache/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_serialization.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_serialization.py index 2c170e28dbca..f17c068e833e 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_serialization.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_serialization.py @@ -38,7 +38,22 @@ import re import sys import codecs -from typing import Optional, Union, AnyStr, IO, Mapping +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) try: from urllib import quote # type: ignore @@ -48,12 +63,14 @@ import isodate # type: ignore -from typing import Dict, Any, cast - from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + class RawDeserializer: @@ -277,8 +294,8 @@ class Model(object): _attribute_map: Dict[str, Dict[str, Any]] = {} _validation: Dict[str, Dict[str, Any]] = {} - def __init__(self, **kwargs): - self.additional_properties = {} + def __init__(self, **kwargs: Any) -> None: + self.additional_properties: Dict[str, Any] = {} for k in kwargs: 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__) @@ -287,25 +304,25 @@ def __init__(self, **kwargs): else: setattr(self, k, kwargs[k]) - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" return not self.__eq__(other) - def __str__(self): + def __str__(self) -> str: return str(self.__dict__) @classmethod - def enable_additional_properties_sending(cls): + def enable_additional_properties_sending(cls) -> None: cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} @classmethod - def is_xml_model(cls): + def is_xml_model(cls) -> bool: try: cls._xml_map # type: ignore except AttributeError: @@ -322,7 +339,7 @@ def _create_xml_node(cls): return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - def serialize(self, keep_readonly=False, **kwargs): + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: """Return the JSON that would be sent to azure from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -336,8 +353,13 @@ def serialize(self, keep_readonly=False, **kwargs): serializer = Serializer(self._infer_class_models()) return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) - def as_dict(self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs): - """Return a dict that can be JSONify using json.dump. + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: @@ -384,7 +406,7 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls, data, content_type=None): + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. @@ -396,7 +418,12 @@ def deserialize(cls, data, content_type=None): return deserializer(cls.__name__, data, content_type=content_type) @classmethod - def from_dict(cls, data, key_extractors=None, content_type=None): + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: """Parse a dict using given key extractor return a model. By default consider key @@ -409,8 +436,8 @@ def from_dict(cls, data, key_extractors=None, content_type=None): :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( - [ + deserializer.key_extractors = ( # type: ignore + [ # type: ignore attribute_key_case_insensitive_extractor, rest_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, @@ -518,7 +545,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -534,7 +561,7 @@ def __init__(self, classes=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -626,8 +653,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized.append(local_node) # type: ignore else: # JSON for k in reversed(keys): # type: ignore - unflattened = {k: new_attr} - new_attr = unflattened + new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized @@ -656,8 +682,8 @@ def body(self, data, data_type, **kwargs): """ # Just in case this is a dict - internal_data_type = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type, None) + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: @@ -777,6 +803,8 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: + if data is AzureCoreNull: + return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -1161,7 +1189,8 @@ def rest_key_extractor(attr, attr_desc, data): working_data = data while "." in key: - dict_keys = _FLATTEN.split(key) + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1332,7 +1361,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1352,7 +1381,7 @@ def __init__(self, classes=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = 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 @@ -1471,7 +1500,7 @@ def _classify_target(self, target, data): Once classification has been determined, initialize object. :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. """ if target is None: return None, None @@ -1486,7 +1515,7 @@ def _classify_target(self, target, data): target = target._classify(data, self.dependencies) except AttributeError: pass # Target is not a Model, no classify - return target, target.__class__.__name__ + return target, target.__class__.__name__ # type: ignore def failsafe_deserialize(self, target_obj, data, content_type=None): """Ignores any errors encountered in deserialization, @@ -1496,7 +1525,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): a deserialization error. :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. """ try: diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_vendor.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_vendor.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_vendor.py @@ -5,6 +5,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import List, cast + from azure.core.pipeline.transport import HttpRequest @@ -22,6 +24,7 @@ def _format_url_section(template, **kwargs): try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_version.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_version.py index 73ece66be139..e5754a47ce68 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_version.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.4.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models_py3.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models_py3.py index 63c0682a9d23..2260f59c3603 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models_py3.py @@ -25,7 +25,8 @@ class ApiOperation(_serialization.Model): - """REST API operation description: see https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/openapi-authoring-automated-guidelines.md#r3023-operationsapiimplementation. + """REST API operation description: see + https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/openapi-authoring-automated-guidelines.md#r3023-operationsapiimplementation. :ivar display: The object that represents the operation. :vartype display: ~azure.mgmt.storagecache.models.ApiOperationDisplay @@ -59,8 +60,8 @@ def __init__( is_data_action: Optional[bool] = None, name: Optional[str] = None, service_specification: Optional["_models.ApiOperationPropertiesServiceSpecification"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword display: The object that represents the operation. :paramtype display: ~azure.mgmt.storagecache.models.ApiOperationDisplay @@ -110,8 +111,8 @@ def __init__( provider: Optional[str] = None, resource: Optional[str] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword operation: Operation type: Read, write, delete, etc. :paramtype operation: str @@ -130,7 +131,8 @@ def __init__( class ApiOperationListResult(_serialization.Model): - """Result of the request to list Resource Provider operations. It contains a list of operations and a URL link to get the next set of results. + """Result of the request to list Resource Provider operations. It contains a list of operations + and a URL link to get the next set of results. :ivar next_link: URL to get the next set of operation list results if there are any. :vartype next_link: str @@ -145,8 +147,8 @@ class ApiOperationListResult(_serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["_models.ApiOperation"]] = None, **kwargs - ): + self, *, next_link: Optional[str] = None, value: Optional[List["_models.ApiOperation"]] = None, **kwargs: Any + ) -> None: """ :keyword next_link: URL to get the next set of operation list results if there are any. :paramtype next_link: str @@ -178,8 +180,8 @@ def __init__( *, metric_specifications: Optional[List["_models.MetricSpecification"]] = None, log_specifications: Optional[List["_models.LogSpecification"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword metric_specifications: Details about operations related to metrics. :paramtype metric_specifications: list[~azure.mgmt.storagecache.models.MetricSpecification] @@ -230,8 +232,8 @@ def __init__( status: Optional[str] = None, error: Optional["_models.ErrorResponse"] = None, output: Optional[Dict[str, JSON]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: The operation Id. :paramtype id: str @@ -272,7 +274,7 @@ class BlobNfsTarget(_serialization.Model): "usage_model": {"key": "usageModel", "type": "str"}, } - def __init__(self, *, target: Optional[str] = None, usage_model: Optional[str] = None, **kwargs): + def __init__(self, *, target: Optional[str] = None, usage_model: Optional[str] = None, **kwargs: Any) -> None: """ :keyword target: Resource ID of the storage container. :paramtype target: str @@ -286,7 +288,8 @@ def __init__(self, *, target: Optional[str] = None, usage_model: Optional[str] = class Cache(_serialization.Model): # pylint: disable=too-many-instance-attributes - """A Cache instance. Follows Azure Resource Manager standards: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md. + """A Cache instance. Follows Azure Resource Manager standards: + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md. Variables are only populated by the server, and will be ignored when sending a request. @@ -396,8 +399,8 @@ def __init__( security_settings: Optional["_models.CacheSecuritySettings"] = None, directory_services_settings: Optional["_models.CacheDirectorySettings"] = None, zones: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -506,8 +509,8 @@ def __init__( cache_net_bios_name: str, secondary_dns_ip_address: Optional[str] = None, credentials: Optional["_models.CacheActiveDirectorySettingsCredentials"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword primary_dns_ip_address: Primary DNS IP address used to resolve the Active Directory domain controller's fully qualified domain name. Required. @@ -561,7 +564,7 @@ class CacheActiveDirectorySettingsCredentials(_serialization.Model): "password": {"key": "password", "type": "str"}, } - def __init__(self, *, username: str, password: str, **kwargs): + def __init__(self, *, username: str, password: str, **kwargs: Any) -> None: """ :keyword username: Username of the Active Directory domain administrator. This value is stored encrypted and not returned on response. Required. @@ -596,8 +599,8 @@ def __init__( *, active_directory: Optional["_models.CacheActiveDirectorySettings"] = None, username_download: Optional["_models.CacheUsernameDownloadSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword active_directory: Specifies settings for joining the HPC Cache to an Active Directory domain. @@ -631,8 +634,8 @@ def __init__( *, key_encryption_key: Optional["_models.KeyVaultKeyReference"] = None, rotation_to_latest_key_version_enabled: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword key_encryption_key: Specifies the location of the key encryption key in Key Vault. :paramtype key_encryption_key: ~azure.mgmt.storagecache.models.KeyVaultKeyReference @@ -646,7 +649,8 @@ def __init__( class CacheHealth(_serialization.Model): - """An indication of Cache health. Gives more information about health than just that related to provisioning. + """An indication of Cache health. Gives more information about health than just that related to + provisioning. Variables are only populated by the server, and will be ignored when sending a request. @@ -675,8 +679,8 @@ def __init__( *, state: Optional[Union[str, "_models.HealthStateType"]] = None, status_description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword state: List of Cache health states. Known values are: "Unknown", "Healthy", "Degraded", "Down", "Transitioning", "Stopping", "Stopped", "Upgrading", "Flushing", @@ -726,8 +730,8 @@ def __init__( *, type: Optional[Union[str, "_models.CacheIdentityType"]] = None, user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentitiesValue"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: The type of identity used for the cache. Known values are: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", and "None". @@ -783,8 +787,8 @@ def __init__( dns_servers: Optional[List[str]] = None, dns_search_domain: Optional[str] = None, ntp_server: str = "time.windows.com", - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword mtu: The IPv4 maximum transmission unit configured for the subnet. :paramtype mtu: int @@ -816,7 +820,7 @@ class CacheSecuritySettings(_serialization.Model): "access_policies": {"key": "accessPolicies", "type": "[NfsAccessPolicy]"}, } - def __init__(self, *, access_policies: Optional[List["_models.NfsAccessPolicy"]] = None, **kwargs): + def __init__(self, *, access_policies: Optional[List["_models.NfsAccessPolicy"]] = None, **kwargs: Any) -> None: """ :keyword access_policies: NFS access policies defined for this cache. :paramtype access_policies: list[~azure.mgmt.storagecache.models.NfsAccessPolicy] @@ -836,7 +840,7 @@ class CacheSku(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: SKU name for this Cache. :paramtype name: str @@ -846,7 +850,8 @@ def __init__(self, *, name: Optional[str] = None, **kwargs): class CachesListResult(_serialization.Model): - """Result of the request to list Caches. It contains a list of Caches and a URL link to get the next set of results. + """Result of the request to list Caches. It contains a list of Caches and a URL link to get the + next set of results. :ivar next_link: URL to get the next set of Cache list results, if there are any. :vartype next_link: str @@ -859,7 +864,9 @@ class CachesListResult(_serialization.Model): "value": {"key": "value", "type": "[Cache]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["_models.Cache"]] = None, **kwargs): + def __init__( + self, *, next_link: Optional[str] = None, value: Optional[List["_models.Cache"]] = None, **kwargs: Any + ) -> None: """ :keyword next_link: URL to get the next set of Cache list results, if there are any. :paramtype next_link: str @@ -894,8 +901,8 @@ def __init__( *, upgrade_schedule_enabled: Optional[bool] = None, scheduled_time: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword upgrade_schedule_enabled: True if the user chooses to select an installation time between now and firmwareUpdateDeadline. Else the firmware will automatically be installed after @@ -949,7 +956,7 @@ class CacheUpgradeStatus(_serialization.Model): "pending_firmware_version": {"key": "pendingFirmwareVersion", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.current_firmware_version = None @@ -1030,8 +1037,8 @@ def __init__( auto_download_certificate: Optional[bool] = None, ca_certificate_uri: Optional[str] = None, credentials: Optional["_models.CacheUsernameDownloadSettingsCredentials"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword extended_groups: Whether or not Extended Groups is enabled. :paramtype extended_groups: bool @@ -1094,7 +1101,7 @@ class CacheUsernameDownloadSettingsCredentials(_serialization.Model): "bind_password": {"key": "bindPassword", "type": "str"}, } - def __init__(self, *, bind_dn: Optional[str] = None, bind_password: Optional[str] = None, **kwargs): + def __init__(self, *, bind_dn: Optional[str] = None, bind_password: Optional[str] = None, **kwargs: Any) -> None: """ :keyword bind_dn: The Bind Distinguished Name identity to be used in the secure LDAP connection. This value is stored encrypted and not returned on response. @@ -1119,7 +1126,7 @@ class ClfsTarget(_serialization.Model): "target": {"key": "target", "type": "str"}, } - def __init__(self, *, target: Optional[str] = None, **kwargs): + def __init__(self, *, target: Optional[str] = None, **kwargs: Any) -> None: """ :keyword target: Resource ID of storage container. :paramtype target: str @@ -1158,8 +1165,8 @@ def __init__( details: Optional[List["_models.CloudErrorBody"]] = None, message: Optional[str] = None, target: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed programmatically. @@ -1201,7 +1208,7 @@ class Condition(_serialization.Model): "message": {"key": "message", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.timestamp = None @@ -1222,7 +1229,7 @@ class ErrorResponse(_serialization.Model): "message": {"key": "message", "type": "str"}, } - def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs): + def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs: Any) -> None: """ :keyword code: Error code. :paramtype code: str @@ -1255,7 +1262,7 @@ class KeyVaultKeyReference(_serialization.Model): "source_vault": {"key": "sourceVault", "type": "KeyVaultKeyReferenceSourceVault"}, } - def __init__(self, *, key_url: str, source_vault: "_models.KeyVaultKeyReferenceSourceVault", **kwargs): + def __init__(self, *, key_url: str, source_vault: "_models.KeyVaultKeyReferenceSourceVault", **kwargs: Any) -> None: """ :keyword key_url: The URL referencing a key encryption key in Key Vault. Required. :paramtype key_url: str @@ -1278,7 +1285,7 @@ class KeyVaultKeyReferenceSourceVault(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, *, id: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Resource Id. :paramtype id: str @@ -1301,7 +1308,7 @@ class LogSpecification(_serialization.Model): "display_name": {"key": "displayName", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, display_name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, display_name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: The name of the log. :paramtype name: str @@ -1340,8 +1347,8 @@ def __init__( display_name: Optional[str] = None, internal_name: Optional[str] = None, to_be_exported_for_shoebox: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Name of the dimension. :paramtype name: str @@ -1403,8 +1410,8 @@ def __init__( supported_aggregation_types: Optional[List[Union[str, "_models.MetricAggregationType"]]] = None, metric_class: Optional[str] = None, dimensions: Optional[List["_models.MetricDimension"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name of the metric. :paramtype name: str @@ -1462,8 +1469,8 @@ def __init__( target_path: Optional[str] = None, nfs_export: Optional[str] = None, nfs_access_policy: str = "default", - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword namespace_path: Namespace path on a Cache for a Storage Target. :paramtype namespace_path: str @@ -1499,7 +1506,7 @@ class Nfs3Target(_serialization.Model): "usage_model": {"key": "usageModel", "type": "str"}, } - def __init__(self, *, target: Optional[str] = None, usage_model: Optional[str] = None, **kwargs): + def __init__(self, *, target: Optional[str] = None, usage_model: Optional[str] = None, **kwargs: Any) -> None: """ :keyword target: IP address or host name of an NFSv3 host (e.g., 10.0.44.44). :paramtype target: str @@ -1534,7 +1541,7 @@ class NfsAccessPolicy(_serialization.Model): "access_rules": {"key": "accessRules", "type": "[NfsAccessRule]"}, } - def __init__(self, *, name: str, access_rules: List["_models.NfsAccessRule"], **kwargs): + def __init__(self, *, name: str, access_rules: List["_models.NfsAccessRule"], **kwargs: Any) -> None: """ :keyword name: Name identifying this policy. Access Policy names are not case sensitive. Required. @@ -1607,8 +1614,8 @@ def __init__( root_squash: Optional[bool] = None, anonymous_uid: Optional[str] = None, anonymous_gid: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword scope: Scope for this rule. The scope and filter determine which clients match the rule. Required. Known values are: "default", "network", and "host". @@ -1693,7 +1700,7 @@ class PrimingJob(_serialization.Model): "priming_job_percent_complete": {"key": "primingJobPercentComplete", "type": "float"}, } - def __init__(self, *, priming_job_name: str, priming_manifest_url: str, **kwargs): + def __init__(self, *, priming_job_name: str, priming_manifest_url: str, **kwargs: Any) -> None: """ :keyword priming_job_name: The priming job name. Required. :paramtype priming_job_name: str @@ -1729,7 +1736,7 @@ class PrimingJobIdParameter(_serialization.Model): "priming_job_id": {"key": "primingJobId", "type": "str"}, } - def __init__(self, *, priming_job_id: str, **kwargs): + def __init__(self, *, priming_job_id: str, **kwargs: Any) -> None: """ :keyword priming_job_id: The unique identifier of the priming job. Required. :paramtype priming_job_id: str @@ -1780,8 +1787,8 @@ def __init__( location_info: Optional[List["_models.ResourceSkuLocationInfo"]] = None, name: Optional[str] = None, restrictions: Optional[List["_models.Restriction"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword capabilities: A list of capabilities of this SKU, such as throughput or ops/sec. :paramtype capabilities: list[~azure.mgmt.storagecache.models.ResourceSkuCapabilities] @@ -1816,7 +1823,7 @@ class ResourceSkuCapabilities(_serialization.Model): "value": {"key": "value", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Name of a capability, such as ops/sec. :paramtype name: str @@ -1842,7 +1849,7 @@ class ResourceSkuLocationInfo(_serialization.Model): "zones": {"key": "zones", "type": "[str]"}, } - def __init__(self, *, location: Optional[str] = None, zones: Optional[List[str]] = None, **kwargs): + def __init__(self, *, location: Optional[str] = None, zones: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword location: Location where this SKU is available. :paramtype location: str @@ -1874,7 +1881,7 @@ class ResourceSkusResult(_serialization.Model): "value": {"key": "value", "type": "[ResourceSku]"}, } - def __init__(self, *, next_link: Optional[str] = None, **kwargs): + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: """ :keyword next_link: The URI to fetch the next page of Cache SKUs. :paramtype next_link: str @@ -1913,7 +1920,7 @@ class ResourceUsage(_serialization.Model): "name": {"key": "name", "type": "ResourceUsageName"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.limit = None @@ -1936,7 +1943,7 @@ class ResourceUsageName(_serialization.Model): "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__(self, *, value: Optional[str] = None, localized_value: Optional[str] = None, **kwargs): + def __init__(self, *, value: Optional[str] = None, localized_value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword value: Canonical name for this resource type. :paramtype value: str @@ -1949,7 +1956,8 @@ def __init__(self, *, value: Optional[str] = None, localized_value: Optional[str class ResourceUsagesListResult(_serialization.Model): - """Result of the request to list resource usages. It contains a list of resource usages & limits and a URL link to get the next set of results. + """Result of the request to list resource usages. It contains a list of resource usages & limits + and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -1970,7 +1978,7 @@ class ResourceUsagesListResult(_serialization.Model): "value": {"key": "value", "type": "[ResourceUsage]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.next_link = None @@ -2006,7 +2014,7 @@ class Restriction(_serialization.Model): "reason_code": {"key": "reasonCode", "type": "str"}, } - def __init__(self, *, reason_code: Optional[Union[str, "_models.ReasonCode"]] = None, **kwargs): + def __init__(self, *, reason_code: Optional[Union[str, "_models.ReasonCode"]] = None, **kwargs: Any) -> None: """ :keyword reason_code: The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". "QuotaId" is set when the SKU has requiredQuotas parameter as @@ -2053,7 +2061,7 @@ class StorageTargetResource(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -2139,8 +2147,8 @@ def __init__( clfs: Optional["_models.ClfsTarget"] = None, unknown: Optional["_models.UnknownTarget"] = None, blob_nfs: Optional["_models.BlobNfsTarget"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword junctions: List of Cache namespace junctions to target for namespace associations. :paramtype junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] @@ -2190,7 +2198,9 @@ class StorageTargetSpaceAllocation(_serialization.Model): "allocation_percentage": {"key": "allocationPercentage", "type": "int"}, } - def __init__(self, *, name: Optional[str] = None, allocation_percentage: Optional[int] = None, **kwargs): + def __init__( + self, *, name: Optional[str] = None, allocation_percentage: Optional[int] = None, **kwargs: Any + ) -> None: """ :keyword name: Name of the storage target. :paramtype name: str @@ -2218,8 +2228,8 @@ class StorageTargetsResult(_serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["_models.StorageTarget"]] = None, **kwargs - ): + self, *, next_link: Optional[str] = None, value: Optional[List["_models.StorageTarget"]] = None, **kwargs: Any + ) -> None: """ :keyword next_link: The URI to fetch the next page of Storage Targets. :paramtype next_link: str @@ -2268,8 +2278,8 @@ 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, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -2307,7 +2317,7 @@ class UnknownTarget(_serialization.Model): "attributes": {"key": "attributes", "type": "{str}"}, } - def __init__(self, *, attributes: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, attributes: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword attributes: Dictionary of string->string pairs containing information about the Storage Target. @@ -2341,8 +2351,8 @@ def __init__( display: Optional["_models.UsageModelDisplay"] = None, model_name: Optional[str] = None, target_type: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword display: Localized information describing this usage model. :paramtype display: ~azure.mgmt.storagecache.models.UsageModelDisplay @@ -2369,7 +2379,7 @@ class UsageModelDisplay(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, *, description: Optional[str] = None, **kwargs): + def __init__(self, *, description: Optional[str] = None, **kwargs: Any) -> None: """ :keyword description: String to display for this usage model. :paramtype description: str @@ -2393,8 +2403,8 @@ class UsageModelsResult(_serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["_models.UsageModel"]] = None, **kwargs - ): + self, *, next_link: Optional[str] = None, value: Optional[List["_models.UsageModel"]] = None, **kwargs: Any + ) -> None: """ :keyword next_link: The URI to fetch the next page of Cache usage models. :paramtype next_link: str @@ -2427,7 +2437,7 @@ class UserAssignedIdentitiesValue(_serialization.Model): "client_id": {"key": "clientId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.principal_id = None