From 0211bcf77ffb7dd79da1686257e4f3b40951ddab Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 1 Mar 2023 17:42:19 +0000 Subject: [PATCH] CodeGen from PR 21523 in Azure/azure-rest-api-specs Merge a543fa6cf8bfa3036589199d6a902ceb43c0878c into a60468a0c5e2beb054680ae488fb9f92699f0a0d --- sdk/rdbms/azure-mgmt-rdbms/_meta.json | 6 +- .../_postgre_sql_management_client.py | 2 +- .../mgmt/rdbms/postgresql/_serialization.py | 87 ++++++---- .../azure/mgmt/rdbms/postgresql/_vendor.py | 5 +- .../azure/mgmt/rdbms/postgresql/_version.py | 2 +- .../aio/_postgre_sql_management_client.py | 2 +- .../_check_name_availability_operations.py | 2 +- .../operations/_configurations_operations.py | 2 +- .../aio/operations/_databases_operations.py | 2 +- .../operations/_firewall_rules_operations.py | 2 +- ...private_endpoint_connections_operations.py | 4 +- .../_server_administrators_operations.py | 2 +- .../aio/operations/_server_keys_operations.py | 4 +- .../_server_parameters_operations.py | 4 +- ...rver_security_alert_policies_operations.py | 4 +- .../aio/operations/_servers_operations.py | 8 +- .../_virtual_network_rules_operations.py | 4 +- .../rdbms/postgresql/models/_models_py3.py | 162 ++++++++--------- .../_postgre_sql_management_client_enums.py | 4 +- .../_check_name_availability_operations.py | 2 +- .../operations/_configurations_operations.py | 2 +- .../operations/_databases_operations.py | 2 +- .../operations/_firewall_rules_operations.py | 2 +- ...private_endpoint_connections_operations.py | 4 +- .../_server_administrators_operations.py | 2 +- .../operations/_server_keys_operations.py | 4 +- .../_server_parameters_operations.py | 4 +- ...rver_security_alert_policies_operations.py | 4 +- .../operations/_servers_operations.py | 8 +- .../_virtual_network_rules_operations.py | 4 +- .../_postgre_sql_management_client.py | 2 +- .../_serialization.py | 87 ++++++---- .../postgresql_flexibleservers/_vendor.py | 5 +- .../postgresql_flexibleservers/_version.py | 2 +- .../aio/_postgre_sql_management_client.py | 2 +- .../operations/_administrators_operations.py | 2 +- .../_check_name_availability_operations.py | 2 +- ...e_availability_with_location_operations.py | 2 +- .../operations/_configurations_operations.py | 4 +- .../aio/operations/_databases_operations.py | 2 +- .../operations/_firewall_rules_operations.py | 2 +- .../aio/operations/_servers_operations.py | 12 +- ...virtual_network_subnet_usage_operations.py | 4 +- .../models/_models_py3.py | 163 ++++++++++-------- .../operations/_administrators_operations.py | 10 +- .../operations/_backups_operations.py | 4 +- .../_check_name_availability_operations.py | 2 +- ...e_availability_with_location_operations.py | 2 +- .../operations/_configurations_operations.py | 12 +- .../operations/_databases_operations.py | 10 +- .../operations/_firewall_rules_operations.py | 10 +- .../operations/_replicas_operations.py | 2 +- .../operations/_servers_operations.py | 26 +-- ...virtual_network_subnet_usage_operations.py | 4 +- 54 files changed, 399 insertions(+), 320 deletions(-) diff --git a/sdk/rdbms/azure-mgmt-rdbms/_meta.json b/sdk/rdbms/azure-mgmt-rdbms/_meta.json index 2836d93ec82c..6b1cb93ee8de 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/_meta.json +++ b/sdk/rdbms/azure-mgmt-rdbms/_meta.json @@ -1,11 +1,11 @@ { - "commit": "8739a0a2ac54b0d8f8c98da22ee6b446c53b09a7", + "commit": "fafe144294156ce061434fc2560a5fd281a3e23b", "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/postgresql/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/postgresql/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/postgresql/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_postgre_sql_management_client.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_postgre_sql_management_client.py index 25c04726495a..b626a0d49a0b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_postgre_sql_management_client.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_postgre_sql_management_client.py @@ -185,5 +185,5 @@ def __enter__(self) -> "PostgreSQLManagementClient": 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/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_serialization.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_serialization.py index 2c170e28dbca..f17c068e833e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_serialization.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_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/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_vendor.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_vendor.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_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/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_version.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_version.py index 5bd83bce19de..e5754a47ce68 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_version.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "10.2.0b6" +VERSION = "1.0.0b1" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/_postgre_sql_management_client.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/_postgre_sql_management_client.py index 34f6a510d4b3..d8101cb66d5f 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/_postgre_sql_management_client.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/_postgre_sql_management_client.py @@ -186,5 +186,5 @@ async def __aenter__(self) -> "PostgreSQLManagementClient": 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/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_check_name_availability_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_check_name_availability_operations.py index 6a70094d9ba0..c0b42d48ad18 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_check_name_availability_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_check_name_availability_operations.py @@ -102,7 +102,7 @@ async def execute( """Check the availability of name for resource. :param name_availability_request: The required parameters for checking if resource name is - available. Is either a model type or a IO type. Required. + available. Is either a NameAvailabilityRequest type or a IO type. Required. :type name_availability_request: ~azure.mgmt.rdbms.postgresql.models.NameAvailabilityRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_configurations_operations.py index 206e6ccf9756..1631ca7b4eed 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_configurations_operations.py @@ -230,7 +230,7 @@ async def begin_create_or_update( :param configuration_name: The name of the server configuration. Required. :type configuration_name: str :param parameters: The required parameters for updating a server configuration. Is either a - model type or a IO type. Required. + Configuration type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.Configuration or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_databases_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_databases_operations.py index 2b95ee4b044d..8a2f33cb933c 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_databases_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_databases_operations.py @@ -234,7 +234,7 @@ async def begin_create_or_update( :param database_name: The name of the database. Required. :type database_name: str :param parameters: The required parameters for creating or updating a database. Is either a - model type or a IO type. Required. + Database type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.Database or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_firewall_rules_operations.py index 349da2aed2ac..5630b9035ba8 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_firewall_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_firewall_rules_operations.py @@ -234,7 +234,7 @@ async def begin_create_or_update( :param firewall_rule_name: The name of the server firewall rule. Required. :type firewall_rule_name: str :param parameters: The required parameters for creating or updating a firewall rule. Is either - a model type or a IO type. Required. + a FirewallRule type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.FirewallRule or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_private_endpoint_connections_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_private_endpoint_connections_operations.py index 94bbf5a15b59..398c2ceda208 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_private_endpoint_connections_operations.py @@ -299,7 +299,7 @@ async def begin_create_or_update( :type server_name: str :param private_endpoint_connection_name: Required. :type private_endpoint_connection_name: str - :param parameters: Is either a model type or a IO type. Required. + :param parameters: Is either a PrivateEndpointConnection type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -658,7 +658,7 @@ async def begin_update_tags( :param private_endpoint_connection_name: Required. :type private_endpoint_connection_name: str :param parameters: Parameters supplied to the Update private endpoint connection Tags - operation. Is either a model type or a IO type. Required. + operation. Is either a TagsObject type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.TagsObject or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_administrators_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_administrators_operations.py index 39c12a22c752..57250eb8d2e0 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_administrators_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_administrators_operations.py @@ -292,7 +292,7 @@ async def begin_create_or_update( :param server_name: The name of the server. Required. :type server_name: str :param properties: The required parameters for creating or updating an AAD server - administrator. Is either a model type or a IO type. Required. + administrator. Is either a ServerAdministratorResource type or a IO type. Required. :type properties: ~azure.mgmt.rdbms.postgresql.models.ServerAdministratorResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_keys_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_keys_operations.py index 40efce15bac6..72f3de06cc30 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_keys_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_keys_operations.py @@ -376,8 +376,8 @@ async def begin_create_or_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameters: The requested PostgreSQL Server key resource state. Is either a model type - or a IO type. Required. + :param parameters: The requested PostgreSQL Server key resource state. Is either a ServerKey + type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.ServerKey or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_parameters_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_parameters_operations.py index ac0a6810a241..b0c7d035f701 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_parameters_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_parameters_operations.py @@ -214,8 +214,8 @@ async def begin_list_update_configurations( :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param value: The parameters for updating a list of server configuration. Is either a model - type or a IO type. Required. + :param value: The parameters for updating a list of server configuration. Is either a + ConfigurationListResult type or a IO type. Required. :type value: ~azure.mgmt.rdbms.postgresql.models.ConfigurationListResult or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_security_alert_policies_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_security_alert_policies_operations.py index f46cffd8bd74..48c08d3d4af3 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_security_alert_policies_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_security_alert_policies_operations.py @@ -305,8 +305,8 @@ async def begin_create_or_update( :param security_alert_policy_name: The name of the threat detection policy. "Default" Required. :type security_alert_policy_name: str or ~azure.mgmt.rdbms.postgresql.models.SecurityAlertPolicyName - :param parameters: The server security alert policy. Is either a model type or a IO type. - Required. + :param parameters: The server security alert policy. Is either a ServerSecurityAlertPolicy type + or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.ServerSecurityAlertPolicy or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_servers_operations.py index 3a05c7312bdb..4457ecb24d45 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_servers_operations.py @@ -217,8 +217,8 @@ async def begin_create( :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param parameters: The required parameters for creating or updating a server. Is either a model - type or a IO type. Required. + :param parameters: The required parameters for creating or updating a server. Is either a + ServerForCreate type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.ServerForCreate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -442,8 +442,8 @@ async def begin_update( :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param parameters: The required parameters for updating a server. Is either a model type or a - IO type. Required. + :param parameters: The required parameters for updating a server. Is either a + ServerUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.ServerUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_virtual_network_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_virtual_network_rules_operations.py index a786830950fa..ea974413173f 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_virtual_network_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_virtual_network_rules_operations.py @@ -301,8 +301,8 @@ async def begin_create_or_update( :type server_name: str :param virtual_network_rule_name: The name of the virtual network rule. Required. :type virtual_network_rule_name: str - :param parameters: The requested virtual Network Rule Resource state. Is either a model type or - a IO type. Required. + :param parameters: The requested virtual Network Rule Resource state. Is either a + VirtualNetworkRule type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.VirtualNetworkRule or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/_models_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/_models_py3.py index 651bb2dc2b24..5edfa653d88a 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/_models_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/_models_py3.py @@ -9,7 +9,7 @@ import datetime import sys -from typing import Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from .. import _serialization @@ -50,7 +50,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 @@ -59,7 +59,8 @@ def __init__(self, **kwargs): class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. Variables are only populated by the server, and will be ignored when sending a request. @@ -85,7 +86,7 @@ class ProxyResource(Resource): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -139,7 +140,7 @@ class Configuration(ProxyResource): "source": {"key": "properties.source", "type": "str"}, } - def __init__(self, *, value: Optional[str] = None, source: Optional[str] = None, **kwargs): + def __init__(self, *, value: Optional[str] = None, source: Optional[str] = None, **kwargs: Any) -> None: """ :keyword value: Value of the configuration. :paramtype value: str @@ -166,7 +167,7 @@ class ConfigurationListResult(_serialization.Model): "value": {"key": "value", "type": "[Configuration]"}, } - def __init__(self, *, value: Optional[List["_models.Configuration"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.Configuration"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of server configurations. :paramtype value: list[~azure.mgmt.rdbms.postgresql.models.Configuration] @@ -208,7 +209,7 @@ class Database(ProxyResource): "collation": {"key": "properties.collation", "type": "str"}, } - def __init__(self, *, charset: Optional[str] = None, collation: Optional[str] = None, **kwargs): + def __init__(self, *, charset: Optional[str] = None, collation: Optional[str] = None, **kwargs: Any) -> None: """ :keyword charset: The charset of the database. :paramtype charset: str @@ -231,7 +232,7 @@ class DatabaseListResult(_serialization.Model): "value": {"key": "value", "type": "[Database]"}, } - def __init__(self, *, value: Optional[List["_models.Database"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.Database"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of databases housed in a server. :paramtype value: list[~azure.mgmt.rdbms.postgresql.models.Database] @@ -261,7 +262,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 @@ -269,7 +270,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.). Variables are only populated by the server, and will be ignored when sending a request. @@ -301,7 +303,7 @@ class ErrorResponse(_serialization.Model): "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -356,7 +358,7 @@ class FirewallRule(ProxyResource): "end_ip_address": {"key": "properties.endIpAddress", "type": "str"}, } - def __init__(self, *, start_ip_address: str, end_ip_address: str, **kwargs): + def __init__(self, *, start_ip_address: str, end_ip_address: str, **kwargs: Any) -> None: """ :keyword start_ip_address: The start IP address of the server firewall rule. Must be IPv4 format. Required. @@ -381,7 +383,7 @@ class FirewallRuleListResult(_serialization.Model): "value": {"key": "value", "type": "[FirewallRule]"}, } - def __init__(self, *, value: Optional[List["_models.FirewallRule"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.FirewallRule"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of firewall rules in a server. :paramtype value: list[~azure.mgmt.rdbms.postgresql.models.FirewallRule] @@ -440,8 +442,8 @@ def __init__( size_in_kb: Optional[int] = None, type_properties_type: Optional[str] = None, url: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword size_in_kb: Size of the log file. :paramtype size_in_kb: int @@ -469,7 +471,7 @@ class LogFileListResult(_serialization.Model): "value": {"key": "value", "type": "[LogFile]"}, } - def __init__(self, *, value: Optional[List["_models.LogFile"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.LogFile"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of log files. :paramtype value: list[~azure.mgmt.rdbms.postgresql.models.LogFile] @@ -501,8 +503,8 @@ def __init__( message: Optional[str] = None, name_available: Optional[bool] = None, reason: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword message: Error Message. :paramtype message: str @@ -537,7 +539,7 @@ class NameAvailabilityRequest(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, name: str, type: Optional[str] = None, **kwargs): + def __init__(self, *, name: str, type: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Resource name to verify. Required. :paramtype name: str @@ -579,7 +581,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 @@ -617,7 +619,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 @@ -637,7 +639,7 @@ class OperationListResult(_serialization.Model): "value": {"key": "value", "type": "[Operation]"}, } - def __init__(self, *, value: Optional[List["_models.Operation"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.Operation"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of resource provider operations. :paramtype value: list[~azure.mgmt.rdbms.postgresql.models.Operation] @@ -657,7 +659,7 @@ class PerformanceTierListResult(_serialization.Model): "value": {"key": "value", "type": "[PerformanceTierProperties]"}, } - def __init__(self, *, value: Optional[List["_models.PerformanceTierProperties"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.PerformanceTierProperties"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of performance tiers. :paramtype value: list[~azure.mgmt.rdbms.postgresql.models.PerformanceTierProperties] @@ -715,8 +717,8 @@ def __init__( max_large_storage_mb: Optional[int] = None, min_storage_mb: Optional[int] = None, service_level_objectives: Optional[List["_models.PerformanceTierServiceLevelObjectives"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: ID of the performance tier. :paramtype id: str @@ -795,8 +797,8 @@ def __init__( min_backup_retention_days: Optional[int] = None, max_storage_mb: Optional[int] = None, min_storage_mb: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: ID for the service level objective. :paramtype id: str @@ -875,8 +877,8 @@ def __init__( *, private_endpoint: Optional["_models.PrivateEndpointProperty"] = None, private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionStateProperty"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword private_endpoint: Private endpoint which the connection belongs to. :paramtype private_endpoint: ~azure.mgmt.rdbms.postgresql.models.PrivateEndpointProperty @@ -912,7 +914,7 @@ class PrivateEndpointConnectionListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -930,7 +932,7 @@ class PrivateEndpointProperty(_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 of the private endpoint. :paramtype id: str @@ -970,7 +972,7 @@ class PrivateLinkResource(ProxyResource): "properties": {"key": "properties", "type": "PrivateLinkResourceProperties"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.properties = None @@ -997,7 +999,7 @@ class PrivateLinkResourceListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1025,7 +1027,7 @@ class PrivateLinkResourceProperties(_serialization.Model): "required_members": {"key": "requiredMembers", "type": "[str]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.group_id = None @@ -1059,7 +1061,7 @@ class PrivateLinkServiceConnectionStateProperty(_serialization.Model): "actions_required": {"key": "actionsRequired", "type": "str"}, } - def __init__(self, *, status: str, description: str, **kwargs): + def __init__(self, *, status: str, description: str, **kwargs: Any) -> None: """ :keyword status: The private link service connection status. Required. :paramtype status: str @@ -1123,7 +1125,7 @@ class RecoverableServerResource(ProxyResource): "version": {"key": "properties.version", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.last_available_backup_date_time = None @@ -1159,7 +1161,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. "SystemAssigned" @@ -1172,7 +1174,8 @@ def __init__(self, *, type: Optional[Union[str, "_models.IdentityType"]] = None, class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. @@ -1207,7 +1210,7 @@ class TrackedResource(Resource): "location": {"key": "location", "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 tags: Resource tags. :paramtype tags: dict[str, str] @@ -1343,8 +1346,8 @@ def __init__( master_server_id: Optional[str] = None, replica_capacity: Optional[int] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccessEnum"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -1458,8 +1461,8 @@ def __init__( login: Optional[str] = None, sid: Optional[str] = None, tenant_id: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword administrator_type: The type of administrator. Default value is "ActiveDirectory". :paramtype administrator_type: str @@ -1488,7 +1491,7 @@ class ServerAdministratorResourceListResult(_serialization.Model): "value": {"key": "value", "type": "[ServerAdministratorResource]"}, } - def __init__(self, *, value: Optional[List["_models.ServerAdministratorResource"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.ServerAdministratorResource"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of server Active Directory Administrators for the server. :paramtype value: list[~azure.mgmt.rdbms.postgresql.models.ServerAdministratorResource] @@ -1535,8 +1538,8 @@ def __init__( identity: Optional["_models.ResourceIdentity"] = None, sku: Optional["_models.Sku"] = None, tags: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword identity: The Azure Active Directory identity of the server. :paramtype identity: ~azure.mgmt.rdbms.postgresql.models.ResourceIdentity @@ -1603,8 +1606,8 @@ def __init__( *, server_key_type: Optional[Union[str, "_models.ServerKeyType"]] = None, uri: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword server_key_type: The key type like 'AzureKeyVault'. "AzureKeyVault" :paramtype server_key_type: str or ~azure.mgmt.rdbms.postgresql.models.ServerKeyType @@ -1639,7 +1642,7 @@ class ServerKeyListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1657,7 +1660,7 @@ class ServerListResult(_serialization.Model): "value": {"key": "value", "type": "[Server]"}, } - def __init__(self, *, value: Optional[List["_models.Server"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.Server"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of servers. :paramtype value: list[~azure.mgmt.rdbms.postgresql.models.Server] @@ -1688,7 +1691,7 @@ class ServerPrivateEndpointConnection(_serialization.Model): "properties": {"key": "properties", "type": "ServerPrivateEndpointConnectionProperties"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -1732,8 +1735,8 @@ def __init__( private_link_service_connection_state: Optional[ "_models.ServerPrivateLinkServiceConnectionStateProperty" ] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword private_endpoint: Private endpoint which the connection belongs to. :paramtype private_endpoint: ~azure.mgmt.rdbms.postgresql.models.PrivateEndpointProperty @@ -1779,8 +1782,8 @@ class ServerPrivateLinkServiceConnectionStateProperty(_serialization.Model): } def __init__( - self, *, status: Union[str, "_models.PrivateLinkServiceConnectionStateStatus"], description: str, **kwargs - ): + self, *, status: Union[str, "_models.PrivateLinkServiceConnectionStateStatus"], description: str, **kwargs: Any + ) -> None: """ :keyword status: The private link service connection status. Required. Known values are: "Approved", "Pending", "Rejected", and "Disconnected". @@ -1860,8 +1863,8 @@ def __init__( infrastructure_encryption: Optional[Union[str, "_models.InfrastructureEncryption"]] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccessEnum"]] = None, storage_profile: Optional["_models.StorageProfile"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword version: Server version. Known values are: "9.5", "9.6", "10", "10.0", "10.2", and "11". @@ -1958,8 +1961,8 @@ def __init__( infrastructure_encryption: Optional[Union[str, "_models.InfrastructureEncryption"]] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccessEnum"]] = None, storage_profile: Optional["_models.StorageProfile"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword version: Server version. Known values are: "9.5", "9.6", "10", "10.0", "10.2", and "11". @@ -2003,7 +2006,8 @@ def __init__( class ServerPropertiesForGeoRestore(ServerPropertiesForCreate): - """The properties used to create a new server by restoring to a different region from a geo replicated backup. + """The properties used to create a new server by restoring to a different region from a geo + replicated backup. All required parameters must be populated in order to send to Azure. @@ -2059,8 +2063,8 @@ def __init__( infrastructure_encryption: Optional[Union[str, "_models.InfrastructureEncryption"]] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccessEnum"]] = None, storage_profile: Optional["_models.StorageProfile"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword version: Server version. Known values are: "9.5", "9.6", "10", "10.0", "10.2", and "11". @@ -2156,8 +2160,8 @@ def __init__( infrastructure_encryption: Optional[Union[str, "_models.InfrastructureEncryption"]] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccessEnum"]] = None, storage_profile: Optional["_models.StorageProfile"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword version: Server version. Known values are: "9.5", "9.6", "10", "10.0", "10.2", and "11". @@ -2259,8 +2263,8 @@ def __init__( infrastructure_encryption: Optional[Union[str, "_models.InfrastructureEncryption"]] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccessEnum"]] = None, storage_profile: Optional["_models.StorageProfile"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword version: Server version. Known values are: "9.5", "9.6", "10", "10.0", "10.2", and "11". @@ -2366,8 +2370,8 @@ def __init__( storage_endpoint: Optional[str] = None, storage_account_access_key: Optional[str] = None, retention_days: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword state: Specifies the state of the policy, whether it is enabled or disabled. Known values are: "Enabled" and "Disabled". @@ -2421,7 +2425,7 @@ class ServerSecurityAlertPolicyListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -2485,8 +2489,8 @@ def __init__( minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersionEnum"]] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccessEnum"]] = None, replication_role: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword identity: The Azure Active Directory identity of the server. :paramtype identity: ~azure.mgmt.rdbms.postgresql.models.ResourceIdentity @@ -2569,8 +2573,8 @@ def __init__( capacity: Optional[int] = None, size: Optional[str] = None, family: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8. Required. @@ -2621,8 +2625,8 @@ def __init__( geo_redundant_backup: Optional[Union[str, "_models.GeoRedundantBackup"]] = None, storage_mb: Optional[int] = None, storage_autogrow: Optional[Union[str, "_models.StorageAutogrow"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword backup_retention_days: Backup retention days for the server. :paramtype backup_retention_days: int @@ -2653,7 +2657,7 @@ class TagsObject(_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] @@ -2706,8 +2710,8 @@ def __init__( *, virtual_network_subnet_id: Optional[str] = None, ignore_missing_vnet_service_endpoint: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword virtual_network_subnet_id: The ARM resource id of the virtual network subnet. :paramtype virtual_network_subnet_id: str @@ -2742,7 +2746,7 @@ class VirtualNetworkRuleListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/_postgre_sql_management_client_enums.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/_postgre_sql_management_client_enums.py index c8bad2807ea2..44018f641cae 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/_postgre_sql_management_client_enums.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/_postgre_sql_management_client_enums.py @@ -40,10 +40,10 @@ class InfrastructureEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): 'Enabled'. """ - #: Default value for single layer of encryption for data at rest. ENABLED = "Enabled" - #: Additional (2nd) layer of encryption for data at rest + """Default value for single layer of encryption for data at rest.""" DISABLED = "Disabled" + """Additional (2nd) layer of encryption for data at rest""" class MinimalTlsVersionEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_check_name_availability_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_check_name_availability_operations.py index eb2d8c9192a6..0cbbb40fcdb4 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_check_name_availability_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_check_name_availability_operations.py @@ -134,7 +134,7 @@ def execute( """Check the availability of name for resource. :param name_availability_request: The required parameters for checking if resource name is - available. Is either a model type or a IO type. Required. + available. Is either a NameAvailabilityRequest type or a IO type. Required. :type name_availability_request: ~azure.mgmt.rdbms.postgresql.models.NameAvailabilityRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_configurations_operations.py index 47cb47914d90..0158a339ed87 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_configurations_operations.py @@ -332,7 +332,7 @@ def begin_create_or_update( :param configuration_name: The name of the server configuration. Required. :type configuration_name: str :param parameters: The required parameters for updating a server configuration. Is either a - model type or a IO type. Required. + Configuration type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.Configuration or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_databases_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_databases_operations.py index a00107332d22..d2c3b6d58a19 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_databases_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_databases_operations.py @@ -367,7 +367,7 @@ def begin_create_or_update( :param database_name: The name of the database. Required. :type database_name: str :param parameters: The required parameters for creating or updating a database. Is either a - model type or a IO type. Required. + Database type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.Database or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_firewall_rules_operations.py index 8a57b8ef5c94..db05433c55d0 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_firewall_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_firewall_rules_operations.py @@ -369,7 +369,7 @@ def begin_create_or_update( :param firewall_rule_name: The name of the server firewall rule. Required. :type firewall_rule_name: str :param parameters: The required parameters for creating or updating a firewall rule. Is either - a model type or a IO type. Required. + a FirewallRule type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.FirewallRule or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_private_endpoint_connections_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_private_endpoint_connections_operations.py index adb0e82f5fd4..94bc77edc934 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_private_endpoint_connections_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_private_endpoint_connections_operations.py @@ -494,7 +494,7 @@ def begin_create_or_update( :type server_name: str :param private_endpoint_connection_name: Required. :type private_endpoint_connection_name: str - :param parameters: Is either a model type or a IO type. Required. + :param parameters: Is either a PrivateEndpointConnection type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -853,7 +853,7 @@ def begin_update_tags( :param private_endpoint_connection_name: Required. :type private_endpoint_connection_name: str :param parameters: Parameters supplied to the Update private endpoint connection Tags - operation. Is either a model type or a IO type. Required. + operation. Is either a TagsObject type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.TagsObject or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_administrators_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_administrators_operations.py index ec55a34e80a5..7441a4499bf7 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_administrators_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_administrators_operations.py @@ -418,7 +418,7 @@ def begin_create_or_update( :param server_name: The name of the server. Required. :type server_name: str :param properties: The required parameters for creating or updating an AAD server - administrator. Is either a model type or a IO type. Required. + administrator. Is either a ServerAdministratorResource type or a IO type. Required. :type properties: ~azure.mgmt.rdbms.postgresql.models.ServerAdministratorResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_keys_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_keys_operations.py index d0dd1a7c02c1..6b479ab91578 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_keys_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_keys_operations.py @@ -507,8 +507,8 @@ def begin_create_or_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameters: The requested PostgreSQL Server key resource state. Is either a model type - or a IO type. Required. + :param parameters: The requested PostgreSQL Server key resource state. Is either a ServerKey + type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.ServerKey or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_parameters_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_parameters_operations.py index e47690bb0330..4bb46b31b1dc 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_parameters_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_parameters_operations.py @@ -253,8 +253,8 @@ def begin_list_update_configurations( :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param value: The parameters for updating a list of server configuration. Is either a model - type or a IO type. Required. + :param value: The parameters for updating a list of server configuration. Is either a + ConfigurationListResult type or a IO type. Required. :type value: ~azure.mgmt.rdbms.postgresql.models.ConfigurationListResult or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_security_alert_policies_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_security_alert_policies_operations.py index 47480166b0af..1bb5ee20890b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_security_alert_policies_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_security_alert_policies_operations.py @@ -415,8 +415,8 @@ def begin_create_or_update( :param security_alert_policy_name: The name of the threat detection policy. "Default" Required. :type security_alert_policy_name: str or ~azure.mgmt.rdbms.postgresql.models.SecurityAlertPolicyName - :param parameters: The server security alert policy. Is either a model type or a IO type. - Required. + :param parameters: The server security alert policy. Is either a ServerSecurityAlertPolicy type + or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.ServerSecurityAlertPolicy or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_servers_operations.py index 4da53ce26bdf..4994ff1a8378 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_servers_operations.py @@ -432,8 +432,8 @@ def begin_create( :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param parameters: The required parameters for creating or updating a server. Is either a model - type or a IO type. Required. + :param parameters: The required parameters for creating or updating a server. Is either a + ServerForCreate type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.ServerForCreate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -654,8 +654,8 @@ def begin_update( :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param parameters: The required parameters for updating a server. Is either a model type or a - IO type. Required. + :param parameters: The required parameters for updating a server. Is either a + ServerUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.ServerUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_virtual_network_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_virtual_network_rules_operations.py index 5489daf85076..41a5c761fd7c 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_virtual_network_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_virtual_network_rules_operations.py @@ -428,8 +428,8 @@ def begin_create_or_update( :type server_name: str :param virtual_network_rule_name: The name of the virtual network rule. Required. :type virtual_network_rule_name: str - :param parameters: The requested virtual Network Rule Resource state. Is either a model type or - a IO type. Required. + :param parameters: The requested virtual Network Rule Resource state. Is either a + VirtualNetworkRule type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql.models.VirtualNetworkRule or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_postgre_sql_management_client.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_postgre_sql_management_client.py index bf44da76f947..4daed4ac7671 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_postgre_sql_management_client.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_postgre_sql_management_client.py @@ -158,5 +158,5 @@ def __enter__(self) -> "PostgreSQLManagementClient": 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/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_serialization.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_serialization.py index 2c170e28dbca..f17c068e833e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_serialization.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_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/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_vendor.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_vendor.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_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/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_version.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_version.py index 5bd83bce19de..e5754a47ce68 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_version.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "10.2.0b6" +VERSION = "1.0.0b1" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/_postgre_sql_management_client.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/_postgre_sql_management_client.py index d5e142e8dc54..2151afd9f6e0 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/_postgre_sql_management_client.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/_postgre_sql_management_client.py @@ -160,5 +160,5 @@ async def __aenter__(self) -> "PostgreSQLManagementClient": 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/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_administrators_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_administrators_operations.py index 038a858bd00a..07a6d1a2cd87 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_administrators_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_administrators_operations.py @@ -247,7 +247,7 @@ async def begin_create( :param object_id: Guid of the objectId for the administrator. Required. :type object_id: str :param parameters: The required parameters for adding an active directory administrator for a - server. Is either a model type or a IO type. Required. + server. Is either a ActiveDirectoryAdministratorAdd type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ActiveDirectoryAdministratorAdd or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_operations.py index b0af7b2d1391..b146eff9635b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_operations.py @@ -103,7 +103,7 @@ async def execute( """Check the availability of name for resource. :param name_availability_request: The required parameters for checking if resource name is - available. Is either a model type or a IO type. Required. + available. Is either a CheckNameAvailabilityRequest type or a IO type. Required. :type name_availability_request: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.CheckNameAvailabilityRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_with_location_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_with_location_operations.py index 8fa983851167..346b88ef6aa1 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_with_location_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_with_location_operations.py @@ -118,7 +118,7 @@ async def execute( :param location_name: The name of the location. Required. :type location_name: str :param name_availability_request: The required parameters for checking if resource name is - available. Is either a model type or a IO type. Required. + available. Is either a CheckNameAvailabilityRequest type or a IO type. Required. :type name_availability_request: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.CheckNameAvailabilityRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_configurations_operations.py index 29864bb3643a..809237940704 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_configurations_operations.py @@ -407,7 +407,7 @@ async def begin_update( :param configuration_name: The name of the server configuration. Required. :type configuration_name: str :param parameters: The required parameters for updating a server configuration. Is either a - model type or a IO type. Required. + ConfigurationForUpdate type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ConfigurationForUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -660,7 +660,7 @@ async def begin_put( :param configuration_name: The name of the server configuration. Required. :type configuration_name: str :param parameters: The required parameters for updating a server configuration. Is either a - model type or a IO type. Required. + Configuration type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Configuration or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_databases_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_databases_operations.py index c85e46472c78..1e79f9d17e69 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_databases_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_databases_operations.py @@ -244,7 +244,7 @@ async def begin_create( :param database_name: The name of the database. Required. :type database_name: str :param parameters: The required parameters for creating or updating a database. Is either a - model type or a IO type. Required. + Database type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Database or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_firewall_rules_operations.py index 8158f9364bea..eea68a623c17 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_firewall_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_firewall_rules_operations.py @@ -244,7 +244,7 @@ async def begin_create_or_update( :param firewall_rule_name: The name of the server firewall rule. Required. :type firewall_rule_name: str :param parameters: The required parameters for creating or updating a firewall rule. Is either - a model type or a IO type. Required. + a FirewallRule type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.FirewallRule or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_servers_operations.py index 6c865438a1ad..8b1f3030e28e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_servers_operations.py @@ -229,8 +229,8 @@ async def begin_create( :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param parameters: The required parameters for creating or updating a server. Is either a model - type or a IO type. Required. + :param parameters: The required parameters for creating or updating a server. Is either a + Server type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Server or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -461,8 +461,8 @@ async def begin_update( :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param parameters: The required parameters for updating a server. Is either a model type or a - IO type. Required. + :param parameters: The required parameters for updating a server. Is either a ServerForUpdate + type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerForUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1048,8 +1048,8 @@ async def begin_restart( :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param parameters: The parameters for restarting a server. Is either a model type or a IO type. - Default value is None. + :param parameters: The parameters for restarting a server. Is either a RestartParameter type or + a IO type. Default value is None. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.RestartParameter or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_virtual_network_subnet_usage_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_virtual_network_subnet_usage_operations.py index e829d72deb5e..42ed0824c13b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_virtual_network_subnet_usage_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_virtual_network_subnet_usage_operations.py @@ -107,8 +107,8 @@ async def execute( :param location_name: The name of the location. Required. :type location_name: str - :param parameters: The required parameters for creating or updating a server. Is either a model - type or a IO type. Required. + :param parameters: The required parameters for creating or updating a server. Is either a + VirtualNetworkSubnetUsageParameter type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.VirtualNetworkSubnetUsageParameter or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models_py3.py index 4186efeadf78..f4d7bd7a1281 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/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 @@ -49,7 +49,7 @@ class Resource(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -59,7 +59,8 @@ def __init__(self, **kwargs): class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. Variables are only populated by the server, and will be ignored when sending a request. @@ -90,7 +91,7 @@ class ProxyResource(Resource): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -148,8 +149,8 @@ def __init__( principal_name: Optional[str] = None, object_id: Optional[str] = None, tenant_id: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword principal_type: The principal type used to represent the type of Active Directory Administrator. Known values are: "Unknown", "User", "Group", and "ServicePrincipal". @@ -194,8 +195,8 @@ def __init__( principal_type: Optional[Union[str, "_models.PrincipalType"]] = None, principal_name: Optional[str] = None, tenant_id: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword principal_type: The principal type used to represent the type of Active Directory Administrator. Known values are: "Unknown", "User", "Group", and "ServicePrincipal". @@ -232,8 +233,8 @@ def __init__( *, value: Optional[List["_models.ActiveDirectoryAdministrator"]] = None, next_link: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: The list of active directory administrators. :paramtype value: @@ -273,8 +274,8 @@ def __init__( active_directory_auth: Optional[Union[str, "_models.ActiveDirectoryAuthEnum"]] = None, password_auth: Union[str, "_models.PasswordAuthEnum"] = "Enabled", tenant_id: str = "", - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword active_directory_auth: If Enabled, Azure Active Directory authentication is enabled. Known values are: "Enabled" and "Disabled". @@ -323,8 +324,8 @@ def __init__( *, backup_retention_days: int = 7, geo_redundant_backup: Union[str, "_models.GeoRedundantBackupEnum"] = "Disabled", - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword backup_retention_days: Backup retention days for the server. :paramtype backup_retention_days: int @@ -360,7 +361,7 @@ class CapabilitiesListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -436,7 +437,7 @@ class CapabilityProperties(_serialization.Model): "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.zone = None @@ -465,7 +466,7 @@ class CheckNameAvailabilityRequest(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: The name of the resource for which availability needs to be checked. :paramtype name: str @@ -502,8 +503,8 @@ def __init__( name_available: Optional[bool] = None, reason: Optional[Union[str, "_models.CheckNameAvailabilityReason"]] = None, message: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name_available: Indicates if the resource name is available. :paramtype name_available: bool @@ -596,7 +597,7 @@ class Configuration(ProxyResource): # pylint: disable=too-many-instance-attribu "documentation_link": {"key": "properties.documentationLink", "type": "str"}, } - def __init__(self, *, value: Optional[str] = None, source: Optional[str] = None, **kwargs): + def __init__(self, *, value: Optional[str] = None, source: Optional[str] = None, **kwargs: Any) -> None: """ :keyword value: Value of the configuration. :paramtype value: str @@ -674,7 +675,7 @@ class ConfigurationForUpdate(_serialization.Model): # pylint: disable=too-many- "documentation_link": {"key": "properties.documentationLink", "type": "str"}, } - def __init__(self, *, value: Optional[str] = None, source: Optional[str] = None, **kwargs): + def __init__(self, *, value: Optional[str] = None, source: Optional[str] = None, **kwargs: Any) -> None: """ :keyword value: Value of the configuration. :paramtype value: str @@ -710,8 +711,8 @@ class ConfigurationListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.Configuration"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, *, value: Optional[List["_models.Configuration"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: The list of server configurations. :paramtype value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Configuration] @@ -763,7 +764,7 @@ class Database(ProxyResource): "collation": {"key": "properties.collation", "type": "str"}, } - def __init__(self, *, charset: Optional[str] = None, collation: Optional[str] = None, **kwargs): + def __init__(self, *, charset: Optional[str] = None, collation: Optional[str] = None, **kwargs: Any) -> None: """ :keyword charset: The charset of the database. :paramtype charset: str @@ -789,7 +790,9 @@ class DatabaseListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Database"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.Database"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: The list of databases housed in a server. :paramtype value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Database] @@ -826,8 +829,8 @@ def __init__( primary_key_uri: Optional[str] = None, primary_user_assigned_identity_id: Optional[str] = None, type: Optional[Union[str, "_models.ArmServerKeyType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword primary_key_uri: URI for the key for data encryption for primary server. :paramtype primary_key_uri: str @@ -865,7 +868,7 @@ class DelegatedSubnetUsage(_serialization.Model): "usage": {"key": "usage", "type": "int"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.subnet_name = None @@ -893,7 +896,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 @@ -934,7 +937,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 @@ -945,7 +948,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.rdbms.postgresql_flexibleservers.models.ErrorDetail @@ -955,7 +959,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.rdbms.postgresql_flexibleservers.models.ErrorDetail @@ -989,7 +993,7 @@ class FastProvisioningEditionCapability(_serialization.Model): "supported_server_versions": {"key": "supportedServerVersions", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.supported_sku = None @@ -1047,7 +1051,7 @@ class FirewallRule(ProxyResource): "end_ip_address": {"key": "properties.endIpAddress", "type": "str"}, } - def __init__(self, *, start_ip_address: str, end_ip_address: str, **kwargs): + def __init__(self, *, start_ip_address: str, end_ip_address: str, **kwargs: Any) -> None: """ :keyword start_ip_address: The start IP address of the server firewall rule. Must be IPv4 format. Required. @@ -1076,8 +1080,8 @@ class FirewallRuleListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.FirewallRule"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, *, value: Optional[List["_models.FirewallRule"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: The list of firewall rules in a server. :paramtype value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.FirewallRule] @@ -1120,7 +1124,7 @@ class FlexibleServerEditionCapability(_serialization.Model): "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -1159,8 +1163,8 @@ def __init__( *, mode: Union[str, "_models.HighAvailabilityMode"] = "Disabled", standby_availability_zone: str = "", - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword mode: The HA mode for the server. Known values are: "Disabled", "ZoneRedundant", and "SameZone". @@ -1211,7 +1215,7 @@ class HyperscaleNodeEditionCapability(_serialization.Model): "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -1248,8 +1252,8 @@ def __init__( start_hour: int = 0, start_minute: int = 0, day_of_week: int = 0, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword custom_window: indicates whether custom window is enabled or disabled. :paramtype custom_window: str @@ -1305,8 +1309,8 @@ def __init__( name_available: Optional[bool] = None, reason: Optional[Union[str, "_models.CheckNameAvailabilityReason"]] = None, message: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name_available: Indicates if the resource name is available. :paramtype name_available: bool @@ -1347,7 +1351,9 @@ class Network(_serialization.Model): "private_dns_zone_arm_resource_id": {"key": "privateDnsZoneArmResourceId", "type": "str"}, } - def __init__(self, *, delegated_subnet_resource_id: str = "", private_dns_zone_arm_resource_id: str = "", **kwargs): + def __init__( + self, *, delegated_subnet_resource_id: str = "", private_dns_zone_arm_resource_id: str = "", **kwargs: Any + ) -> None: """ :keyword delegated_subnet_resource_id: delegated subnet arm resource id. :paramtype delegated_subnet_resource_id: str @@ -1385,7 +1391,7 @@ class NodeTypeCapability(_serialization.Model): "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -1426,7 +1432,7 @@ class Operation(_serialization.Model): "properties": {"key": "properties", "type": "{object}"}, } - def __init__(self, *, is_data_action: Optional[bool] = None, **kwargs): + def __init__(self, *, is_data_action: Optional[bool] = None, **kwargs: Any) -> None: """ :keyword is_data_action: Indicates whether the operation is a data action. :paramtype is_data_action: bool @@ -1468,7 +1474,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 @@ -1492,7 +1498,9 @@ class OperationListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Operation"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.Operation"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Collection of available operation details. :paramtype value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Operation] @@ -1525,8 +1533,8 @@ def __init__( *, restart_with_failover: Optional[bool] = None, failover_mode: Optional[Union[str, "_models.FailoverMode"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword restart_with_failover: Indicates whether to restart the server with failover. :paramtype restart_with_failover: bool @@ -1541,7 +1549,8 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. @@ -1581,7 +1590,7 @@ class TrackedResource(Resource): "location": {"key": "location", "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 tags: Resource tags. :paramtype tags: dict[str, str] @@ -1734,8 +1743,8 @@ def __init__( # pylint: disable=too-many-locals replication_role: Optional[Union[str, "_models.ReplicationRole"]] = None, replica_capacity: Optional[int] = None, create_mode: Optional[Union[str, "_models.CreateMode"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -1859,8 +1868,8 @@ def __init__( backup_type: Optional[Union[str, "_models.Origin"]] = None, completed_time: Optional[datetime.datetime] = None, source: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword backup_type: Backup type. "Full" :paramtype backup_type: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Origin @@ -1890,8 +1899,8 @@ class ServerBackupListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.ServerBackup"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, *, value: Optional[List["_models.ServerBackup"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: The list of backups of a server. :paramtype value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerBackup] @@ -1973,8 +1982,8 @@ def __init__( data_encryption: Optional["_models.DataEncryption"] = None, create_mode: Optional[Union[str, "_models.CreateModeForUpdate"]] = None, replication_role: Optional[Union[str, "_models.ReplicationRole"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword sku: The SKU (pricing tier) of the server. :paramtype sku: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Sku @@ -2040,7 +2049,9 @@ class ServerListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Server"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.Server"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: The list of flexible servers. :paramtype value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Server] @@ -2082,7 +2093,7 @@ class ServerVersionCapability(_serialization.Model): "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -2114,7 +2125,7 @@ class Sku(_serialization.Model): "tier": {"key": "tier", "type": "str"}, } - def __init__(self, *, name: str, tier: Union[str, "_models.SkuTier"], **kwargs): + def __init__(self, *, name: str, tier: Union[str, "_models.SkuTier"], **kwargs: Any) -> None: """ :keyword name: The name of the sku, typically, tier + family + cores, e.g. Standard_D4s_v3. Required. @@ -2139,7 +2150,7 @@ class Storage(_serialization.Model): "storage_size_gb": {"key": "storageSizeGB", "type": "int"}, } - def __init__(self, *, storage_size_gb: Optional[int] = None, **kwargs): + def __init__(self, *, storage_size_gb: Optional[int] = None, **kwargs: Any) -> None: """ :keyword storage_size_gb: Max storage allowed for a server. :paramtype storage_size_gb: int @@ -2174,7 +2185,7 @@ class StorageEditionCapability(_serialization.Model): "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -2216,7 +2227,7 @@ class StorageMBCapability(_serialization.Model): "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -2259,7 +2270,7 @@ class StorageTierCapability(_serialization.Model): "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -2308,8 +2319,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 @@ -2365,8 +2376,8 @@ def __init__( *, type: Union[str, "_models.IdentityType"], user_assigned_identities: Optional[Dict[str, "_models.UserIdentity"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword user_assigned_identities: represents user assigned identities map. :paramtype user_assigned_identities: dict[str, @@ -2396,7 +2407,7 @@ class UserIdentity(_serialization.Model): "client_id": {"key": "clientId", "type": "str"}, } - def __init__(self, *, principal_id: Optional[str] = None, client_id: Optional[str] = None, **kwargs): + def __init__(self, *, principal_id: Optional[str] = None, client_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword principal_id: the object identifier of the Service Principal which this identity represents. @@ -2443,7 +2454,7 @@ class VcoreCapability(_serialization.Model): "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -2464,7 +2475,7 @@ class VirtualNetworkSubnetUsageParameter(_serialization.Model): "virtual_network_arm_resource_id": {"key": "virtualNetworkArmResourceId", "type": "str"}, } - def __init__(self, *, virtual_network_arm_resource_id: Optional[str] = None, **kwargs): + def __init__(self, *, virtual_network_arm_resource_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword virtual_network_arm_resource_id: Virtual network resource id. :paramtype virtual_network_arm_resource_id: str @@ -2499,7 +2510,7 @@ class VirtualNetworkSubnetUsageResult(_serialization.Model): "subscription_id": {"key": "subscriptionId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.delegated_subnets_usage = None diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_administrators_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_administrators_operations.py index c525040aa161..d9ef48b5cde5 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_administrators_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_administrators_operations.py @@ -64,7 +64,7 @@ def build_create_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), "objectId": _SERIALIZER.url("object_id", object_id, "str"), } @@ -102,7 +102,7 @@ def build_delete_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), "objectId": _SERIALIZER.url("object_id", object_id, "str"), } @@ -138,7 +138,7 @@ def build_get_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), "objectId": _SERIALIZER.url("object_id", object_id, "str"), } @@ -174,7 +174,7 @@ def build_list_by_server_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), } @@ -390,7 +390,7 @@ def begin_create( :param object_id: Guid of the objectId for the administrator. Required. :type object_id: str :param parameters: The required parameters for adding an active directory administrator for a - server. Is either a model type or a IO type. Required. + server. Is either a ActiveDirectoryAdministratorAdd type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ActiveDirectoryAdministratorAdd or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_backups_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_backups_operations.py index cd672a889a53..ed08409bdf56 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_backups_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_backups_operations.py @@ -61,7 +61,7 @@ def build_get_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), "backupName": _SERIALIZER.url("backup_name", backup_name, "str", min_length=1, pattern=r"^[-\w\._]+$"), } @@ -97,7 +97,7 @@ def build_list_by_server_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), } diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_operations.py index 074bbed526ad..e9cba48667d9 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_operations.py @@ -135,7 +135,7 @@ def execute( """Check the availability of name for resource. :param name_availability_request: The required parameters for checking if resource name is - available. Is either a model type or a IO type. Required. + available. Is either a CheckNameAvailabilityRequest type or a IO type. Required. :type name_availability_request: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.CheckNameAvailabilityRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_with_location_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_with_location_operations.py index 643573cf9f1a..d4e76dcc4548 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_with_location_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_with_location_operations.py @@ -152,7 +152,7 @@ def execute( :param location_name: The name of the location. Required. :type location_name: str :param name_availability_request: The required parameters for checking if resource name is - available. Is either a model type or a IO type. Required. + available. Is either a CheckNameAvailabilityRequest type or a IO type. Required. :type name_availability_request: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.CheckNameAvailabilityRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_configurations_operations.py index 49f56989c212..f2a724f4328e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_configurations_operations.py @@ -63,7 +63,7 @@ def build_list_by_server_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), } @@ -98,7 +98,7 @@ def build_get_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), "configurationName": _SERIALIZER.url( "configuration_name", configuration_name, "str", min_length=1, pattern=r"^[-\w\._]+$" @@ -137,7 +137,7 @@ def build_update_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), "configurationName": _SERIALIZER.url( "configuration_name", configuration_name, "str", min_length=1, pattern=r"^[-\w\._]+$" @@ -178,7 +178,7 @@ def build_put_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), "configurationName": _SERIALIZER.url( "configuration_name", configuration_name, "str", min_length=1, pattern=r"^[-\w\._]+$" @@ -559,7 +559,7 @@ def begin_update( :param configuration_name: The name of the server configuration. Required. :type configuration_name: str :param parameters: The required parameters for updating a server configuration. Is either a - model type or a IO type. Required. + ConfigurationForUpdate type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ConfigurationForUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -811,7 +811,7 @@ def begin_put( :param configuration_name: The name of the server configuration. Required. :type configuration_name: str :param parameters: The required parameters for updating a server configuration. Is either a - model type or a IO type. Required. + Configuration type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Configuration or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_databases_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_databases_operations.py index 89983c81e280..0e8b1bb597b8 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_databases_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_databases_operations.py @@ -64,7 +64,7 @@ def build_create_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), "databaseName": _SERIALIZER.url("database_name", database_name, "str", min_length=1, pattern=r"^[-\w\._]+$"), } @@ -102,7 +102,7 @@ def build_delete_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), "databaseName": _SERIALIZER.url("database_name", database_name, "str", min_length=1, pattern=r"^[-\w\._]+$"), } @@ -138,7 +138,7 @@ def build_get_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), "databaseName": _SERIALIZER.url("database_name", database_name, "str", min_length=1, pattern=r"^[-\w\._]+$"), } @@ -174,7 +174,7 @@ def build_list_by_server_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), } @@ -385,7 +385,7 @@ def begin_create( :param database_name: The name of the database. Required. :type database_name: str :param parameters: The required parameters for creating or updating a database. Is either a - model type or a IO type. Required. + Database type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Database or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_firewall_rules_operations.py index 5d9de41bdcbe..e3794a1b7388 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_firewall_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_firewall_rules_operations.py @@ -64,7 +64,7 @@ def build_create_or_update_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), "firewallRuleName": _SERIALIZER.url( "firewall_rule_name", firewall_rule_name, "str", min_length=1, pattern=r"^[-\w\._]+$" @@ -104,7 +104,7 @@ def build_delete_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), "firewallRuleName": _SERIALIZER.url( "firewall_rule_name", firewall_rule_name, "str", min_length=1, pattern=r"^[-\w\._]+$" @@ -142,7 +142,7 @@ def build_get_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), "firewallRuleName": _SERIALIZER.url( "firewall_rule_name", firewall_rule_name, "str", min_length=1, pattern=r"^[-\w\._]+$" @@ -180,7 +180,7 @@ def build_list_by_server_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), } @@ -393,7 +393,7 @@ def begin_create_or_update( :param firewall_rule_name: The name of the server firewall rule. Required. :type firewall_rule_name: str :param parameters: The required parameters for creating or updating a firewall rule. Is either - a model type or a IO type. Required. + a FirewallRule type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.FirewallRule or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_replicas_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_replicas_operations.py index 808ea385865c..e992c84eb8af 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_replicas_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_replicas_operations.py @@ -61,7 +61,7 @@ def build_list_by_server_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), } diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_servers_operations.py index d0dcfd5ff318..bcae27d9bede 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_servers_operations.py @@ -64,7 +64,7 @@ def build_create_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), } @@ -102,7 +102,7 @@ def build_update_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), } @@ -139,7 +139,7 @@ def build_delete_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), } @@ -172,7 +172,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), } @@ -264,7 +264,7 @@ def build_restart_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), } @@ -299,7 +299,7 @@ def build_start_request(resource_group_name: str, server_name: str, subscription "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), } @@ -332,7 +332,7 @@ def build_stop_request(resource_group_name: str, server_name: str, subscription_ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "server_name", server_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*" ), } @@ -523,8 +523,8 @@ def begin_create( :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param parameters: The required parameters for creating or updating a server. Is either a model - type or a IO type. Required. + :param parameters: The required parameters for creating or updating a server. Is either a + Server type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Server or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -751,8 +751,8 @@ def begin_update( :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param parameters: The required parameters for updating a server. Is either a model type or a - IO type. Required. + :param parameters: The required parameters for updating a server. Is either a ServerForUpdate + type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerForUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1336,8 +1336,8 @@ def begin_restart( :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param parameters: The parameters for restarting a server. Is either a model type or a IO type. - Default value is None. + :param parameters: The parameters for restarting a server. Is either a RestartParameter type or + a IO type. Default value is None. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.RestartParameter or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_virtual_network_subnet_usage_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_virtual_network_subnet_usage_operations.py index 5ec9619c9c0c..e0c1cb1df268 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_virtual_network_subnet_usage_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_virtual_network_subnet_usage_operations.py @@ -141,8 +141,8 @@ def execute( :param location_name: The name of the location. Required. :type location_name: str - :param parameters: The required parameters for creating or updating a server. Is either a model - type or a IO type. Required. + :param parameters: The required parameters for creating or updating a server. Is either a + VirtualNetworkSubnetUsageParameter type or a IO type. Required. :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.VirtualNetworkSubnetUsageParameter or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.