From cb4aaef005c816579d4930d054f036680174a672 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 1 Mar 2023 06:17:04 +0000 Subject: [PATCH] CodeGen from PR 22799 in Azure/azure-rest-api-specs Merge c6cfcca472a62d030b068143dd2cb613a5db4b52 into aa85f59e259c4b12197b57b221067c40fa2fe3f1 --- .../azure-mgmt-sqlvirtualmachine/_meta.json | 6 +- .../mgmt/sqlvirtualmachine/_serialization.py | 87 +++++++---- .../_sql_virtual_machine_management_client.py | 2 +- .../azure/mgmt/sqlvirtualmachine/_vendor.py | 5 +- .../azure/mgmt/sqlvirtualmachine/_version.py | 2 +- .../_sql_virtual_machine_management_client.py | 2 +- ...availability_group_listeners_operations.py | 4 +- .../_sql_virtual_machine_groups_operations.py | 8 +- ...virtual_machine_troubleshoot_operations.py | 4 +- .../_sql_virtual_machines_operations.py | 6 +- .../sqlvirtualmachine/models/_models_py3.py | 145 ++++++++++-------- ...availability_group_listeners_operations.py | 4 +- .../_sql_virtual_machine_groups_operations.py | 8 +- ...virtual_machine_troubleshoot_operations.py | 4 +- .../_sql_virtual_machines_operations.py | 6 +- 15 files changed, 170 insertions(+), 123 deletions(-) diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/_meta.json b/sdk/sql/azure-mgmt-sqlvirtualmachine/_meta.json index 0937599ee138..abaef2d30375 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/_meta.json +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/_meta.json @@ -1,11 +1,11 @@ { - "commit": "020f48c422ec455cdee9f6516f2d0172d13e77a3", + "commit": "2843aa679564a4abbff3aeb2c27459931499b52a", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.7", + "@autorest/python@6.4.0", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/sqlvirtualmachine/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/sqlvirtualmachine/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.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/sqlvirtualmachine/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_serialization.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_serialization.py index 2c170e28dbca..f17c068e833e 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_serialization.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_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/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_sql_virtual_machine_management_client.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_sql_virtual_machine_management_client.py index f17dd2343e8f..fc5afe0433a3 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_sql_virtual_machine_management_client.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_sql_virtual_machine_management_client.py @@ -120,5 +120,5 @@ def __enter__(self) -> "SqlVirtualMachineManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_vendor.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_vendor.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_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/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_version.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_version.py index 9cf33092d41b..e5754a47ce68 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_version.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b5" +VERSION = "1.0.0b1" diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/_sql_virtual_machine_management_client.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/_sql_virtual_machine_management_client.py index 56973fc1a0c5..9aca7ff4d560 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/_sql_virtual_machine_management_client.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/_sql_virtual_machine_management_client.py @@ -120,5 +120,5 @@ async def __aenter__(self) -> "SqlVirtualMachineManagementClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_availability_group_listeners_operations.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_availability_group_listeners_operations.py index 1da61a40e166..f0b6e772f961 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_availability_group_listeners_operations.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_availability_group_listeners_operations.py @@ -315,8 +315,8 @@ async def begin_create_or_update( :type sql_virtual_machine_group_name: str :param availability_group_listener_name: Name of the availability group listener. Required. :type availability_group_listener_name: str - :param parameters: The availability group listener. Is either a model type or a IO type. - Required. + :param parameters: The availability group listener. Is either a AvailabilityGroupListener type + or a IO type. Required. :type parameters: ~azure.mgmt.sqlvirtualmachine.models.AvailabilityGroupListener or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machine_groups_operations.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machine_groups_operations.py index 6912145457f5..2398dc0822d5 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machine_groups_operations.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machine_groups_operations.py @@ -295,8 +295,8 @@ async def begin_create_or_update( :type resource_group_name: str :param sql_virtual_machine_group_name: Name of the SQL virtual machine group. Required. :type sql_virtual_machine_group_name: str - :param parameters: The SQL virtual machine group. Is either a model type or a IO type. - Required. + :param parameters: The SQL virtual machine group. Is either a SqlVirtualMachineGroup type or a + IO type. Required. :type parameters: ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroup or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -649,8 +649,8 @@ async def begin_update( :type resource_group_name: str :param sql_virtual_machine_group_name: Name of the SQL virtual machine group. Required. :type sql_virtual_machine_group_name: str - :param parameters: The SQL virtual machine group. Is either a model type or a IO type. - Required. + :param parameters: The SQL virtual machine group. Is either a SqlVirtualMachineGroupUpdate type + or a IO type. Required. :type parameters: ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroupUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machine_troubleshoot_operations.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machine_troubleshoot_operations.py index 50a6059af9e8..9fba9ea417b1 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machine_troubleshoot_operations.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machine_troubleshoot_operations.py @@ -221,8 +221,8 @@ async def begin_troubleshoot( :type resource_group_name: str :param sql_virtual_machine_name: Name of the SQL virtual machine. Required. :type sql_virtual_machine_name: str - :param parameters: The SQL virtual machine troubleshooting entity. Is either a model type or a - IO type. Required. + :param parameters: The SQL virtual machine troubleshooting entity. Is either a + SqlVmTroubleshooting type or a IO type. Required. :type parameters: ~azure.mgmt.sqlvirtualmachine.models.SqlVmTroubleshooting or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machines_operations.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machines_operations.py index ed6127748484..e07e84a7188a 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machines_operations.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machines_operations.py @@ -478,7 +478,8 @@ async def begin_create_or_update( :type resource_group_name: str :param sql_virtual_machine_name: Name of the SQL virtual machine. Required. :type sql_virtual_machine_name: str - :param parameters: The SQL virtual machine. Is either a model type or a IO type. Required. + :param parameters: The SQL virtual machine. Is either a SqlVirtualMachine type or a IO type. + Required. :type parameters: ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachine or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -831,7 +832,8 @@ async def begin_update( :type resource_group_name: str :param sql_virtual_machine_name: Name of the SQL virtual machine. Required. :type sql_virtual_machine_name: str - :param parameters: The SQL virtual machine. Is either a model type or a IO type. Required. + :param parameters: The SQL virtual machine. Is either a SqlVirtualMachineUpdate type or a IO + type. Required. :type parameters: ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/_models_py3.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/_models_py3.py index e8e66f64a0a8..09296334bc45 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/_models_py3.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/_models_py3.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from .. import _serialization @@ -29,7 +29,7 @@ class AADAuthenticationSettings(_serialization.Model): "client_id": {"key": "clientId", "type": "str"}, } - def __init__(self, *, client_id: Optional[str] = None, **kwargs): + def __init__(self, *, client_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword client_id: The client Id of the Managed Identity to query Microsoft Graph API. An empty string must be used for the system assigned Managed Identity. @@ -50,7 +50,7 @@ class AdditionalFeaturesServerConfigurations(_serialization.Model): "is_r_services_enabled": {"key": "isRServicesEnabled", "type": "bool"}, } - def __init__(self, *, is_r_services_enabled: Optional[bool] = None, **kwargs): + def __init__(self, *, is_r_services_enabled: Optional[bool] = None, **kwargs: Any) -> None: """ :keyword is_r_services_enabled: Enable or disable R services (SQL 2016 onwards). :paramtype is_r_services_enabled: bool @@ -70,7 +70,7 @@ class AgConfiguration(_serialization.Model): "replicas": {"key": "replicas", "type": "[AgReplica]"}, } - def __init__(self, *, replicas: Optional[List["_models.AgReplica"]] = None, **kwargs): + def __init__(self, *, replicas: Optional[List["_models.AgReplica"]] = None, **kwargs: Any) -> None: """ :keyword replicas: Replica configurations. :paramtype replicas: list[~azure.mgmt.sqlvirtualmachine.models.AgReplica] @@ -113,8 +113,8 @@ def __init__( commit: Optional[Union[str, "_models.Commit"]] = None, failover: Optional[Union[str, "_models.Failover"]] = None, readable_secondary: Optional[Union[str, "_models.ReadableSecondary"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword sql_virtual_machine_instance_id: Sql VirtualMachine Instance Id. :paramtype sql_virtual_machine_instance_id: str @@ -161,8 +161,8 @@ def __init__( enable: Optional[bool] = None, run_immediately: Optional[bool] = None, schedule: Optional["_models.Schedule"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword enable: Enable or disable SQL best practices Assessment feature on SQL virtual machine. @@ -249,8 +249,8 @@ def __init__( full_backup_start_time: Optional[int] = None, full_backup_window_hours: Optional[int] = None, log_backup_frequency: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword enable: Enable or disable autobackup on SQL virtual machine. :paramtype enable: bool @@ -333,8 +333,8 @@ def __init__( day_of_week: Optional[Union[str, "_models.DayOfWeek"]] = None, maintenance_window_starting_hour: Optional[int] = None, maintenance_window_duration: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword enable: Enable or disable autopatching on SQL virtual machine. :paramtype enable: bool @@ -379,7 +379,7 @@ class Resource(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -412,7 +412,7 @@ class ProxyResource(Resource): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -494,8 +494,8 @@ def __init__( create_default_availability_group_if_not_exist: Optional[bool] = None, port: Optional[int] = None, availability_group_configuration: Optional["_models.AgConfiguration"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword availability_group_name: Name of the availability group. :paramtype availability_group_name: str @@ -548,7 +548,7 @@ class AvailabilityGroupListenerListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -576,7 +576,7 @@ class ErrorAdditionalInfo(_serialization.Model): "info": {"key": "info", "type": "object"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.type = None @@ -616,7 +616,7 @@ class ErrorDetail(_serialization.Model): "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -627,7 +627,8 @@ def __init__(self, **kwargs): class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). :ivar error: The error object. :vartype error: ~azure.mgmt.sqlvirtualmachine.models.ErrorDetail @@ -637,7 +638,7 @@ class ErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: """ :keyword error: The error object. :paramtype error: ~azure.mgmt.sqlvirtualmachine.models.ErrorDetail @@ -677,8 +678,8 @@ def __init__( azure_key_vault_url: Optional[str] = None, service_principal_name: Optional[str] = None, service_principal_secret: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword enable: Enable or disable key vault credential setting. :paramtype enable: bool @@ -731,8 +732,8 @@ def __init__( load_balancer_resource_id: Optional[str] = None, probe_port: Optional[int] = None, sql_virtual_machine_instances: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword private_ip_address: Private IP address. :paramtype private_ip_address: ~azure.mgmt.sqlvirtualmachine.models.PrivateIPAddress @@ -776,7 +777,9 @@ class MultiSubnetIpConfiguration(_serialization.Model): "sql_virtual_machine_instance": {"key": "sqlVirtualMachineInstance", "type": "str"}, } - def __init__(self, *, private_ip_address: "_models.PrivateIPAddress", sql_virtual_machine_instance: str, **kwargs): + def __init__( + self, *, private_ip_address: "_models.PrivateIPAddress", sql_virtual_machine_instance: str, **kwargs: Any + ) -> None: """ :keyword private_ip_address: Private IP address. Required. :paramtype private_ip_address: ~azure.mgmt.sqlvirtualmachine.models.PrivateIPAddress @@ -818,7 +821,7 @@ class Operation(_serialization.Model): "properties": {"key": "properties", "type": "{object}"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -857,7 +860,7 @@ class OperationDisplay(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provider = None @@ -887,7 +890,7 @@ class OperationListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -908,7 +911,9 @@ class PrivateIPAddress(_serialization.Model): "subnet_resource_id": {"key": "subnetResourceId", "type": "str"}, } - def __init__(self, *, ip_address: Optional[str] = None, subnet_resource_id: Optional[str] = None, **kwargs): + def __init__( + self, *, ip_address: Optional[str] = None, subnet_resource_id: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword ip_address: Private IP address bound to the availability group listener. :paramtype ip_address: str @@ -946,7 +951,7 @@ class ResourceIdentity(_serialization.Model): "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__(self, *, type: Optional[Union[str, "_models.IdentityType"]] = None, **kwargs): + def __init__(self, *, type: Optional[Union[str, "_models.IdentityType"]] = None, **kwargs: Any) -> None: """ :keyword type: The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Known values are: "None" and @@ -993,8 +998,8 @@ def __init__( monthly_occurrence: Optional[int] = None, day_of_week: Optional[Union[str, "_models.AssessmentDayOfWeek"]] = None, start_time: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword enable: Enable or disable assessment schedule on SQL virtual machine. :paramtype enable: bool @@ -1070,8 +1075,8 @@ def __init__( additional_features_server_configurations: Optional["_models.AdditionalFeaturesServerConfigurations"] = None, sql_instance_settings: Optional["_models.SQLInstanceSettings"] = None, azure_ad_authentication_settings: Optional["_models.AADAuthenticationSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword sql_connectivity_update_settings: SQL connectivity type settings. :paramtype sql_connectivity_update_settings: @@ -1128,8 +1133,8 @@ def __init__( port: Optional[int] = None, sql_auth_update_user_name: Optional[str] = None, sql_auth_update_password: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword connectivity_type: SQL Server connectivity option. Known values are: "LOCAL", "PRIVATE", and "PUBLIC". @@ -1187,8 +1192,8 @@ def __init__( max_server_memory_mb: Optional[int] = None, is_lpim_enabled: Optional[bool] = None, is_ifi_enabled: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword collation: SQL Server Collation. :paramtype collation: str @@ -1229,7 +1234,9 @@ class SQLStorageSettings(_serialization.Model): "default_file_path": {"key": "defaultFilePath", "type": "str"}, } - def __init__(self, *, luns: Optional[List[int]] = None, default_file_path: Optional[str] = None, **kwargs): + def __init__( + self, *, luns: Optional[List[int]] = None, default_file_path: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword luns: Logical Unit Numbers for the disks. :paramtype luns: list[int] @@ -1266,8 +1273,8 @@ def __init__( disk_count: Optional[int] = None, starting_device_id: Optional[int] = None, disk_configuration_type: Optional[Union[str, "_models.DiskConfigurationType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword disk_count: Virtual machine disk count. :paramtype disk_count: int @@ -1331,8 +1338,8 @@ def __init__( persist_folder_path: Optional[str] = None, luns: Optional[List[int]] = None, default_file_path: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword data_file_size: SQL Server tempdb data file size. :paramtype data_file_size: int @@ -1399,7 +1406,7 @@ class TrackedResource(Resource): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword location: Resource location. Required. :paramtype location: str @@ -1552,8 +1559,8 @@ def __init__( # pylint: disable=too-many-locals storage_configuration_settings: Optional["_models.StorageConfigurationSettings"] = None, assessment_settings: Optional["_models.AssessmentSettings"] = None, enable_automatic_upgrade: bool = False, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: Resource location. Required. :paramtype location: str @@ -1704,8 +1711,8 @@ def __init__( sql_image_offer: Optional[str] = None, sql_image_sku: Optional[Union[str, "_models.SqlVmGroupImageSku"]] = None, wsfc_domain_profile: Optional["_models.WsfcDomainProfile"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: Resource location. Required. :paramtype location: str @@ -1750,7 +1757,7 @@ class SqlVirtualMachineGroupListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1768,7 +1775,7 @@ class SqlVirtualMachineGroupUpdate(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -1798,7 +1805,7 @@ class SqlVirtualMachineListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1816,7 +1823,7 @@ class SqlVirtualMachineUpdate(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -1862,8 +1869,8 @@ def __init__( end_time_utc: Optional[datetime.datetime] = None, troubleshooting_scenario: Optional[Union[str, "_models.TroubleshootingScenario"]] = None, properties: Optional["_models.TroubleshootingAdditionalProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword start_time_utc: Start time in UTC timezone. :paramtype start_time_utc: ~datetime.datetime @@ -1895,7 +1902,9 @@ class SqlWorkloadTypeUpdateSettings(_serialization.Model): "sql_workload_type": {"key": "sqlWorkloadType", "type": "str"}, } - def __init__(self, *, sql_workload_type: Optional[Union[str, "_models.SqlWorkloadType"]] = None, **kwargs): + def __init__( + self, *, sql_workload_type: Optional[Union[str, "_models.SqlWorkloadType"]] = None, **kwargs: Any + ) -> None: """ :keyword sql_workload_type: SQL Server workload type. Known values are: "GENERAL", "OLTP", and "DW". @@ -1943,8 +1952,8 @@ def __init__( sql_system_db_on_data_disk: Optional[bool] = None, disk_configuration_type: Optional[Union[str, "_models.DiskConfigurationType"]] = None, storage_workload_type: Optional[Union[str, "_models.StorageWorkloadType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword sql_data_settings: SQL Server Data Storage Settings. :paramtype sql_data_settings: ~azure.mgmt.sqlvirtualmachine.models.SQLStorageSettings @@ -2009,8 +2018,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 @@ -2047,7 +2056,9 @@ class TroubleshootingAdditionalProperties(_serialization.Model): "unhealthy_replica_info": {"key": "unhealthyReplicaInfo", "type": "UnhealthyReplicaInfo"}, } - def __init__(self, *, unhealthy_replica_info: Optional["_models.UnhealthyReplicaInfo"] = None, **kwargs): + def __init__( + self, *, unhealthy_replica_info: Optional["_models.UnhealthyReplicaInfo"] = None, **kwargs: Any + ) -> None: """ :keyword unhealthy_replica_info: The unhealthy replica information. :paramtype unhealthy_replica_info: ~azure.mgmt.sqlvirtualmachine.models.UnhealthyReplicaInfo @@ -2094,7 +2105,7 @@ class TroubleshootingStatus(_serialization.Model): "properties": {"key": "properties", "type": "TroubleshootingAdditionalProperties"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.root_cause = None @@ -2116,7 +2127,7 @@ class UnhealthyReplicaInfo(_serialization.Model): "availability_group_name": {"key": "availabilityGroupName", "type": "str"}, } - def __init__(self, *, availability_group_name: Optional[str] = None, **kwargs): + def __init__(self, *, availability_group_name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword availability_group_name: The name of the availability group. :paramtype availability_group_name: str @@ -2148,8 +2159,8 @@ def __init__( cluster_bootstrap_account_password: Optional[str] = None, cluster_operator_account_password: Optional[str] = None, sql_service_account_password: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword cluster_bootstrap_account_password: Cluster bootstrap account password. :paramtype cluster_bootstrap_account_password: str @@ -2215,8 +2226,8 @@ def __init__( storage_account_url: Optional[str] = None, storage_account_primary_key: Optional[str] = None, cluster_subnet_type: Optional[Union[str, "_models.ClusterSubnetType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword domain_fqdn: Fully qualified name of the domain. :paramtype domain_fqdn: str diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_availability_group_listeners_operations.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_availability_group_listeners_operations.py index 9eb47a7f793e..e9a0ca17b193 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_availability_group_listeners_operations.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_availability_group_listeners_operations.py @@ -480,8 +480,8 @@ def begin_create_or_update( :type sql_virtual_machine_group_name: str :param availability_group_listener_name: Name of the availability group listener. Required. :type availability_group_listener_name: str - :param parameters: The availability group listener. Is either a model type or a IO type. - Required. + :param parameters: The availability group listener. Is either a AvailabilityGroupListener type + or a IO type. Required. :type parameters: ~azure.mgmt.sqlvirtualmachine.models.AvailabilityGroupListener or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_sql_virtual_machine_groups_operations.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_sql_virtual_machine_groups_operations.py index 096f9850d546..40e62f189fd7 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_sql_virtual_machine_groups_operations.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_sql_virtual_machine_groups_operations.py @@ -494,8 +494,8 @@ def begin_create_or_update( :type resource_group_name: str :param sql_virtual_machine_group_name: Name of the SQL virtual machine group. Required. :type sql_virtual_machine_group_name: str - :param parameters: The SQL virtual machine group. Is either a model type or a IO type. - Required. + :param parameters: The SQL virtual machine group. Is either a SqlVirtualMachineGroup type or a + IO type. Required. :type parameters: ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroup or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -847,8 +847,8 @@ def begin_update( :type resource_group_name: str :param sql_virtual_machine_group_name: Name of the SQL virtual machine group. Required. :type sql_virtual_machine_group_name: str - :param parameters: The SQL virtual machine group. Is either a model type or a IO type. - Required. + :param parameters: The SQL virtual machine group. Is either a SqlVirtualMachineGroupUpdate type + or a IO type. Required. :type parameters: ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroupUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_sql_virtual_machine_troubleshoot_operations.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_sql_virtual_machine_troubleshoot_operations.py index f76e1b64d857..1d29222000b8 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_sql_virtual_machine_troubleshoot_operations.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_sql_virtual_machine_troubleshoot_operations.py @@ -267,8 +267,8 @@ def begin_troubleshoot( :type resource_group_name: str :param sql_virtual_machine_name: Name of the SQL virtual machine. Required. :type sql_virtual_machine_name: str - :param parameters: The SQL virtual machine troubleshooting entity. Is either a model type or a - IO type. Required. + :param parameters: The SQL virtual machine troubleshooting entity. Is either a + SqlVmTroubleshooting type or a IO type. Required. :type parameters: ~azure.mgmt.sqlvirtualmachine.models.SqlVmTroubleshooting or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_sql_virtual_machines_operations.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_sql_virtual_machines_operations.py index 8fe0a9b715d3..5144ab4b43f9 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_sql_virtual_machines_operations.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/_sql_virtual_machines_operations.py @@ -812,7 +812,8 @@ def begin_create_or_update( :type resource_group_name: str :param sql_virtual_machine_name: Name of the SQL virtual machine. Required. :type sql_virtual_machine_name: str - :param parameters: The SQL virtual machine. Is either a model type or a IO type. Required. + :param parameters: The SQL virtual machine. Is either a SqlVirtualMachine type or a IO type. + Required. :type parameters: ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachine or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1159,7 +1160,8 @@ def begin_update( :type resource_group_name: str :param sql_virtual_machine_name: Name of the SQL virtual machine. Required. :type sql_virtual_machine_name: str - :param parameters: The SQL virtual machine. Is either a model type or a IO type. Required. + :param parameters: The SQL virtual machine. Is either a SqlVirtualMachineUpdate type or a IO + type. Required. :type parameters: ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None.