From a2854c96c9cbc52f60882949d9ba8ca178993a93 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 4 Aug 2023 23:30:51 +0000 Subject: [PATCH] CodeGen from PR 24490 in Azure/azure-rest-api-specs AVS API 2023-03-01 (#24490) * cp -r 2022-05-01 2023-03-01 * set version as 2023-03-01 * changes * switch back to v1 ErrorResponse * must not use two differert ErrorResponse types * use v5 ErrorResponse (#4) * remove sku changes * #/definitions/Sku * remove old readme block * remove skus.json * add patterns for resource names ported from https://github.com/Azure/azure-rest-api-specs-pr/pull/11127 --- sdk/compute/azure-mgmt-avs/_meta.json | 10 +- .../azure/mgmt/avs/_avs_client.py | 6 +- .../azure/mgmt/avs/_configuration.py | 10 +- .../azure/mgmt/avs/_serialization.py | 119 ++- .../azure-mgmt-avs/azure/mgmt/avs/_vendor.py | 11 - .../azure-mgmt-avs/azure/mgmt/avs/_version.py | 2 +- .../azure/mgmt/avs/aio/_avs_client.py | 6 +- .../azure/mgmt/avs/aio/_configuration.py | 10 +- .../avs/aio/operations/_addons_operations.py | 58 +- .../operations/_authorizations_operations.py | 60 +- .../aio/operations/_cloud_links_operations.py | 58 +- .../aio/operations/_clusters_operations.py | 89 +- .../aio/operations/_datastores_operations.py | 60 +- .../_global_reach_connections_operations.py | 58 +- .../_hcx_enterprise_sites_operations.py | 76 +- .../aio/operations/_locations_operations.py | 32 +- .../mgmt/avs/aio/operations/_operations.py | 15 +- .../_placement_policies_operations.py | 78 +- .../operations/_private_clouds_operations.py | 126 ++- .../operations/_script_cmdlets_operations.py | 25 +- .../_script_executions_operations.py | 76 +- .../operations/_script_packages_operations.py | 25 +- .../_virtual_machines_operations.py | 44 +- .../_workload_networks_operations.py | 556 ++++++------ .../azure/mgmt/avs/models/__init__.py | 2 + .../azure/mgmt/avs/models/_models_py3.py | 356 +++++--- .../mgmt/avs/operations/_addons_operations.py | 88 +- .../operations/_authorizations_operations.py | 90 +- .../avs/operations/_cloud_links_operations.py | 88 +- .../avs/operations/_clusters_operations.py | 135 ++- .../avs/operations/_datastores_operations.py | 100 +-- .../_global_reach_connections_operations.py | 88 +- .../_hcx_enterprise_sites_operations.py | 112 +-- .../avs/operations/_locations_operations.py | 42 +- .../azure/mgmt/avs/operations/_operations.py | 17 +- .../_placement_policies_operations.py | 136 ++- .../operations/_private_clouds_operations.py | 178 ++-- .../operations/_script_cmdlets_operations.py | 49 +- .../_script_executions_operations.py | 122 +-- .../operations/_script_packages_operations.py | 43 +- .../_virtual_machines_operations.py | 70 +- .../_workload_networks_operations.py | 798 +++++++++--------- .../addons_create_or_update_arc_reg.py | 2 +- .../addons_create_or_update_hcx.py | 2 +- .../addons_create_or_update_srm.py | 2 +- .../addons_create_or_update_vr.py | 2 +- .../generated_samples/addons_delete.py | 5 +- .../generated_samples/addons_get_arc_reg.py | 2 +- .../generated_samples/addons_get_hcx.py | 2 +- .../generated_samples/addons_get_srm.py | 2 +- .../generated_samples/addons_get_vr.py | 2 +- .../generated_samples/addons_list.py | 2 +- .../authorizations_delete.py | 5 +- .../generated_samples/authorizations_get.py | 2 +- .../generated_samples/authorizations_list.py | 2 +- .../cloud_links_create_or_update.py | 2 +- .../generated_samples/cloud_links_delete.py | 5 +- .../generated_samples/cloud_links_get.py | 2 +- .../generated_samples/cloud_links_list.py | 2 +- .../clusters_create_or_update.py | 2 +- .../generated_samples/clusters_delete.py | 5 +- .../generated_samples/clusters_get.py | 2 +- .../generated_samples/clusters_list.py | 2 +- .../generated_samples/clusters_list_zones.py | 2 +- .../clusters_list_zones_stretched.py | 2 +- .../generated_samples/clusters_update.py | 2 +- .../datastores_create_or_update.py | 2 +- .../generated_samples/datastores_delete.py | 5 +- .../generated_samples/datastores_get.py | 2 +- .../generated_samples/datastores_list.py | 2 +- ...obal_reach_connections_create_or_update.py | 2 +- .../global_reach_connections_delete.py | 5 +- .../global_reach_connections_get.py | 2 +- .../global_reach_connections_list.py | 2 +- .../hcx_enterprise_sites_delete.py | 5 +- .../hcx_enterprise_sites_get.py | 2 +- .../hcx_enterprise_sites_list.py | 2 +- .../locations_check_quota_availability.py | 2 +- .../locations_check_trial_availability.py | 2 +- ...tions_check_trial_availability_with_sku.py | 2 +- .../generated_samples/operations_list.py | 2 +- .../placement_policies_create_or_update.py | 2 +- .../placement_policies_delete.py | 5 +- .../placement_policies_get.py | 2 +- .../placement_policies_list.py | 2 +- .../placement_policies_update.py | 2 +- .../private_clouds_create_or_update.py | 2 +- ...ivate_clouds_create_or_update_stretched.py | 2 +- .../private_clouds_delete.py | 5 +- .../generated_samples/private_clouds_get.py | 2 +- .../private_clouds_get_stretched.py | 2 +- .../generated_samples/private_clouds_list.py | 2 +- .../private_clouds_list_admin_credentials.py | 2 +- .../private_clouds_list_in_subscription.py | 2 +- ...e_clouds_list_in_subscription_stretched.py | 2 +- .../private_clouds_list_stretched.py | 2 +- .../private_clouds_rotate_nsxt_password.py | 5 +- .../private_clouds_rotate_vcenter_password.py | 5 +- .../private_clouds_update.py | 2 +- .../private_clouds_update_stretched.py | 2 +- .../generated_samples/script_cmdlets_get.py | 6 +- .../generated_samples/script_cmdlets_list.py | 6 +- .../script_executions_create_or_update.py | 2 +- .../script_executions_delete.py | 7 +- .../script_executions_get.py | 2 +- .../script_executions_get_execution_logs.py | 2 +- .../script_executions_list.py | 4 +- .../generated_samples/script_packages_get.py | 6 +- .../generated_samples/script_packages_list.py | 4 +- .../generated_samples/virtual_machines_get.py | 2 +- .../virtual_machines_list.py | 2 +- .../virtual_machines_restrict_movement.py | 5 +- ...oad_networks_create_dhcp_configurations.py | 2 +- .../workload_networks_create_dns_services.py | 2 +- .../workload_networks_create_dns_zones.py | 2 +- ...networks_create_port_mirroring_profiles.py | 2 +- .../workload_networks_create_segments.py | 2 +- ... => workload_networks_create_vm_groups.py} | 17 +- ...oad_networks_delete_dhcp_configurations.py | 5 +- .../workload_networks_delete_dns_services.py | 5 +- .../workload_networks_delete_dns_zones.py | 5 +- ...networks_delete_port_mirroring_profiles.py | 5 +- .../workload_networks_delete_segments.py | 5 +- .../workload_networks_delete_vm_groups.py | 5 +- .../workload_networks_get.py | 2 +- ...rkload_networks_get_dhcp_configurations.py | 2 +- .../workload_networks_get_dns_services.py | 2 +- .../workload_networks_get_dns_zones.py | 2 +- .../workload_networks_get_gateway.py | 2 +- ...ad_networks_get_port_mirroring_profiles.py | 2 +- .../workload_networks_get_segments.py | 2 +- .../workload_networks_get_virtual_machine.py | 2 +- .../workload_networks_get_vm_groups.py | 2 +- .../workload_networks_list.py | 2 +- ...kload_networks_list_dhcp_configurations.py | 2 +- .../workload_networks_list_dns_services.py | 2 +- .../workload_networks_list_dns_zones.py | 2 +- .../workload_networks_list_gateways.py | 2 +- ...d_networks_list_port_mirroring_profiles.py | 2 +- .../workload_networks_list_public_ips.py | 2 +- .../workload_networks_list_segments.py | 2 +- ...workload_networks_list_virtual_machines.py | 2 +- .../workload_networks_list_vm_groups.py | 2 +- ...oad_networks_update_dhcp_configurations.py | 2 +- .../workload_networks_update_dns_services.py | 2 +- .../workload_networks_update_dns_zones.py | 2 +- ...networks_update_port_mirroring_profiles.py | 2 +- .../workload_networks_update_segments.py | 2 +- ... => workload_networks_update_vm_groups.py} | 9 +- 149 files changed, 2132 insertions(+), 2303 deletions(-) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_get_public_ips.py => workload_networks_create_vm_groups.py} (74%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_delete_public_ips.py => workload_networks_update_vm_groups.py} (80%) diff --git a/sdk/compute/azure-mgmt-avs/_meta.json b/sdk/compute/azure-mgmt-avs/_meta.json index db321681d8bb3..e1efcd429b493 100644 --- a/sdk/compute/azure-mgmt-avs/_meta.json +++ b/sdk/compute/azure-mgmt-avs/_meta.json @@ -1,11 +1,11 @@ { - "commit": "f38115ac455af89493b0a0719d9a987404560dda", + "commit": "0baf811c3c76c87b3c127d098519bd97141222dd", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.2", + "autorest": "3.9.7", "use": [ - "@autorest/python@6.2.7", - "@autorest/modelerfour@4.24.3" + "@autorest/python@6.7.1", + "@autorest/modelerfour@4.26.2" ], - "autorest_command": "autorest specification/vmware/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/vmware/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.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False", "readme": "specification/vmware/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py index ca034990e54b7..fcbdbea689162 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py @@ -80,7 +80,7 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-03-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -95,7 +95,7 @@ def __init__( **kwargs: Any ) -> None: self._config = AVSClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -159,5 +159,5 @@ def __enter__(self) -> "AVSClient": 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/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py index 3bc418737808f..f952ef5849133 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from ._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -35,14 +29,14 @@ class AVSClientConfiguration(Configuration): # pylint: disable=too-many-instanc :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-03-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(AVSClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", "2022-05-01") + api_version: str = kwargs.pop("api_version", "2023-03-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_serialization.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_serialization.py index 2c170e28dbca2..4bae2292227bd 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_serialization.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_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 @@ -602,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_desc.get("attr", False): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): @@ -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 @@ -636,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -656,8 +683,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: @@ -715,6 +742,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -723,10 +752,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get("skip_quote", False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -777,6 +804,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) @@ -863,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -875,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -922,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: @@ -1161,7 +1199,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 @@ -1242,7 +1281,7 @@ def _extract_name_from_internal_type(internal_type): xml_name = internal_type_xml_map.get("name", internal_type.__name__) xml_ns = internal_type_xml_map.get("ns", None) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) return xml_name @@ -1266,7 +1305,7 @@ def xml_key_extractor(attr, attr_desc, data): # Integrate namespace if necessary xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) # If it's an attribute, that's simple if xml_desc.get("attr", False): @@ -1332,7 +1371,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 +1391,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 +1510,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 +1525,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 +1535,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/compute/azure-mgmt-avs/azure/mgmt/avs/_vendor.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_vendor.py index 9aad73fc743e7..0dafe0e287ff1 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_vendor.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_vendor.py @@ -14,14 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_version.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_version.py index e74dc061df092..e5754a47ce68f 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_version.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "7.2.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_avs_client.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_avs_client.py index 414018dd1b32e..a1a6593adde56 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_avs_client.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_avs_client.py @@ -81,7 +81,7 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-03-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -96,7 +96,7 @@ def __init__( **kwargs: Any ) -> None: self._config = AVSClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -160,5 +160,5 @@ async def __aenter__(self) -> "AVSClient": 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/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_configuration.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_configuration.py index 4f440943bc654..465a98be5c5cd 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from .._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -35,14 +29,14 @@ class AVSClientConfiguration(Configuration): # pylint: disable=too-many-instanc :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-03-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(AVSClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", "2022-05-01") + api_version: str = kwargs.pop("api_version", "2023-03-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_addons_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_addons_operations.py index d7c75125e3363..556c4a345a316 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_addons_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_addons_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,10 +38,6 @@ build_list_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,9 +80,7 @@ def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AddonList] = kwargs.pop("cls", None) error_map = { @@ -140,14 +134,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -188,9 +184,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Addon] = kwargs.pop("cls", None) request = build_get_request( @@ -206,15 +200,17 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Addon", pipeline_response) @@ -246,16 +242,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Addon] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(addon, (IO, bytes)): + if isinstance(addon, (IOBase, bytes)): _content = addon else: _json = self._serialize.body(addon, "Addon") @@ -276,15 +270,17 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("Addon", pipeline_response) @@ -401,7 +397,7 @@ async def begin_create_or_update( :type private_cloud_name: str :param addon_name: Name of the addon for the private cloud. Required. :type addon_name: str - :param addon: A addon in the private cloud. Is either a model type or a IO type. Required. + :param addon: A addon in the private cloud. Is either a Addon type or a IO type. Required. :type addon: ~azure.mgmt.avs.models.Addon or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -421,9 +417,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Addon] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -483,9 +477,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -501,15 +493,17 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -548,9 +542,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_authorizations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_authorizations_operations.py index 61cef951253b1..6c49f83e664fe 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_authorizations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_authorizations_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,10 +38,6 @@ build_list_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,9 +84,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExpressRouteAuthorizationList] = kwargs.pop("cls", None) error_map = { @@ -144,14 +138,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -193,9 +189,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExpressRouteAuthorization] = kwargs.pop("cls", None) request = build_get_request( @@ -211,15 +205,17 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ExpressRouteAuthorization", pipeline_response) @@ -251,16 +247,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExpressRouteAuthorization] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(authorization, (IO, bytes)): + if isinstance(authorization, (IOBase, bytes)): _content = authorization else: _json = self._serialize.body(authorization, "ExpressRouteAuthorization") @@ -281,15 +275,17 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("ExpressRouteAuthorization", pipeline_response) @@ -411,8 +407,8 @@ async def begin_create_or_update( :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud. Required. :type authorization_name: str - :param authorization: An ExpressRoute Circuit Authorization. Is either a model type or a IO - type. Required. + :param authorization: An ExpressRoute Circuit Authorization. Is either a + ExpressRouteAuthorization type or a IO type. Required. :type authorization: ~azure.mgmt.avs.models.ExpressRouteAuthorization or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -433,9 +429,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExpressRouteAuthorization] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -495,9 +489,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -513,15 +505,17 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -561,9 +555,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_cloud_links_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_cloud_links_operations.py index 19a57bf4aedf7..ae37f5323999e 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_cloud_links_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_cloud_links_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,10 +38,6 @@ build_list_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,9 +82,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudLinkList] = kwargs.pop("cls", None) error_map = { @@ -142,14 +136,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -190,9 +186,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudLink] = kwargs.pop("cls", None) request = build_get_request( @@ -208,15 +202,17 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("CloudLink", pipeline_response) @@ -248,16 +244,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CloudLink] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(cloud_link, (IO, bytes)): + if isinstance(cloud_link, (IOBase, bytes)): _content = cloud_link else: _json = self._serialize.body(cloud_link, "CloudLink") @@ -278,15 +272,17 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("CloudLink", pipeline_response) @@ -405,7 +401,7 @@ async def begin_create_or_update( :type private_cloud_name: str :param cloud_link_name: Name of the cloud link resource. Required. :type cloud_link_name: str - :param cloud_link: A cloud link in the private cloud. Is either a model type or a IO type. + :param cloud_link: A cloud link in the private cloud. Is either a CloudLink type or a IO type. Required. :type cloud_link: ~azure.mgmt.avs.models.CloudLink or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -427,9 +423,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CloudLink] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -489,9 +483,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -507,15 +499,17 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -554,9 +548,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_clusters_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_clusters_operations.py index 1c6457ec4ea14..28cdd40a4fac5 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_clusters_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_clusters_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,10 +40,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,9 +84,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) error_map = { @@ -144,14 +138,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -192,9 +188,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) request = build_get_request( @@ -210,15 +204,17 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Cluster", pipeline_response) @@ -250,16 +246,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(cluster, (IO, bytes)): + if isinstance(cluster, (IOBase, bytes)): _content = cluster else: _json = self._serialize.body(cluster, "Cluster") @@ -280,15 +274,17 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("Cluster", pipeline_response) @@ -407,7 +403,8 @@ async def begin_create_or_update( :type private_cloud_name: str :param cluster_name: Name of the cluster in the private cloud. Required. :type cluster_name: str - :param cluster: A cluster in the private cloud. Is either a model type or a IO type. Required. + :param cluster: A cluster in the private cloud. Is either a Cluster type or a IO type. + Required. :type cluster: ~azure.mgmt.avs.models.Cluster or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -428,9 +425,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -495,16 +490,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(cluster_update, (IO, bytes)): + if isinstance(cluster_update, (IOBase, bytes)): _content = cluster_update else: _json = self._serialize.body(cluster_update, "ClusterUpdate") @@ -525,15 +518,17 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("Cluster", pipeline_response) @@ -652,8 +647,8 @@ async def begin_update( :type private_cloud_name: str :param cluster_name: Name of the cluster in the private cloud. Required. :type cluster_name: str - :param cluster_update: The cluster properties to be updated. Is either a model type or a IO - type. Required. + :param cluster_update: The cluster properties to be updated. Is either a ClusterUpdate type or + a IO type. Required. :type cluster_update: ~azure.mgmt.avs.models.ClusterUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -674,9 +669,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -736,9 +729,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -754,15 +745,17 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -801,9 +794,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -875,9 +866,7 @@ async def list_zones( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ClusterZoneList] = kwargs.pop("cls", None) request = build_list_zones_request( @@ -893,15 +882,17 @@ async def list_zones( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ClusterZoneList", pipeline_response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_datastores_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_datastores_operations.py index b9e6e0d1f73ae..1390fac19a753 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_datastores_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_datastores_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,10 +38,6 @@ build_list_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,9 +84,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatastoreList] = kwargs.pop("cls", None) error_map = { @@ -145,14 +139,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -195,9 +191,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Datastore] = kwargs.pop("cls", None) request = build_get_request( @@ -214,15 +208,17 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Datastore", pipeline_response) @@ -255,16 +251,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Datastore] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(datastore, (IO, bytes)): + if isinstance(datastore, (IOBase, bytes)): _content = datastore else: _json = self._serialize.body(datastore, "Datastore") @@ -286,15 +280,17 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("Datastore", pipeline_response) @@ -422,8 +418,8 @@ async def begin_create_or_update( :type cluster_name: str :param datastore_name: Name of the datastore in the private cloud cluster. Required. :type datastore_name: str - :param datastore: A datastore in a private cloud cluster. Is either a model type or a IO type. - Required. + :param datastore: A datastore in a private cloud cluster. Is either a Datastore type or a IO + type. Required. :type datastore: ~azure.mgmt.avs.models.Datastore or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -444,9 +440,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Datastore] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -507,9 +501,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -526,15 +518,17 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -575,9 +569,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_global_reach_connections_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_global_reach_connections_operations.py index 6206ce0b29aa4..67f28bdf28ba4 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_global_reach_connections_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_global_reach_connections_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,10 +38,6 @@ build_list_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,9 +83,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GlobalReachConnectionList] = kwargs.pop("cls", None) error_map = { @@ -143,14 +137,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -192,9 +188,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GlobalReachConnection] = kwargs.pop("cls", None) request = build_get_request( @@ -210,15 +204,17 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("GlobalReachConnection", pipeline_response) @@ -250,16 +246,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.GlobalReachConnection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(global_reach_connection, (IO, bytes)): + if isinstance(global_reach_connection, (IOBase, bytes)): _content = global_reach_connection else: _json = self._serialize.body(global_reach_connection, "GlobalReachConnection") @@ -280,15 +274,17 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("GlobalReachConnection", pipeline_response) @@ -411,7 +407,7 @@ async def begin_create_or_update( Required. :type global_reach_connection_name: str :param global_reach_connection: A global reach connection in the private cloud. Is either a - model type or a IO type. Required. + GlobalReachConnection type or a IO type. Required. :type global_reach_connection: ~azure.mgmt.avs.models.GlobalReachConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -432,9 +428,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.GlobalReachConnection] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -494,9 +488,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -512,15 +504,17 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -560,9 +554,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hcx_enterprise_sites_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hcx_enterprise_sites_operations.py index 5fd2c4a44133d..bc50ec7a61ee4 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hcx_enterprise_sites_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hcx_enterprise_sites_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -36,10 +36,6 @@ build_list_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,9 +63,9 @@ def __init__(self, *args, **kwargs) -> None: def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterable["_models.HcxEnterpriseSite"]: - """List HCX Enterprise Sites in a private cloud. + """List HCX on-premises key in a private cloud. - List HCX Enterprise Sites in a private cloud. + List HCX on-premises key in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -84,9 +80,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.HcxEnterpriseSiteList] = kwargs.pop("cls", None) error_map = { @@ -140,14 +134,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -161,9 +157,9 @@ async def get_next(next_link=None): async def get( self, resource_group_name: str, private_cloud_name: str, hcx_enterprise_site_name: str, **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Get an HCX Enterprise Site by name in a private cloud. + """Get an HCX on-premises key by name in a private cloud. - Get an HCX Enterprise Site by name in a private cloud. + Get an HCX on-premises key by name in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -189,9 +185,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.HcxEnterpriseSite] = kwargs.pop("cls", None) request = build_get_request( @@ -207,15 +201,17 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("HcxEnterpriseSite", pipeline_response) @@ -239,9 +235,9 @@ async def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Create or update an HCX Enterprise Site in a private cloud. + """Create or update an activation key for on-premises HCX site. - Create or update an HCX Enterprise Site in a private cloud. + Create or update an activation key for on-premises HCX site. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -273,9 +269,9 @@ async def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Create or update an HCX Enterprise Site in a private cloud. + """Create or update an activation key for on-premises HCX site. - Create or update an HCX Enterprise Site in a private cloud. + Create or update an activation key for on-premises HCX site. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -305,9 +301,9 @@ async def create_or_update( hcx_enterprise_site: Union[_models.HcxEnterpriseSite, IO], **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Create or update an HCX Enterprise Site in a private cloud. + """Create or update an activation key for on-premises HCX site. - Create or update an HCX Enterprise Site in a private cloud. + Create or update an activation key for on-premises HCX site. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -317,8 +313,8 @@ async def create_or_update( :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud. Required. :type hcx_enterprise_site_name: str - :param hcx_enterprise_site: The HCX Enterprise Site. Is either a model type or a IO type. - Required. + :param hcx_enterprise_site: The HCX Enterprise Site. Is either a HcxEnterpriseSite type or a IO + type. Required. :type hcx_enterprise_site: ~azure.mgmt.avs.models.HcxEnterpriseSite or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -339,16 +335,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.HcxEnterpriseSite] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(hcx_enterprise_site, (IO, bytes)): + if isinstance(hcx_enterprise_site, (IOBase, bytes)): _content = hcx_enterprise_site else: _json = self._serialize.body(hcx_enterprise_site, "HcxEnterpriseSite") @@ -369,15 +363,17 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("HcxEnterpriseSite", pipeline_response) @@ -398,9 +394,9 @@ async def create_or_update( async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, private_cloud_name: str, hcx_enterprise_site_name: str, **kwargs: Any ) -> None: - """Delete an HCX Enterprise Site in a private cloud. + """Delete HCX on-premises key in a private cloud. - Delete an HCX Enterprise Site in a private cloud. + Delete HCX on-premises key in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -426,9 +422,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -444,15 +438,17 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_locations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_locations_operations.py index bcb460b0f9acb..6e2b77657110c 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_locations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_locations_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ build_check_trial_availability_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -104,8 +100,8 @@ async def check_trial_availability( :param location: Azure region. Required. :type location: str - :param sku: The sku to check for trial availability. Is either a model type or a IO type. - Default value is None. + :param sku: The sku to check for trial availability. Is either a Sku type or a IO type. Default + value is None. :type sku: ~azure.mgmt.avs.models.Sku or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -126,16 +122,14 @@ async def check_trial_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Trial] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(sku, (IO, bytes)): + if isinstance(sku, (IOBase, bytes)): _content = sku else: if sku is not None: @@ -157,15 +151,17 @@ async def check_trial_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Trial", pipeline_response) @@ -200,9 +196,7 @@ async def check_quota_availability(self, location: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Quota] = kwargs.pop("cls", None) request = build_check_quota_availability_request( @@ -216,15 +210,17 @@ async def check_quota_availability(self, location: str, **kwargs: Any) -> _model request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Quota", pipeline_response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_operations.py index 137dd156cc2b0..207d97cab96d3 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,9 +64,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) error_map = { @@ -122,14 +115,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_placement_policies_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_placement_policies_operations.py index 3ebb910596dae..6dbe790d4d557 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_placement_policies_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_placement_policies_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,10 +39,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,9 +85,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PlacementPoliciesList] = kwargs.pop("cls", None) error_map = { @@ -146,14 +140,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -202,9 +198,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PlacementPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -221,15 +215,17 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("PlacementPolicy", pipeline_response) @@ -262,16 +258,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PlacementPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(placement_policy, (IO, bytes)): + if isinstance(placement_policy, (IOBase, bytes)): _content = placement_policy else: _json = self._serialize.body(placement_policy, "PlacementPolicy") @@ -293,15 +287,17 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("PlacementPolicy", pipeline_response) @@ -432,8 +428,8 @@ async def begin_create_or_update( :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy. Required. :type placement_policy_name: str - :param placement_policy: A placement policy in the private cloud cluster. Is either a model - type or a IO type. Required. + :param placement_policy: A placement policy in the private cloud cluster. Is either a + PlacementPolicy type or a IO type. Required. :type placement_policy: ~azure.mgmt.avs.models.PlacementPolicy or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -454,9 +450,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PlacementPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -523,16 +517,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PlacementPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(placement_policy_update, (IO, bytes)): + if isinstance(placement_policy_update, (IOBase, bytes)): _content = placement_policy_update else: _json = self._serialize.body(placement_policy_update, "PlacementPolicyUpdate") @@ -554,15 +546,17 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("PlacementPolicy", pipeline_response) @@ -694,7 +688,7 @@ async def begin_update( placement policy. Required. :type placement_policy_name: str :param placement_policy_update: The placement policy properties that may be updated. Is either - a model type or a IO type. Required. + a PlacementPolicyUpdate type or a IO type. Required. :type placement_policy_update: ~azure.mgmt.avs.models.PlacementPolicyUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -715,9 +709,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PlacementPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -783,9 +775,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -802,15 +792,17 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -857,9 +849,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_private_clouds_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_private_clouds_operations.py index 89428c5f3f3bc..9c62783ef5013 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_private_clouds_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_private_clouds_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -43,10 +43,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,9 +83,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateCloudList] = kwargs.pop("cls", None) error_map = { @@ -142,14 +136,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -173,9 +169,7 @@ def list_in_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PrivateC _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateCloudList] = kwargs.pop("cls", None) error_map = { @@ -227,14 +221,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -269,9 +265,7 @@ async def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateCloud] = kwargs.pop("cls", None) request = build_get_request( @@ -286,15 +280,17 @@ async def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("PrivateCloud", pipeline_response) @@ -325,16 +321,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateCloud] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(private_cloud, (IO, bytes)): + if isinstance(private_cloud, (IOBase, bytes)): _content = private_cloud else: _json = self._serialize.body(private_cloud, "PrivateCloud") @@ -354,15 +348,17 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("PrivateCloud", pipeline_response) @@ -472,7 +468,7 @@ async def begin_create_or_update( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud: The private cloud. Is either a model type or a IO type. Required. + :param private_cloud: The private cloud. Is either a PrivateCloud type or a IO type. Required. :type private_cloud: ~azure.mgmt.avs.models.PrivateCloud or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -493,9 +489,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateCloud] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -558,16 +552,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateCloud] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(private_cloud_update, (IO, bytes)): + if isinstance(private_cloud_update, (IOBase, bytes)): _content = private_cloud_update else: _json = self._serialize.body(private_cloud_update, "PrivateCloudUpdate") @@ -587,15 +579,17 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("PrivateCloud", pipeline_response) @@ -705,8 +699,8 @@ async def begin_update( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud_update: The private cloud properties to be updated. Is either a model type - or a IO type. Required. + :param private_cloud_update: The private cloud properties to be updated. Is either a + PrivateCloudUpdate type or a IO type. Required. :type private_cloud_update: ~azure.mgmt.avs.models.PrivateCloudUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -727,9 +721,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateCloud] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -788,9 +780,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -805,15 +795,17 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -850,9 +842,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -906,9 +896,7 @@ async def _rotate_vcenter_password_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_rotate_vcenter_password_request( @@ -923,15 +911,17 @@ async def _rotate_vcenter_password_initial( # pylint: disable=inconsistent-retu request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -968,9 +958,7 @@ async def begin_rotate_vcenter_password( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1024,9 +1012,7 @@ async def _rotate_nsxt_password_initial( # pylint: disable=inconsistent-return- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_rotate_nsxt_password_request( @@ -1041,15 +1027,17 @@ async def _rotate_nsxt_password_initial( # pylint: disable=inconsistent-return- request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -1086,9 +1074,7 @@ async def begin_rotate_nsxt_password( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1157,9 +1143,7 @@ async def list_admin_credentials( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AdminCredentials] = kwargs.pop("cls", None) request = build_list_admin_credentials_request( @@ -1174,15 +1158,17 @@ async def list_admin_credentials( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("AdminCredentials", pipeline_response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_cmdlets_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_cmdlets_operations.py index 576b1831237b6..6533bde34e3b4 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_cmdlets_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_cmdlets_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -31,10 +30,6 @@ from ..._vendor import _convert_request from ...operations._script_cmdlets_operations import build_get_request, build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,9 +75,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptCmdletsList] = kwargs.pop("cls", None) error_map = { @@ -137,14 +130,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -191,9 +186,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptCmdlet] = kwargs.pop("cls", None) request = build_get_request( @@ -210,15 +203,17 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ScriptCmdlet", pipeline_response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_executions_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_executions_operations.py index 136823863ed2e..be773d15b42cc 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_executions_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_executions_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,10 +39,6 @@ build_list_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,9 +83,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptExecutionsList] = kwargs.pop("cls", None) error_map = { @@ -143,14 +137,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -191,9 +187,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptExecution] = kwargs.pop("cls", None) request = build_get_request( @@ -209,15 +203,17 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ScriptExecution", pipeline_response) @@ -249,16 +245,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ScriptExecution] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(script_execution, (IO, bytes)): + if isinstance(script_execution, (IOBase, bytes)): _content = script_execution else: _json = self._serialize.body(script_execution, "ScriptExecution") @@ -279,15 +273,17 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("ScriptExecution", pipeline_response) @@ -406,8 +402,8 @@ async def begin_create_or_update( :type private_cloud_name: str :param script_execution_name: Name of the user-invoked script execution resource. Required. :type script_execution_name: str - :param script_execution: A script running in the private cloud. Is either a model type or a IO - type. Required. + :param script_execution: A script running in the private cloud. Is either a ScriptExecution + type or a IO type. Required. :type script_execution: ~azure.mgmt.avs.models.ScriptExecution or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -428,9 +424,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ScriptExecution] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -490,9 +484,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -508,15 +500,17 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -555,9 +549,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -681,8 +673,8 @@ async def get_execution_logs( :param script_execution_name: Name of the user-invoked script execution resource. Required. :type script_execution_name: str :param script_output_stream_type: Name of the desired output stream to return. If not provided, - will return all. An empty array will return nothing. Is either a list type or a IO type. - Default value is None. + will return all. An empty array will return nothing. Is either a [Union[str, + "_models.ScriptOutputStreamType"]] type or a IO type. Default value is None. :type script_output_stream_type: list[str or ~azure.mgmt.avs.models.ScriptOutputStreamType] or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -704,16 +696,14 @@ async def get_execution_logs( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ScriptExecution] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(script_output_stream_type, (IO, bytes)): + if isinstance(script_output_stream_type, (IOBase, bytes)): _content = script_output_stream_type else: if script_output_stream_type is not None: @@ -737,15 +727,17 @@ async def get_execution_logs( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ScriptExecution", pipeline_response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_packages_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_packages_operations.py index a4d7735bbbe9f..67114362b10d5 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_packages_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_packages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -31,10 +30,6 @@ from ..._vendor import _convert_request from ...operations._script_packages_operations import build_get_request, build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,9 +72,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptPackagesList] = kwargs.pop("cls", None) error_map = { @@ -133,14 +126,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -179,9 +174,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptPackage] = kwargs.pop("cls", None) request = build_get_request( @@ -197,15 +190,17 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ScriptPackage", pipeline_response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_virtual_machines_operations.py index 130eed6f0e353..517da4f491f70 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_virtual_machines_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,10 +37,6 @@ build_restrict_movement_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,9 +83,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualMachinesList] = kwargs.pop("cls", None) error_map = { @@ -144,14 +138,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -199,9 +195,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualMachine] = kwargs.pop("cls", None) request = build_get_request( @@ -218,15 +212,17 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("VirtualMachine", pipeline_response) @@ -259,16 +255,14 @@ async def _restrict_movement_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(restrict_movement, (IO, bytes)): + if isinstance(restrict_movement, (IOBase, bytes)): _content = restrict_movement else: _json = self._serialize.body(restrict_movement, "VirtualMachineRestrictMovement") @@ -290,15 +284,17 @@ async def _restrict_movement_initial( # pylint: disable=inconsistent-return-sta request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -419,7 +415,7 @@ async def begin_restrict_movement( :param virtual_machine_id: Virtual Machine identifier. Required. :type virtual_machine_id: str :param restrict_movement: Whether VM DRS-driven movement is restricted (Enabled) or not - (Disabled). Is either a model type or a IO type. Required. + (Disabled). Is either a VirtualMachineRestrictMovement type or a IO type. Required. :type restrict_movement: ~azure.mgmt.avs.models.VirtualMachineRestrictMovement or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -439,9 +435,7 @@ async def begin_restrict_movement( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_workload_networks_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_workload_networks_operations.py index 054cf64fdcc2e..ad008bd9c6988 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_workload_networks_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_workload_networks_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -74,10 +74,6 @@ build_update_vm_group_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -137,9 +133,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetwork] = kwargs.pop("cls", None) request = build_get_request( @@ -155,15 +149,17 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetwork", pipeline_response) @@ -197,9 +193,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkList] = kwargs.pop("cls", None) error_map = { @@ -253,14 +247,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -292,9 +288,7 @@ def list_segments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkSegmentsList] = kwargs.pop("cls", None) error_map = { @@ -348,14 +342,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -397,9 +393,7 @@ async def get_segment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) request = build_get_segment_request( @@ -415,15 +409,17 @@ async def get_segment( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) @@ -455,16 +451,14 @@ async def _create_segments_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_segment, (IO, bytes)): + if isinstance(workload_network_segment, (IOBase, bytes)): _content = workload_network_segment else: _json = self._serialize.body(workload_network_segment, "WorkloadNetworkSegment") @@ -485,15 +479,17 @@ async def _create_segments_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) @@ -615,7 +611,8 @@ async def begin_create_segments( :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. Required. :type segment_id: str - :param workload_network_segment: NSX Segment. Is either a model type or a IO type. Required. + :param workload_network_segment: NSX Segment. Is either a WorkloadNetworkSegment type or a IO + type. Required. :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -636,9 +633,7 @@ async def begin_create_segments( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -703,16 +698,14 @@ async def _update_segments_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadNetworkSegment]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_segment, (IO, bytes)): + if isinstance(workload_network_segment, (IOBase, bytes)): _content = workload_network_segment else: _json = self._serialize.body(workload_network_segment, "WorkloadNetworkSegment") @@ -733,15 +726,17 @@ async def _update_segments_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -861,7 +856,8 @@ async def begin_update_segments( :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. Required. :type segment_id: str - :param workload_network_segment: NSX Segment. Is either a model type or a IO type. Required. + :param workload_network_segment: NSX Segment. Is either a WorkloadNetworkSegment type or a IO + type. Required. :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -882,9 +878,7 @@ async def begin_update_segments( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -944,9 +938,7 @@ async def _delete_segment_initial( # pylint: disable=inconsistent-return-statem _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_segment_request( @@ -962,15 +954,17 @@ async def _delete_segment_initial( # pylint: disable=inconsistent-return-statem request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -1010,9 +1004,7 @@ async def begin_delete_segment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1074,9 +1066,7 @@ def list_dhcp( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDhcpList] = kwargs.pop("cls", None) error_map = { @@ -1130,14 +1120,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1178,9 +1170,7 @@ async def get_dhcp( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) request = build_get_dhcp_request( @@ -1196,15 +1186,17 @@ async def get_dhcp( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) @@ -1236,16 +1228,14 @@ async def _create_dhcp_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dhcp, (IO, bytes)): + if isinstance(workload_network_dhcp, (IOBase, bytes)): _content = workload_network_dhcp else: _json = self._serialize.body(workload_network_dhcp, "WorkloadNetworkDhcp") @@ -1266,15 +1256,17 @@ async def _create_dhcp_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) @@ -1393,7 +1385,8 @@ async def begin_create_dhcp( :type private_cloud_name: str :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Is either a model type or a IO type. Required. + :param workload_network_dhcp: NSX DHCP. Is either a WorkloadNetworkDhcp type or a IO type. + Required. :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1414,9 +1407,7 @@ async def begin_create_dhcp( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1481,16 +1472,14 @@ async def _update_dhcp_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadNetworkDhcp]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dhcp, (IO, bytes)): + if isinstance(workload_network_dhcp, (IOBase, bytes)): _content = workload_network_dhcp else: _json = self._serialize.body(workload_network_dhcp, "WorkloadNetworkDhcp") @@ -1511,15 +1500,17 @@ async def _update_dhcp_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -1636,7 +1627,8 @@ async def begin_update_dhcp( :type private_cloud_name: str :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Is either a model type or a IO type. Required. + :param workload_network_dhcp: NSX DHCP. Is either a WorkloadNetworkDhcp type or a IO type. + Required. :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1657,9 +1649,7 @@ async def begin_update_dhcp( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1719,9 +1709,7 @@ async def _delete_dhcp_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_dhcp_request( @@ -1737,15 +1725,17 @@ async def _delete_dhcp_initial( # pylint: disable=inconsistent-return-statement request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -1784,9 +1774,7 @@ async def begin_delete_dhcp( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1849,9 +1837,7 @@ def list_gateways( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkGatewayList] = kwargs.pop("cls", None) error_map = { @@ -1905,14 +1891,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1954,9 +1942,7 @@ async def get_gateway( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkGateway] = kwargs.pop("cls", None) request = build_get_gateway_request( @@ -1972,15 +1958,17 @@ async def get_gateway( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkGateway", pipeline_response) @@ -2016,9 +2004,7 @@ def list_port_mirroring( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkPortMirroringList] = kwargs.pop("cls", None) error_map = { @@ -2072,14 +2058,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2121,9 +2109,7 @@ async def get_port_mirroring( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) request = build_get_port_mirroring_request( @@ -2139,15 +2125,17 @@ async def get_port_mirroring( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) @@ -2179,16 +2167,14 @@ async def _create_port_mirroring_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_port_mirroring, (IO, bytes)): + if isinstance(workload_network_port_mirroring, (IOBase, bytes)): _content = workload_network_port_mirroring else: _json = self._serialize.body(workload_network_port_mirroring, "WorkloadNetworkPortMirroring") @@ -2209,15 +2195,17 @@ async def _create_port_mirroring_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) @@ -2339,8 +2327,8 @@ async def begin_create_port_mirroring( :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. Required. :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Is either a model type or a IO - type. Required. + :param workload_network_port_mirroring: NSX port mirroring. Is either a + WorkloadNetworkPortMirroring type or a IO type. Required. :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -2362,9 +2350,7 @@ async def begin_create_port_mirroring( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2429,16 +2415,14 @@ async def _update_port_mirroring_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadNetworkPortMirroring]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_port_mirroring, (IO, bytes)): + if isinstance(workload_network_port_mirroring, (IOBase, bytes)): _content = workload_network_port_mirroring else: _json = self._serialize.body(workload_network_port_mirroring, "WorkloadNetworkPortMirroring") @@ -2459,15 +2443,17 @@ async def _update_port_mirroring_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -2587,8 +2573,8 @@ async def begin_update_port_mirroring( :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. Required. :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Is either a model type or a IO - type. Required. + :param workload_network_port_mirroring: NSX port mirroring. Is either a + WorkloadNetworkPortMirroring type or a IO type. Required. :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -2610,9 +2596,7 @@ async def begin_update_port_mirroring( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2672,9 +2656,7 @@ async def _delete_port_mirroring_initial( # pylint: disable=inconsistent-return _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_port_mirroring_request( @@ -2690,15 +2672,17 @@ async def _delete_port_mirroring_initial( # pylint: disable=inconsistent-return request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -2738,9 +2722,7 @@ async def begin_delete_port_mirroring( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2803,9 +2785,7 @@ def list_vm_groups( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkVMGroupsList] = kwargs.pop("cls", None) error_map = { @@ -2859,14 +2839,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2908,9 +2890,7 @@ async def get_vm_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) request = build_get_vm_group_request( @@ -2926,15 +2906,17 @@ async def get_vm_group( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) @@ -2966,16 +2948,14 @@ async def _create_vm_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_vm_group, (IO, bytes)): + if isinstance(workload_network_vm_group, (IOBase, bytes)): _content = workload_network_vm_group else: _json = self._serialize.body(workload_network_vm_group, "WorkloadNetworkVMGroup") @@ -2996,15 +2976,17 @@ async def _create_vm_group_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) @@ -3126,7 +3108,8 @@ async def begin_create_vm_group( :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. Required. :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Is either a model type or a IO type. Required. + :param workload_network_vm_group: NSX VM Group. Is either a WorkloadNetworkVMGroup type or a IO + type. Required. :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -3147,9 +3130,7 @@ async def begin_create_vm_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3214,16 +3195,14 @@ async def _update_vm_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadNetworkVMGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_vm_group, (IO, bytes)): + if isinstance(workload_network_vm_group, (IOBase, bytes)): _content = workload_network_vm_group else: _json = self._serialize.body(workload_network_vm_group, "WorkloadNetworkVMGroup") @@ -3244,15 +3223,17 @@ async def _update_vm_group_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -3372,7 +3353,8 @@ async def begin_update_vm_group( :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. Required. :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Is either a model type or a IO type. Required. + :param workload_network_vm_group: NSX VM Group. Is either a WorkloadNetworkVMGroup type or a IO + type. Required. :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -3393,9 +3375,7 @@ async def begin_update_vm_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3455,9 +3435,7 @@ async def _delete_vm_group_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_vm_group_request( @@ -3473,15 +3451,17 @@ async def _delete_vm_group_initial( # pylint: disable=inconsistent-return-state request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -3521,9 +3501,7 @@ async def begin_delete_vm_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3587,9 +3565,7 @@ def list_virtual_machines( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkVirtualMachinesList] = kwargs.pop("cls", None) error_map = { @@ -3643,14 +3619,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3691,9 +3669,7 @@ async def get_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkVirtualMachine] = kwargs.pop("cls", None) request = build_get_virtual_machine_request( @@ -3709,15 +3685,17 @@ async def get_virtual_machine( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkVirtualMachine", pipeline_response) @@ -3753,9 +3731,7 @@ def list_dns_services( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDnsServicesList] = kwargs.pop("cls", None) error_map = { @@ -3809,14 +3785,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3858,9 +3836,7 @@ async def get_dns_service( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) request = build_get_dns_service_request( @@ -3876,15 +3852,17 @@ async def get_dns_service( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) @@ -3916,16 +3894,14 @@ async def _create_dns_service_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dns_service, (IO, bytes)): + if isinstance(workload_network_dns_service, (IOBase, bytes)): _content = workload_network_dns_service else: _json = self._serialize.body(workload_network_dns_service, "WorkloadNetworkDnsService") @@ -3946,15 +3922,17 @@ async def _create_dns_service_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) @@ -4076,8 +4054,8 @@ async def begin_create_dns_service( :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's display name. Required. :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Is either a model type or a IO type. - Required. + :param workload_network_dns_service: NSX DNS Service. Is either a WorkloadNetworkDnsService + type or a IO type. Required. :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -4098,9 +4076,7 @@ async def begin_create_dns_service( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4165,16 +4141,14 @@ async def _update_dns_service_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadNetworkDnsService]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dns_service, (IO, bytes)): + if isinstance(workload_network_dns_service, (IOBase, bytes)): _content = workload_network_dns_service else: _json = self._serialize.body(workload_network_dns_service, "WorkloadNetworkDnsService") @@ -4195,15 +4169,17 @@ async def _update_dns_service_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -4323,8 +4299,8 @@ async def begin_update_dns_service( :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's display name. Required. :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Is either a model type or a IO type. - Required. + :param workload_network_dns_service: NSX DNS Service. Is either a WorkloadNetworkDnsService + type or a IO type. Required. :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -4345,9 +4321,7 @@ async def begin_update_dns_service( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4407,9 +4381,7 @@ async def _delete_dns_service_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_dns_service_request( @@ -4425,15 +4397,17 @@ async def _delete_dns_service_initial( # pylint: disable=inconsistent-return-st request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -4473,9 +4447,7 @@ async def begin_delete_dns_service( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4538,9 +4510,7 @@ def list_dns_zones( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDnsZonesList] = kwargs.pop("cls", None) error_map = { @@ -4594,14 +4564,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4643,9 +4615,7 @@ async def get_dns_zone( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) request = build_get_dns_zone_request( @@ -4661,15 +4631,17 @@ async def get_dns_zone( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) @@ -4701,16 +4673,14 @@ async def _create_dns_zone_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dns_zone, (IO, bytes)): + if isinstance(workload_network_dns_zone, (IOBase, bytes)): _content = workload_network_dns_zone else: _json = self._serialize.body(workload_network_dns_zone, "WorkloadNetworkDnsZone") @@ -4731,15 +4701,17 @@ async def _create_dns_zone_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) @@ -4861,7 +4833,8 @@ async def begin_create_dns_zone( :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. Required. :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Is either a model type or a IO type. Required. + :param workload_network_dns_zone: NSX DNS Zone. Is either a WorkloadNetworkDnsZone type or a IO + type. Required. :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -4882,9 +4855,7 @@ async def begin_create_dns_zone( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4949,16 +4920,14 @@ async def _update_dns_zone_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadNetworkDnsZone]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dns_zone, (IO, bytes)): + if isinstance(workload_network_dns_zone, (IOBase, bytes)): _content = workload_network_dns_zone else: _json = self._serialize.body(workload_network_dns_zone, "WorkloadNetworkDnsZone") @@ -4979,15 +4948,17 @@ async def _update_dns_zone_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -5107,7 +5078,8 @@ async def begin_update_dns_zone( :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. Required. :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Is either a model type or a IO type. Required. + :param workload_network_dns_zone: NSX DNS Zone. Is either a WorkloadNetworkDnsZone type or a IO + type. Required. :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -5128,9 +5100,7 @@ async def begin_update_dns_zone( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5190,9 +5160,7 @@ async def _delete_dns_zone_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_dns_zone_request( @@ -5208,15 +5176,17 @@ async def _delete_dns_zone_initial( # pylint: disable=inconsistent-return-state request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -5256,9 +5226,7 @@ async def begin_delete_dns_zone( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5321,9 +5289,7 @@ def list_public_i_ps( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkPublicIPsList] = kwargs.pop("cls", None) error_map = { @@ -5377,14 +5343,16 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -5426,9 +5394,7 @@ async def get_public_ip( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) request = build_get_public_ip_request( @@ -5444,15 +5410,17 @@ async def get_public_ip( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) @@ -5484,16 +5452,14 @@ async def _create_public_ip_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_public_ip, (IO, bytes)): + if isinstance(workload_network_public_ip, (IOBase, bytes)): _content = workload_network_public_ip else: _json = self._serialize.body(workload_network_public_ip, "WorkloadNetworkPublicIP") @@ -5514,15 +5480,17 @@ async def _create_public_ip_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) @@ -5644,8 +5612,8 @@ async def begin_create_public_ip( :param public_ip_id: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. Required. :type public_ip_id: str - :param workload_network_public_ip: NSX Public IP Block. Is either a model type or a IO type. - Required. + :param workload_network_public_ip: NSX Public IP Block. Is either a WorkloadNetworkPublicIP + type or a IO type. Required. :type workload_network_public_ip: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -5666,9 +5634,7 @@ async def begin_create_public_ip( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5728,9 +5694,7 @@ async def _delete_public_ip_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_public_ip_request( @@ -5746,15 +5710,17 @@ async def _delete_public_ip_initial( # pylint: disable=inconsistent-return-stat request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -5794,9 +5760,7 @@ async def begin_delete_public_ip( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py index 53e23c9ed17f7..3e1a3e5014b44 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py @@ -32,6 +32,7 @@ from ._models_py3 import EncryptionKeyVaultProperties from ._models_py3 import Endpoints from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse from ._models_py3 import ExpressRouteAuthorization from ._models_py3 import ExpressRouteAuthorizationList @@ -190,6 +191,7 @@ "EncryptionKeyVaultProperties", "Endpoints", "ErrorAdditionalInfo", + "ErrorDetail", "ErrorResponse", "ExpressRouteAuthorization", "ExpressRouteAuthorizationList", diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py index 09348c49ba5aa..dc1c5cf056899 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py @@ -48,7 +48,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 @@ -84,7 +84,7 @@ class Addon(Resource): "properties": {"key": "properties", "type": "AddonProperties"}, } - def __init__(self, *, properties: Optional["_models.AddonProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.AddonProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: The properties of an addon resource. :paramtype properties: ~azure.mgmt.avs.models.AddonProperties @@ -130,7 +130,7 @@ class AddonProperties(_serialization.Model): } } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.addon_type: Optional[str] = None @@ -165,7 +165,7 @@ class AddonArcProperties(AddonProperties): "v_center": {"key": "vCenter", "type": "str"}, } - def __init__(self, *, v_center: Optional[str] = None, **kwargs): + def __init__(self, *, v_center: Optional[str] = None, **kwargs: Any) -> None: """ :keyword v_center: The VMware vCenter resource ID. :paramtype v_center: str @@ -204,7 +204,7 @@ class AddonHcxProperties(AddonProperties): "offer": {"key": "offer", "type": "str"}, } - def __init__(self, *, offer: str, **kwargs): + def __init__(self, *, offer: str, **kwargs: Any) -> None: """ :keyword offer: The HCX offer, example VMware MaaS Cloud Provider (Enterprise). Required. :paramtype offer: str @@ -235,7 +235,7 @@ class AddonList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -270,7 +270,7 @@ class AddonSrmProperties(AddonProperties): "license_key": {"key": "licenseKey", "type": "str"}, } - def __init__(self, *, license_key: Optional[str] = None, **kwargs): + def __init__(self, *, license_key: Optional[str] = None, **kwargs: Any) -> None: """ :keyword license_key: The Site Recovery Manager (SRM) license. :paramtype license_key: str @@ -309,7 +309,7 @@ class AddonVrProperties(AddonProperties): "vrs_count": {"key": "vrsCount", "type": "int"}, } - def __init__(self, *, vrs_count: int, **kwargs): + def __init__(self, *, vrs_count: int, **kwargs: Any) -> None: """ :keyword vrs_count: The vSphere Replication Server (VRS) count. Required. :paramtype vrs_count: int @@ -348,7 +348,7 @@ class AdminCredentials(_serialization.Model): "vcenter_password": {"key": "vcenterPassword", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.nsxt_username = None @@ -381,8 +381,8 @@ def __init__( strategy: Optional[Union[str, "_models.AvailabilityStrategy"]] = None, zone: Optional[int] = None, secondary_zone: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword strategy: The availability strategy for the private cloud. Known values are: "SingleZone" and "DualZone". @@ -427,7 +427,7 @@ class Circuit(_serialization.Model): "express_route_private_peering_id": {"key": "expressRoutePrivatePeeringID", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.primary_subnet = None @@ -469,7 +469,7 @@ class CloudLink(Resource): "linked_cloud": {"key": "properties.linkedCloud", "type": "str"}, } - def __init__(self, *, linked_cloud: Optional[str] = None, **kwargs): + def __init__(self, *, linked_cloud: Optional[str] = None, **kwargs: Any) -> None: """ :keyword linked_cloud: Identifier of the other private cloud participating in the link. :paramtype linked_cloud: str @@ -500,7 +500,7 @@ class CloudLinkList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -554,8 +554,13 @@ class Cluster(Resource): } def __init__( - self, *, sku: "_models.Sku", cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, **kwargs - ): + self, + *, + sku: "_models.Sku", + cluster_size: Optional[int] = None, + hosts: Optional[List[str]] = None, + **kwargs: Any + ) -> None: """ :keyword sku: The cluster SKU. Required. :paramtype sku: ~azure.mgmt.avs.models.Sku @@ -593,7 +598,7 @@ class ClusterList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -628,7 +633,7 @@ class CommonClusterProperties(_serialization.Model): "hosts": {"key": "hosts", "type": "[str]"}, } - def __init__(self, *, cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, **kwargs): + def __init__(self, *, cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword cluster_size: The cluster size. :paramtype cluster_size: int @@ -670,7 +675,7 @@ class ClusterProperties(CommonClusterProperties): "hosts": {"key": "hosts", "type": "[str]"}, } - def __init__(self, *, cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, **kwargs): + def __init__(self, *, cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword cluster_size: The cluster size. :paramtype cluster_size: int @@ -694,7 +699,7 @@ class ClusterUpdate(_serialization.Model): "hosts": {"key": "properties.hosts", "type": "[str]"}, } - def __init__(self, *, cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, **kwargs): + def __init__(self, *, cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword cluster_size: The cluster size. :paramtype cluster_size: int @@ -727,7 +732,7 @@ class ClusterZone(_serialization.Model): "zone": {"key": "zone", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.hosts = None @@ -745,7 +750,7 @@ class ClusterZoneList(_serialization.Model): "zones": {"key": "zones", "type": "[ClusterZone]"}, } - def __init__(self, *, zones: Optional[List["_models.ClusterZone"]] = None, **kwargs): + def __init__(self, *, zones: Optional[List["_models.ClusterZone"]] = None, **kwargs: Any) -> None: """ :keyword zones: Zone and associated hosts info. :paramtype zones: list[~azure.mgmt.avs.models.ClusterZone] @@ -801,8 +806,8 @@ def __init__( *, net_app_volume: Optional["_models.NetAppVolume"] = None, disk_pool_volume: Optional["_models.DiskPoolVolume"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword net_app_volume: An Azure NetApp Files volume. :paramtype net_app_volume: ~azure.mgmt.avs.models.NetAppVolume @@ -837,7 +842,7 @@ class DatastoreList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -876,8 +881,13 @@ class DiskPoolVolume(_serialization.Model): } def __init__( - self, *, target_id: str, lun_name: str, mount_option: Union[str, "_models.MountOptionEnum"] = "MOUNT", **kwargs - ): + self, + *, + target_id: str, + lun_name: str, + mount_option: Union[str, "_models.MountOptionEnum"] = "MOUNT", + **kwargs: Any + ) -> None: """ :keyword target_id: Azure resource ID of the iSCSI target. Required. :paramtype target_id: str @@ -914,8 +924,8 @@ def __init__( *, status: Optional[Union[str, "_models.EncryptionState"]] = None, key_vault_properties: Optional["_models.EncryptionKeyVaultProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: Status of customer managed encryption key. Known values are: "Enabled" and "Disabled". @@ -970,8 +980,8 @@ def __init__( key_name: Optional[str] = None, key_version: Optional[str] = None, key_vault_url: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword key_name: The name of the key. :paramtype key_name: str @@ -1014,7 +1024,7 @@ class Endpoints(_serialization.Model): "hcx_cloud_manager": {"key": "hcxCloudManager", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.nsxt_manager = None @@ -1043,15 +1053,15 @@ 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 self.info = None -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.). +class ErrorDetail(_serialization.Model): + """The error detail. Variables are only populated by the server, and will be ignored when sending a request. @@ -1062,7 +1072,7 @@ class ErrorResponse(_serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~azure.mgmt.avs.models.ErrorResponse] + :vartype details: list[~azure.mgmt.avs.models.ErrorDetail] :ivar additional_info: The error additional info. :vartype additional_info: list[~azure.mgmt.avs.models.ErrorAdditionalInfo] """ @@ -1079,11 +1089,11 @@ class ErrorResponse(_serialization.Model): "code": {"key": "code", "type": "str"}, "message": {"key": "message", "type": "str"}, "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorResponse]"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -1093,6 +1103,27 @@ def __init__(self, **kwargs): self.additional_info = None +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.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.avs.models.ErrorDetail + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.avs.models.ErrorDetail + """ + super().__init__(**kwargs) + self.error = error + + class ExpressRouteAuthorization(Resource): """ExpressRoute Circuit Authorization. @@ -1135,7 +1166,7 @@ class ExpressRouteAuthorization(Resource): "express_route_id": {"key": "properties.expressRouteId", "type": "str"}, } - def __init__(self, *, express_route_id: Optional[str] = None, **kwargs): + def __init__(self, *, express_route_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword express_route_id: The ID of the ExpressRoute Circuit. :paramtype express_route_id: str @@ -1168,7 +1199,7 @@ class ExpressRouteAuthorizationList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1234,8 +1265,8 @@ def __init__( authorization_key: Optional[str] = None, peer_express_route_circuit: Optional[str] = None, express_route_id: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authorization_key: Authorization key from the peer express route used for the global reach connection. @@ -1277,7 +1308,7 @@ class GlobalReachConnectionList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1318,7 +1349,7 @@ class HcxEnterpriseSite(Resource): "status": {"key": "properties.status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.activation_key = None @@ -1346,7 +1377,7 @@ class HcxEnterpriseSiteList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1407,8 +1438,8 @@ def __init__( ssl: Optional[Union[str, "_models.SslEnum"]] = None, username: Optional[str] = None, password: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name of the identity source. :paramtype name: str @@ -1470,8 +1501,8 @@ def __init__( name: Optional[str] = None, display_name: Optional[str] = None, blob_duration: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Name of the log. :paramtype name: str @@ -1514,7 +1545,7 @@ class ManagementCluster(CommonClusterProperties): "hosts": {"key": "hosts", "type": "[str]"}, } - def __init__(self, *, cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, **kwargs): + def __init__(self, *, cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword cluster_size: The cluster size. :paramtype cluster_size: int @@ -1552,8 +1583,8 @@ def __init__( display_name: Optional[str] = None, internal_name: Optional[str] = None, to_be_exported_for_shoebox: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Name of the dimension. :paramtype name: str @@ -1638,8 +1669,8 @@ def __init__( enable_regional_mdm_account: Optional[str] = None, source_mdm_account: Optional[str] = None, source_mdm_namespace: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Name of the metric. :paramtype name: str @@ -1705,7 +1736,7 @@ class NetAppVolume(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, *, id: str, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Azure resource ID of the NetApp volume. Required. :paramtype id: str @@ -1751,8 +1782,8 @@ def __init__( is_data_action: Optional[bool] = None, origin: Optional[str] = None, properties: Optional["_models.OperationProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword is_data_action: Gets or sets a value indicating whether the operation is a data action or not. @@ -1799,7 +1830,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 @@ -1829,7 +1860,7 @@ class OperationList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1847,7 +1878,9 @@ class OperationProperties(_serialization.Model): "service_specification": {"key": "serviceSpecification", "type": "ServiceSpecification"}, } - def __init__(self, *, service_specification: Optional["_models.ServiceSpecification"] = None, **kwargs): + def __init__( + self, *, service_specification: Optional["_models.ServiceSpecification"] = None, **kwargs: Any + ) -> None: """ :keyword service_specification: Service specifications of the operation. :paramtype service_specification: ~azure.mgmt.avs.models.ServiceSpecification @@ -1877,7 +1910,7 @@ class PlacementPoliciesList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1912,7 +1945,7 @@ class PlacementPolicy(Resource): "properties": {"key": "properties", "type": "PlacementPolicyProperties"}, } - def __init__(self, *, properties: Optional["_models.PlacementPolicyProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.PlacementPolicyProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: placement policy properties. :paramtype properties: ~azure.mgmt.avs.models.PlacementPolicyProperties @@ -1962,8 +1995,8 @@ def __init__( *, state: Optional[Union[str, "_models.PlacementPolicyState"]] = None, display_name: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword state: Whether the placement policy is enabled or disabled. Known values are: "Enabled" and "Disabled". @@ -2012,8 +2045,8 @@ def __init__( host_members: Optional[List[str]] = None, affinity_strength: Optional[Union[str, "_models.AffinityStrength"]] = None, azure_hybrid_benefit_type: Optional[Union[str, "_models.AzureHybridBenefitType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword state: Whether the placement policy is enabled or disabled. Known values are: "Enabled" and "Disabled". @@ -2068,7 +2101,7 @@ class TrackedResource(Resource): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword location: Resource location. :paramtype location: str @@ -2113,6 +2146,10 @@ class PrivateCloud(TrackedResource): # pylint: disable=too-many-instance-attrib :vartype availability: ~azure.mgmt.avs.models.AvailabilityProperties :ivar encryption: Customer managed key encryption, can be enabled or disabled. :vartype encryption: ~azure.mgmt.avs.models.Encryption + :ivar extended_network_blocks: Array of additional networks noncontiguous with networkBlock. + Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and + this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). + :vartype extended_network_blocks: list[str] :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", "Cancelled", "Pending", "Building", "Deleting", "Updating", and "Canceled". :vartype provisioning_state: str or ~azure.mgmt.avs.models.PrivateCloudProvisioningState @@ -2181,6 +2218,7 @@ class PrivateCloud(TrackedResource): # pylint: disable=too-many-instance-attrib "identity_sources": {"key": "properties.identitySources", "type": "[IdentitySource]"}, "availability": {"key": "properties.availability", "type": "AvailabilityProperties"}, "encryption": {"key": "properties.encryption", "type": "Encryption"}, + "extended_network_blocks": {"key": "properties.extendedNetworkBlocks", "type": "[str]"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "circuit": {"key": "properties.circuit", "type": "Circuit"}, "endpoints": {"key": "properties.endpoints", "type": "Endpoints"}, @@ -2209,13 +2247,14 @@ def __init__( # pylint: disable=too-many-locals identity_sources: Optional[List["_models.IdentitySource"]] = None, availability: Optional["_models.AvailabilityProperties"] = None, encryption: Optional["_models.Encryption"] = None, + extended_network_blocks: Optional[List[str]] = None, circuit: Optional["_models.Circuit"] = None, network_block: Optional[str] = None, vcenter_password: Optional[str] = None, nsxt_password: Optional[str] = None, secondary_circuit: Optional["_models.Circuit"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: Resource location. :paramtype location: str @@ -2237,6 +2276,10 @@ def __init__( # pylint: disable=too-many-locals :paramtype availability: ~azure.mgmt.avs.models.AvailabilityProperties :keyword encryption: Customer managed key encryption, can be enabled or disabled. :paramtype encryption: ~azure.mgmt.avs.models.Encryption + :keyword extended_network_blocks: Array of additional networks noncontiguous with networkBlock. + Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and + this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). + :paramtype extended_network_blocks: list[str] :keyword circuit: An ExpressRoute Circuit. :paramtype circuit: ~azure.mgmt.avs.models.Circuit :keyword network_block: The block of addresses should be unique across VNet in your @@ -2261,6 +2304,7 @@ def __init__( # pylint: disable=too-many-locals self.identity_sources = identity_sources self.availability = availability self.encryption = encryption + self.extended_network_blocks = extended_network_blocks self.provisioning_state = None self.circuit = circuit self.endpoints = None @@ -2305,7 +2349,7 @@ class PrivateCloudIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, **kwargs): + def __init__(self, *, type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, **kwargs: Any) -> None: """ :keyword type: The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The type 'None' will remove any identities from the @@ -2339,7 +2383,7 @@ class PrivateCloudList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -2361,6 +2405,10 @@ class PrivateCloudUpdateProperties(_serialization.Model): :vartype availability: ~azure.mgmt.avs.models.AvailabilityProperties :ivar encryption: Customer managed key encryption, can be enabled or disabled. :vartype encryption: ~azure.mgmt.avs.models.Encryption + :ivar extended_network_blocks: Array of additional networks noncontiguous with networkBlock. + Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and + this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). + :vartype extended_network_blocks: list[str] """ _attribute_map = { @@ -2369,6 +2417,7 @@ class PrivateCloudUpdateProperties(_serialization.Model): "identity_sources": {"key": "identitySources", "type": "[IdentitySource]"}, "availability": {"key": "availability", "type": "AvailabilityProperties"}, "encryption": {"key": "encryption", "type": "Encryption"}, + "extended_network_blocks": {"key": "extendedNetworkBlocks", "type": "[str]"}, } def __init__( @@ -2379,8 +2428,9 @@ def __init__( identity_sources: Optional[List["_models.IdentitySource"]] = None, availability: Optional["_models.AvailabilityProperties"] = None, encryption: Optional["_models.Encryption"] = None, - **kwargs - ): + extended_network_blocks: Optional[List[str]] = None, + **kwargs: Any + ) -> None: """ :keyword management_cluster: The default cluster used for management. :paramtype management_cluster: ~azure.mgmt.avs.models.ManagementCluster @@ -2394,6 +2444,10 @@ def __init__( :paramtype availability: ~azure.mgmt.avs.models.AvailabilityProperties :keyword encryption: Customer managed key encryption, can be enabled or disabled. :paramtype encryption: ~azure.mgmt.avs.models.Encryption + :keyword extended_network_blocks: Array of additional networks noncontiguous with networkBlock. + Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and + this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). + :paramtype extended_network_blocks: list[str] """ super().__init__(**kwargs) self.management_cluster = management_cluster @@ -2401,6 +2455,7 @@ def __init__( self.identity_sources = identity_sources self.availability = availability self.encryption = encryption + self.extended_network_blocks = extended_network_blocks class PrivateCloudProperties(PrivateCloudUpdateProperties): # pylint: disable=too-many-instance-attributes @@ -2422,6 +2477,10 @@ class PrivateCloudProperties(PrivateCloudUpdateProperties): # pylint: disable=t :vartype availability: ~azure.mgmt.avs.models.AvailabilityProperties :ivar encryption: Customer managed key encryption, can be enabled or disabled. :vartype encryption: ~azure.mgmt.avs.models.Encryption + :ivar extended_network_blocks: Array of additional networks noncontiguous with networkBlock. + Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and + this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). + :vartype extended_network_blocks: list[str] :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", "Cancelled", "Pending", "Building", "Deleting", "Updating", and "Canceled". :vartype provisioning_state: str or ~azure.mgmt.avs.models.PrivateCloudProvisioningState @@ -2480,6 +2539,7 @@ class PrivateCloudProperties(PrivateCloudUpdateProperties): # pylint: disable=t "identity_sources": {"key": "identitySources", "type": "[IdentitySource]"}, "availability": {"key": "availability", "type": "AvailabilityProperties"}, "encryption": {"key": "encryption", "type": "Encryption"}, + "extended_network_blocks": {"key": "extendedNetworkBlocks", "type": "[str]"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, "circuit": {"key": "circuit", "type": "Circuit"}, "endpoints": {"key": "endpoints", "type": "Endpoints"}, @@ -2505,12 +2565,13 @@ def __init__( identity_sources: Optional[List["_models.IdentitySource"]] = None, availability: Optional["_models.AvailabilityProperties"] = None, encryption: Optional["_models.Encryption"] = None, + extended_network_blocks: Optional[List[str]] = None, circuit: Optional["_models.Circuit"] = None, vcenter_password: Optional[str] = None, nsxt_password: Optional[str] = None, secondary_circuit: Optional["_models.Circuit"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword management_cluster: The default cluster used for management. :paramtype management_cluster: ~azure.mgmt.avs.models.ManagementCluster @@ -2524,6 +2585,10 @@ def __init__( :paramtype availability: ~azure.mgmt.avs.models.AvailabilityProperties :keyword encryption: Customer managed key encryption, can be enabled or disabled. :paramtype encryption: ~azure.mgmt.avs.models.Encryption + :keyword extended_network_blocks: Array of additional networks noncontiguous with networkBlock. + Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and + this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). + :paramtype extended_network_blocks: list[str] :keyword circuit: An ExpressRoute Circuit. :paramtype circuit: ~azure.mgmt.avs.models.Circuit :keyword network_block: The block of addresses should be unique across VNet in your @@ -2546,6 +2611,7 @@ def __init__( identity_sources=identity_sources, availability=availability, encryption=encryption, + extended_network_blocks=extended_network_blocks, **kwargs ) self.provisioning_state = None @@ -2583,6 +2649,10 @@ class PrivateCloudUpdate(_serialization.Model): :vartype availability: ~azure.mgmt.avs.models.AvailabilityProperties :ivar encryption: Customer managed key encryption, can be enabled or disabled. :vartype encryption: ~azure.mgmt.avs.models.Encryption + :ivar extended_network_blocks: Array of additional networks noncontiguous with networkBlock. + Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and + this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). + :vartype extended_network_blocks: list[str] """ _attribute_map = { @@ -2593,6 +2663,7 @@ class PrivateCloudUpdate(_serialization.Model): "identity_sources": {"key": "properties.identitySources", "type": "[IdentitySource]"}, "availability": {"key": "properties.availability", "type": "AvailabilityProperties"}, "encryption": {"key": "properties.encryption", "type": "Encryption"}, + "extended_network_blocks": {"key": "properties.extendedNetworkBlocks", "type": "[str]"}, } def __init__( @@ -2605,8 +2676,9 @@ def __init__( identity_sources: Optional[List["_models.IdentitySource"]] = None, availability: Optional["_models.AvailabilityProperties"] = None, encryption: Optional["_models.Encryption"] = None, - **kwargs - ): + extended_network_blocks: Optional[List[str]] = None, + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -2624,6 +2696,10 @@ def __init__( :paramtype availability: ~azure.mgmt.avs.models.AvailabilityProperties :keyword encryption: Customer managed key encryption, can be enabled or disabled. :paramtype encryption: ~azure.mgmt.avs.models.Encryption + :keyword extended_network_blocks: Array of additional networks noncontiguous with networkBlock. + Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and + this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). + :paramtype extended_network_blocks: list[str] """ super().__init__(**kwargs) self.tags = tags @@ -2633,6 +2709,7 @@ def __init__( self.identity_sources = identity_sources self.availability = availability self.encryption = encryption + self.extended_network_blocks = extended_network_blocks class ProxyResource(Resource): @@ -2660,7 +2737,7 @@ class ProxyResource(Resource): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -2699,7 +2776,7 @@ class ScriptExecutionParameter(_serialization.Model): } } - def __init__(self, *, name: str, **kwargs): + def __init__(self, *, name: str, **kwargs: Any) -> None: """ :keyword name: The parameter name. Required. :paramtype name: str @@ -2737,7 +2814,9 @@ class PSCredentialExecutionParameter(ScriptExecutionParameter): "password": {"key": "password", "type": "str"}, } - def __init__(self, *, name: str, username: Optional[str] = None, password: Optional[str] = None, **kwargs): + def __init__( + self, *, name: str, username: Optional[str] = None, password: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword name: The parameter name. Required. :paramtype name: str @@ -2774,7 +2853,7 @@ class Quota(_serialization.Model): "quota_enabled": {"key": "quotaEnabled", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.hosts_remaining = None @@ -2818,7 +2897,7 @@ class ScriptCmdlet(ProxyResource): "parameters": {"key": "properties.parameters", "type": "[ScriptParameter]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.description = None @@ -2847,7 +2926,7 @@ class ScriptCmdletsList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -2947,8 +3026,8 @@ def __init__( retention: Optional[str] = None, output: Optional[List[str]] = None, named_outputs: Optional[Dict[str, JSON]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword script_cmdlet_id: A reference to the script cmdlet resource if user is running a AVS script. @@ -3010,7 +3089,7 @@ class ScriptExecutionsList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -3058,7 +3137,7 @@ class ScriptPackage(ProxyResource): "uri": {"key": "properties.uri", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.description = None @@ -3088,7 +3167,7 @@ class ScriptPackagesList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -3131,7 +3210,7 @@ class ScriptParameter(_serialization.Model): "optional": {"key": "optional", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: The parameter name that the script will expect a parameter value for. :paramtype name: str @@ -3169,7 +3248,7 @@ class ScriptSecureStringExecutionParameter(ScriptExecutionParameter): "secure_value": {"key": "secureValue", "type": "str"}, } - def __init__(self, *, name: str, secure_value: Optional[str] = None, **kwargs): + def __init__(self, *, name: str, secure_value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: The parameter name. Required. :paramtype name: str @@ -3206,7 +3285,7 @@ class ScriptStringExecutionParameter(ScriptExecutionParameter): "value": {"key": "value", "type": "str"}, } - def __init__(self, *, name: str, value: Optional[str] = None, **kwargs): + def __init__(self, *, name: str, value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: The parameter name. Required. :paramtype name: str @@ -3237,8 +3316,8 @@ def __init__( *, log_specifications: Optional[List["_models.LogSpecification"]] = None, metric_specifications: Optional[List["_models.MetricSpecification"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword log_specifications: Specifications of the Log for Azure Monitoring. :paramtype log_specifications: list[~azure.mgmt.avs.models.LogSpecification] @@ -3267,7 +3346,7 @@ class Sku(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, name: str, **kwargs): + def __init__(self, *, name: str, **kwargs: Any) -> None: """ :keyword name: The name of the SKU. Required. :paramtype name: str @@ -3298,7 +3377,7 @@ class Trial(_serialization.Model): "available_hosts": {"key": "availableHosts", "type": "int"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.status = None @@ -3348,7 +3427,7 @@ class VirtualMachine(ProxyResource): "restrict_movement": {"key": "properties.restrictMovement", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.display_name = None @@ -3370,8 +3449,11 @@ class VirtualMachineRestrictMovement(_serialization.Model): } def __init__( - self, *, restrict_movement: Optional[Union[str, "_models.VirtualMachineRestrictMovementState"]] = None, **kwargs - ): + self, + *, + restrict_movement: Optional[Union[str, "_models.VirtualMachineRestrictMovementState"]] = None, + **kwargs: Any + ) -> None: """ :keyword restrict_movement: Whether VM DRS-driven movement is restricted (enabled) or not (disabled). Known values are: "Enabled" and "Disabled". @@ -3402,7 +3484,7 @@ class VirtualMachinesList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -3471,8 +3553,8 @@ def __init__( display_name: Optional[str] = None, affinity_strength: Optional[Union[str, "_models.AffinityStrength"]] = None, azure_hybrid_benefit_type: Optional[Union[str, "_models.AzureHybridBenefitType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword state: Whether the placement policy is enabled or disabled. Known values are: "Enabled" and "Disabled". @@ -3549,8 +3631,8 @@ def __init__( affinity_type: Union[str, "_models.AffinityType"], state: Optional[Union[str, "_models.PlacementPolicyState"]] = None, display_name: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword state: Whether the placement policy is enabled or disabled. Known values are: "Enabled" and "Disabled". @@ -3594,7 +3676,7 @@ class WorkloadNetwork(ProxyResource): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -3627,7 +3709,7 @@ class WorkloadNetworkDhcp(ProxyResource): "properties": {"key": "properties", "type": "WorkloadNetworkDhcpEntity"}, } - def __init__(self, *, properties: Optional["_models.WorkloadNetworkDhcpEntity"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.WorkloadNetworkDhcpEntity"] = None, **kwargs: Any) -> None: """ :keyword properties: DHCP properties. :paramtype properties: ~azure.mgmt.avs.models.WorkloadNetworkDhcpEntity @@ -3676,7 +3758,7 @@ class WorkloadNetworkDhcpEntity(_serialization.Model): _subtype_map = {"dhcp_type": {"RELAY": "WorkloadNetworkDhcpRelay", "SERVER": "WorkloadNetworkDhcpServer"}} - def __init__(self, *, display_name: Optional[str] = None, revision: Optional[int] = None, **kwargs): + def __init__(self, *, display_name: Optional[str] = None, revision: Optional[int] = None, **kwargs: Any) -> None: """ :keyword display_name: Display name of the DHCP entity. :paramtype display_name: str @@ -3712,7 +3794,7 @@ class WorkloadNetworkDhcpList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -3764,8 +3846,8 @@ def __init__( display_name: Optional[str] = None, revision: Optional[int] = None, server_addresses: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword display_name: Display name of the DHCP entity. :paramtype display_name: str @@ -3827,8 +3909,8 @@ def __init__( revision: Optional[int] = None, server_address: Optional[str] = None, lease_time: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword display_name: Display name of the DHCP entity. :paramtype display_name: str @@ -3908,8 +3990,8 @@ def __init__( fqdn_zones: Optional[List[str]] = None, log_level: Optional[Union[str, "_models.DnsServiceLogLevelEnum"]] = None, revision: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword display_name: Display name of the DNS Service. :paramtype display_name: str @@ -3957,7 +4039,7 @@ class WorkloadNetworkDnsServicesList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -4022,8 +4104,8 @@ def __init__( source_ip: Optional[str] = None, dns_services: Optional[int] = None, revision: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword display_name: Display name of the DNS Zone. :paramtype display_name: str @@ -4069,7 +4151,7 @@ class WorkloadNetworkDnsZonesList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -4108,7 +4190,7 @@ class WorkloadNetworkGateway(ProxyResource): "path": {"key": "properties.path", "type": "str"}, } - def __init__(self, *, display_name: Optional[str] = None, **kwargs): + def __init__(self, *, display_name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword display_name: Display name of the DHCP entity. :paramtype display_name: str @@ -4139,7 +4221,7 @@ class WorkloadNetworkGatewayList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -4167,7 +4249,7 @@ class WorkloadNetworkList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -4233,8 +4315,8 @@ def __init__( source: Optional[str] = None, destination: Optional[str] = None, revision: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword display_name: Display name of the port mirroring profile. :paramtype display_name: str @@ -4279,7 +4361,7 @@ class WorkloadNetworkPortMirroringList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -4327,7 +4409,9 @@ class WorkloadNetworkPublicIP(ProxyResource): "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } - def __init__(self, *, display_name: Optional[str] = None, number_of_public_i_ps: Optional[int] = None, **kwargs): + def __init__( + self, *, display_name: Optional[str] = None, number_of_public_i_ps: Optional[int] = None, **kwargs: Any + ) -> None: """ :keyword display_name: Display name of the Public IP Block. :paramtype display_name: str @@ -4362,7 +4446,7 @@ class WorkloadNetworkPublicIPsList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -4427,8 +4511,8 @@ def __init__( connected_gateway: Optional[str] = None, subnet: Optional["_models.WorkloadNetworkSegmentSubnet"] = None, revision: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword display_name: Display name of the segment. :paramtype display_name: str @@ -4460,7 +4544,7 @@ class WorkloadNetworkSegmentPortVif(_serialization.Model): "port_name": {"key": "portName", "type": "str"}, } - def __init__(self, *, port_name: Optional[str] = None, **kwargs): + def __init__(self, *, port_name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword port_name: Name of port or VIF attached to segment. :paramtype port_name: str @@ -4490,7 +4574,7 @@ class WorkloadNetworkSegmentsList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -4511,7 +4595,9 @@ class WorkloadNetworkSegmentSubnet(_serialization.Model): "gateway_address": {"key": "gatewayAddress", "type": "str"}, } - def __init__(self, *, dhcp_ranges: Optional[List[str]] = None, gateway_address: Optional[str] = None, **kwargs): + def __init__( + self, *, dhcp_ranges: Optional[List[str]] = None, gateway_address: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword dhcp_ranges: DHCP Range assigned for subnet. :paramtype dhcp_ranges: list[str] @@ -4555,7 +4641,7 @@ class WorkloadNetworkVirtualMachine(ProxyResource): "vm_type": {"key": "properties.vmType", "type": "str"}, } - def __init__(self, *, display_name: Optional[str] = None, **kwargs): + def __init__(self, *, display_name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword display_name: Display name of the VM. :paramtype display_name: str @@ -4586,7 +4672,7 @@ class WorkloadNetworkVirtualMachinesList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -4643,8 +4729,8 @@ def __init__( display_name: Optional[str] = None, members: Optional[List[str]] = None, revision: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword display_name: Display name of the VM group. :paramtype display_name: str @@ -4682,7 +4768,7 @@ class WorkloadNetworkVMGroupsList(_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/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py index 6867489acd519..9b6fa93d92a40 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,10 +58,10 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,11 +91,11 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "addonName": _SERIALIZER.url("addon_name", addon_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "addonName": _SERIALIZER.url("addon_name", addon_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +112,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,10 +127,10 @@ def build_create_or_update_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "addonName": _SERIALIZER.url("addon_name", addon_name, "str"), + "addonName": _SERIALIZER.url("addon_name", addon_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -153,7 +149,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,11 +162,11 @@ def build_delete_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "addonName": _SERIALIZER.url("addon_name", addon_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "addonName": _SERIALIZER.url("addon_name", addon_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -219,9 +215,7 @@ def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AddonList] = kwargs.pop("cls", None) error_map = { @@ -275,14 +269,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -321,9 +317,7 @@ def get(self, resource_group_name: str, private_cloud_name: str, addon_name: str _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Addon] = kwargs.pop("cls", None) request = build_get_request( @@ -339,15 +333,17 @@ def get(self, resource_group_name: str, private_cloud_name: str, addon_name: str request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Addon", pipeline_response) @@ -379,16 +375,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Addon] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(addon, (IO, bytes)): + if isinstance(addon, (IOBase, bytes)): _content = addon else: _json = self._serialize.body(addon, "Addon") @@ -409,15 +403,17 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("Addon", pipeline_response) @@ -534,7 +530,7 @@ def begin_create_or_update( :type private_cloud_name: str :param addon_name: Name of the addon for the private cloud. Required. :type addon_name: str - :param addon: A addon in the private cloud. Is either a model type or a IO type. Required. + :param addon: A addon in the private cloud. Is either a Addon type or a IO type. Required. :type addon: ~azure.mgmt.avs.models.Addon or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -554,9 +550,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Addon] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -616,9 +610,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -634,15 +626,17 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -681,9 +675,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py index 60562af5605fd..38688a5f3b7b3 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,10 +58,10 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,11 +91,11 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "authorizationName": _SERIALIZER.url("authorization_name", authorization_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "authorizationName": _SERIALIZER.url("authorization_name", authorization_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +112,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,10 +127,10 @@ def build_create_or_update_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "authorizationName": _SERIALIZER.url("authorization_name", authorization_name, "str"), + "authorizationName": _SERIALIZER.url("authorization_name", authorization_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -153,7 +149,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,11 +162,11 @@ def build_delete_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "authorizationName": _SERIALIZER.url("authorization_name", authorization_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "authorizationName": _SERIALIZER.url("authorization_name", authorization_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -222,9 +218,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExpressRouteAuthorizationList] = kwargs.pop("cls", None) error_map = { @@ -278,14 +272,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -327,9 +323,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExpressRouteAuthorization] = kwargs.pop("cls", None) request = build_get_request( @@ -345,15 +339,17 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ExpressRouteAuthorization", pipeline_response) @@ -385,16 +381,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExpressRouteAuthorization] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(authorization, (IO, bytes)): + if isinstance(authorization, (IOBase, bytes)): _content = authorization else: _json = self._serialize.body(authorization, "ExpressRouteAuthorization") @@ -415,15 +409,17 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("ExpressRouteAuthorization", pipeline_response) @@ -545,8 +541,8 @@ def begin_create_or_update( :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud. Required. :type authorization_name: str - :param authorization: An ExpressRoute Circuit Authorization. Is either a model type or a IO - type. Required. + :param authorization: An ExpressRoute Circuit Authorization. Is either a + ExpressRouteAuthorization type or a IO type. Required. :type authorization: ~azure.mgmt.avs.models.ExpressRouteAuthorization or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -567,9 +563,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExpressRouteAuthorization] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -629,9 +623,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -647,15 +639,17 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -695,9 +689,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py index 6ae12357c8a97..d2781997659ec 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,10 +58,10 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,11 +91,11 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "cloudLinkName": _SERIALIZER.url("cloud_link_name", cloud_link_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "cloudLinkName": _SERIALIZER.url("cloud_link_name", cloud_link_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +112,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,10 +127,10 @@ def build_create_or_update_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "cloudLinkName": _SERIALIZER.url("cloud_link_name", cloud_link_name, "str"), + "cloudLinkName": _SERIALIZER.url("cloud_link_name", cloud_link_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -153,7 +149,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,11 +162,11 @@ def build_delete_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "cloudLinkName": _SERIALIZER.url("cloud_link_name", cloud_link_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "cloudLinkName": _SERIALIZER.url("cloud_link_name", cloud_link_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -219,9 +215,7 @@ def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudLinkList] = kwargs.pop("cls", None) error_map = { @@ -275,14 +269,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -323,9 +319,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudLink] = kwargs.pop("cls", None) request = build_get_request( @@ -341,15 +335,17 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("CloudLink", pipeline_response) @@ -381,16 +377,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CloudLink] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(cloud_link, (IO, bytes)): + if isinstance(cloud_link, (IOBase, bytes)): _content = cloud_link else: _json = self._serialize.body(cloud_link, "CloudLink") @@ -411,15 +405,17 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("CloudLink", pipeline_response) @@ -536,7 +532,7 @@ def begin_create_or_update( :type private_cloud_name: str :param cloud_link_name: Name of the cloud link resource. Required. :type cloud_link_name: str - :param cloud_link: A cloud link in the private cloud. Is either a model type or a IO type. + :param cloud_link: A cloud link in the private cloud. Is either a CloudLink type or a IO type. Required. :type cloud_link: ~azure.mgmt.avs.models.CloudLink or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -557,9 +553,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CloudLink] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -619,9 +613,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -637,15 +629,17 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -684,9 +678,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py index de75104fa2865..91c553f20b9a6 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,10 +58,10 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,11 +91,11 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +112,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,10 +127,10 @@ def build_create_or_update_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -153,7 +149,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -167,11 +163,11 @@ def build_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -190,7 +186,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,11 +199,11 @@ def build_delete_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -224,7 +220,7 @@ def build_list_zones_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,11 +233,11 @@ def build_list_zones_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,9 +286,7 @@ def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) error_map = { @@ -346,14 +340,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -394,9 +390,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) request = build_get_request( @@ -412,15 +406,17 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Cluster", pipeline_response) @@ -452,16 +448,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(cluster, (IO, bytes)): + if isinstance(cluster, (IOBase, bytes)): _content = cluster else: _json = self._serialize.body(cluster, "Cluster") @@ -482,15 +476,17 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("Cluster", pipeline_response) @@ -607,7 +603,8 @@ def begin_create_or_update( :type private_cloud_name: str :param cluster_name: Name of the cluster in the private cloud. Required. :type cluster_name: str - :param cluster: A cluster in the private cloud. Is either a model type or a IO type. Required. + :param cluster: A cluster in the private cloud. Is either a Cluster type or a IO type. + Required. :type cluster: ~azure.mgmt.avs.models.Cluster or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -627,9 +624,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -694,16 +689,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(cluster_update, (IO, bytes)): + if isinstance(cluster_update, (IOBase, bytes)): _content = cluster_update else: _json = self._serialize.body(cluster_update, "ClusterUpdate") @@ -724,15 +717,17 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("Cluster", pipeline_response) @@ -849,8 +844,8 @@ def begin_update( :type private_cloud_name: str :param cluster_name: Name of the cluster in the private cloud. Required. :type cluster_name: str - :param cluster_update: The cluster properties to be updated. Is either a model type or a IO - type. Required. + :param cluster_update: The cluster properties to be updated. Is either a ClusterUpdate type or + a IO type. Required. :type cluster_update: ~azure.mgmt.avs.models.ClusterUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -870,9 +865,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -932,9 +925,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -950,15 +941,17 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -997,9 +990,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1071,9 +1062,7 @@ def list_zones( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ClusterZoneList] = kwargs.pop("cls", None) request = build_list_zones_request( @@ -1089,15 +1078,17 @@ def list_zones( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ClusterZoneList", pipeline_response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py index 3dd1c2f07eaa9..934635530870a 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,11 +58,11 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,7 +84,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,12 +97,12 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "datastoreName": _SERIALIZER.url("datastore_name", datastore_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), + "datastoreName": _SERIALIZER.url("datastore_name", datastore_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -128,7 +124,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -142,12 +138,12 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "datastoreName": _SERIALIZER.url("datastore_name", datastore_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), + "datastoreName": _SERIALIZER.url("datastore_name", datastore_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -171,7 +167,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,12 +180,12 @@ def build_delete_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "datastoreName": _SERIALIZER.url("datastore_name", datastore_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), + "datastoreName": _SERIALIZER.url("datastore_name", datastore_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -242,9 +238,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatastoreList] = kwargs.pop("cls", None) error_map = { @@ -299,14 +293,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -349,9 +345,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Datastore] = kwargs.pop("cls", None) request = build_get_request( @@ -368,15 +362,17 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Datastore", pipeline_response) @@ -409,16 +405,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Datastore] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(datastore, (IO, bytes)): + if isinstance(datastore, (IOBase, bytes)): _content = datastore else: _json = self._serialize.body(datastore, "Datastore") @@ -440,15 +434,17 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("Datastore", pipeline_response) @@ -574,8 +570,8 @@ def begin_create_or_update( :type cluster_name: str :param datastore_name: Name of the datastore in the private cloud cluster. Required. :type datastore_name: str - :param datastore: A datastore in a private cloud cluster. Is either a model type or a IO type. - Required. + :param datastore: A datastore in a private cloud cluster. Is either a Datastore type or a IO + type. Required. :type datastore: ~azure.mgmt.avs.models.Datastore or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -595,9 +591,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Datastore] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -658,9 +652,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -677,15 +669,17 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -726,9 +720,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py index 963a09b383bd4..bb0d3b96cfb6a 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,10 +58,10 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,7 +82,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,13 +95,13 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "globalReachConnectionName": _SERIALIZER.url( - "global_reach_connection_name", global_reach_connection_name, "str" + "global_reach_connection_name", global_reach_connection_name, "str", pattern=r"^[-\w\._]+$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,7 +122,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -142,11 +138,11 @@ def build_create_or_update_request( ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), "globalReachConnectionName": _SERIALIZER.url( - "global_reach_connection_name", global_reach_connection_name, "str" + "global_reach_connection_name", global_reach_connection_name, "str", pattern=r"^[-\w\._]+$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -169,7 +165,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,13 +178,13 @@ def build_delete_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "globalReachConnectionName": _SERIALIZER.url( - "global_reach_connection_name", global_reach_connection_name, "str" + "global_reach_connection_name", global_reach_connection_name, "str", pattern=r"^[-\w\._]+$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -240,9 +236,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GlobalReachConnectionList] = kwargs.pop("cls", None) error_map = { @@ -296,14 +290,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -345,9 +341,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GlobalReachConnection] = kwargs.pop("cls", None) request = build_get_request( @@ -363,15 +357,17 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("GlobalReachConnection", pipeline_response) @@ -403,16 +399,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.GlobalReachConnection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(global_reach_connection, (IO, bytes)): + if isinstance(global_reach_connection, (IOBase, bytes)): _content = global_reach_connection else: _json = self._serialize.body(global_reach_connection, "GlobalReachConnection") @@ -433,15 +427,17 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("GlobalReachConnection", pipeline_response) @@ -564,7 +560,7 @@ def begin_create_or_update( Required. :type global_reach_connection_name: str :param global_reach_connection: A global reach connection in the private cloud. Is either a - model type or a IO type. Required. + GlobalReachConnection type or a IO type. Required. :type global_reach_connection: ~azure.mgmt.avs.models.GlobalReachConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -585,9 +581,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.GlobalReachConnection] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -647,9 +641,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -665,15 +657,17 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -713,9 +707,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py index 93f96bb00a145..0f458c3d69f8e 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -28,12 +28,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +43,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,10 +56,10 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -84,7 +80,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,11 +93,13 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "hcxEnterpriseSiteName": _SERIALIZER.url("hcx_enterprise_site_name", hcx_enterprise_site_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "hcxEnterpriseSiteName": _SERIALIZER.url( + "hcx_enterprise_site_name", hcx_enterprise_site_name, "str", pattern=r"^[-\w\._]+$" + ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -122,7 +120,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -137,10 +135,12 @@ def build_create_or_update_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "hcxEnterpriseSiteName": _SERIALIZER.url("hcx_enterprise_site_name", hcx_enterprise_site_name, "str"), + "hcxEnterpriseSiteName": _SERIALIZER.url( + "hcx_enterprise_site_name", hcx_enterprise_site_name, "str", pattern=r"^[-\w\._]+$" + ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,7 +163,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -176,11 +176,13 @@ def build_delete_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "hcxEnterpriseSiteName": _SERIALIZER.url("hcx_enterprise_site_name", hcx_enterprise_site_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "hcxEnterpriseSiteName": _SERIALIZER.url( + "hcx_enterprise_site_name", hcx_enterprise_site_name, "str", pattern=r"^[-\w\._]+$" + ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -214,9 +216,9 @@ def __init__(self, *args, **kwargs): def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> Iterable["_models.HcxEnterpriseSite"]: - """List HCX Enterprise Sites in a private cloud. + """List HCX on-premises key in a private cloud. - List HCX Enterprise Sites in a private cloud. + List HCX on-premises key in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -231,9 +233,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.HcxEnterpriseSiteList] = kwargs.pop("cls", None) error_map = { @@ -287,14 +287,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -308,9 +310,9 @@ def get_next(next_link=None): def get( self, resource_group_name: str, private_cloud_name: str, hcx_enterprise_site_name: str, **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Get an HCX Enterprise Site by name in a private cloud. + """Get an HCX on-premises key by name in a private cloud. - Get an HCX Enterprise Site by name in a private cloud. + Get an HCX on-premises key by name in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -336,9 +338,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.HcxEnterpriseSite] = kwargs.pop("cls", None) request = build_get_request( @@ -354,15 +354,17 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("HcxEnterpriseSite", pipeline_response) @@ -386,9 +388,9 @@ def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Create or update an HCX Enterprise Site in a private cloud. + """Create or update an activation key for on-premises HCX site. - Create or update an HCX Enterprise Site in a private cloud. + Create or update an activation key for on-premises HCX site. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -420,9 +422,9 @@ def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Create or update an HCX Enterprise Site in a private cloud. + """Create or update an activation key for on-premises HCX site. - Create or update an HCX Enterprise Site in a private cloud. + Create or update an activation key for on-premises HCX site. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -452,9 +454,9 @@ def create_or_update( hcx_enterprise_site: Union[_models.HcxEnterpriseSite, IO], **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Create or update an HCX Enterprise Site in a private cloud. + """Create or update an activation key for on-premises HCX site. - Create or update an HCX Enterprise Site in a private cloud. + Create or update an activation key for on-premises HCX site. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -464,8 +466,8 @@ def create_or_update( :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud. Required. :type hcx_enterprise_site_name: str - :param hcx_enterprise_site: The HCX Enterprise Site. Is either a model type or a IO type. - Required. + :param hcx_enterprise_site: The HCX Enterprise Site. Is either a HcxEnterpriseSite type or a IO + type. Required. :type hcx_enterprise_site: ~azure.mgmt.avs.models.HcxEnterpriseSite or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -486,16 +488,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.HcxEnterpriseSite] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(hcx_enterprise_site, (IO, bytes)): + if isinstance(hcx_enterprise_site, (IOBase, bytes)): _content = hcx_enterprise_site else: _json = self._serialize.body(hcx_enterprise_site, "HcxEnterpriseSite") @@ -516,15 +516,17 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("HcxEnterpriseSite", pipeline_response) @@ -545,9 +547,9 @@ def create_or_update( def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, private_cloud_name: str, hcx_enterprise_site_name: str, **kwargs: Any ) -> None: - """Delete an HCX Enterprise Site in a private cloud. + """Delete HCX on-premises key in a private cloud. - Delete an HCX Enterprise Site in a private cloud. + Delete HCX on-premises key in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -573,9 +575,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -591,15 +591,17 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py index 659e3d28879e9..f078668e4ffa8 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -26,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +39,7 @@ def build_check_trial_availability_request(location: str, subscription_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -57,7 +53,7 @@ def build_check_trial_availability_request(location: str, subscription_id: str, "location": _SERIALIZER.url("location", location, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -74,7 +70,7 @@ def build_check_quota_availability_request(location: str, subscription_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +83,7 @@ def build_check_quota_availability_request(location: str, subscription_id: str, "location": _SERIALIZER.url("location", location, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,8 +159,8 @@ def check_trial_availability( :param location: Azure region. Required. :type location: str - :param sku: The sku to check for trial availability. Is either a model type or a IO type. - Default value is None. + :param sku: The sku to check for trial availability. Is either a Sku type or a IO type. Default + value is None. :type sku: ~azure.mgmt.avs.models.Sku or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -185,16 +181,14 @@ def check_trial_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Trial] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(sku, (IO, bytes)): + if isinstance(sku, (IOBase, bytes)): _content = sku else: if sku is not None: @@ -216,15 +210,17 @@ def check_trial_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Trial", pipeline_response) @@ -259,9 +255,7 @@ def check_quota_availability(self, location: str, **kwargs: Any) -> _models.Quot _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Quota] = kwargs.pop("cls", None) request = build_check_quota_availability_request( @@ -275,15 +269,17 @@ def check_quota_availability(self, location: str, **kwargs: Any) -> _models.Quot request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Quota", pipeline_response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py index fbdbcde4c03ce..a0be57989bf71 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,9 +86,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) error_map = { @@ -144,14 +137,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py index c821edb0b9700..8e3da3e884363 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,11 +58,11 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,7 +84,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,12 +97,14 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "placementPolicyName": _SERIALIZER.url("placement_policy_name", placement_policy_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), + "placementPolicyName": _SERIALIZER.url( + "placement_policy_name", placement_policy_name, "str", pattern=r"^[-\w\._]+$" + ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -128,7 +126,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -142,12 +140,14 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "placementPolicyName": _SERIALIZER.url("placement_policy_name", placement_policy_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), + "placementPolicyName": _SERIALIZER.url( + "placement_policy_name", placement_policy_name, "str", pattern=r"^[-\w\._]+$" + ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -171,7 +171,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -185,12 +185,14 @@ def build_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "placementPolicyName": _SERIALIZER.url("placement_policy_name", placement_policy_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), + "placementPolicyName": _SERIALIZER.url( + "placement_policy_name", placement_policy_name, "str", pattern=r"^[-\w\._]+$" + ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -214,7 +216,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -227,12 +229,14 @@ def build_delete_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "placementPolicyName": _SERIALIZER.url("placement_policy_name", placement_policy_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), + "placementPolicyName": _SERIALIZER.url( + "placement_policy_name", placement_policy_name, "str", pattern=r"^[-\w\._]+$" + ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -285,9 +289,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PlacementPoliciesList] = kwargs.pop("cls", None) error_map = { @@ -342,14 +344,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -398,9 +402,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PlacementPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -417,15 +419,17 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("PlacementPolicy", pipeline_response) @@ -458,16 +462,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PlacementPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(placement_policy, (IO, bytes)): + if isinstance(placement_policy, (IOBase, bytes)): _content = placement_policy else: _json = self._serialize.body(placement_policy, "PlacementPolicy") @@ -489,15 +491,17 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("PlacementPolicy", pipeline_response) @@ -628,8 +632,8 @@ def begin_create_or_update( :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy. Required. :type placement_policy_name: str - :param placement_policy: A placement policy in the private cloud cluster. Is either a model - type or a IO type. Required. + :param placement_policy: A placement policy in the private cloud cluster. Is either a + PlacementPolicy type or a IO type. Required. :type placement_policy: ~azure.mgmt.avs.models.PlacementPolicy or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -650,9 +654,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PlacementPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -719,16 +721,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PlacementPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(placement_policy_update, (IO, bytes)): + if isinstance(placement_policy_update, (IOBase, bytes)): _content = placement_policy_update else: _json = self._serialize.body(placement_policy_update, "PlacementPolicyUpdate") @@ -750,15 +750,17 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("PlacementPolicy", pipeline_response) @@ -890,7 +892,7 @@ def begin_update( placement policy. Required. :type placement_policy_name: str :param placement_policy_update: The placement policy properties that may be updated. Is either - a model type or a IO type. Required. + a PlacementPolicyUpdate type or a IO type. Required. :type placement_policy_update: ~azure.mgmt.avs.models.PlacementPolicyUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -911,9 +913,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PlacementPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -979,9 +979,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -998,15 +996,17 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -1053,9 +1053,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py index 8e3d88c9ce86b..6f351e0922f1d 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +43,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +58,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -77,7 +73,7 @@ def build_list_in_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +82,7 @@ def build_list_in_subscription_request(subscription_id: str, **kwargs: Any) -> H "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -103,7 +99,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,10 +112,10 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -136,7 +132,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -150,10 +146,10 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -172,7 +168,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -186,10 +182,10 @@ def build_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -208,7 +204,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -221,10 +217,10 @@ def build_delete_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -241,7 +237,7 @@ def build_rotate_vcenter_password_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -254,10 +250,10 @@ def build_rotate_vcenter_password_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -274,7 +270,7 @@ def build_rotate_nsxt_password_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,10 +283,10 @@ def build_rotate_nsxt_password_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -307,7 +303,7 @@ def build_list_admin_credentials_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,10 +316,10 @@ def build_list_admin_credentials_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -370,9 +366,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Pri _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateCloudList] = kwargs.pop("cls", None) error_map = { @@ -425,14 +419,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -456,9 +452,7 @@ def list_in_subscription(self, **kwargs: Any) -> Iterable["_models.PrivateCloud" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateCloudList] = kwargs.pop("cls", None) error_map = { @@ -510,14 +504,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -552,9 +548,7 @@ def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateCloud] = kwargs.pop("cls", None) request = build_get_request( @@ -569,15 +563,17 @@ def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("PrivateCloud", pipeline_response) @@ -608,16 +604,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateCloud] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(private_cloud, (IO, bytes)): + if isinstance(private_cloud, (IOBase, bytes)): _content = private_cloud else: _json = self._serialize.body(private_cloud, "PrivateCloud") @@ -637,15 +631,17 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("PrivateCloud", pipeline_response) @@ -755,7 +751,7 @@ def begin_create_or_update( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud: The private cloud. Is either a model type or a IO type. Required. + :param private_cloud: The private cloud. Is either a PrivateCloud type or a IO type. Required. :type private_cloud: ~azure.mgmt.avs.models.PrivateCloud or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -776,9 +772,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateCloud] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -841,16 +835,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateCloud] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(private_cloud_update, (IO, bytes)): + if isinstance(private_cloud_update, (IOBase, bytes)): _content = private_cloud_update else: _json = self._serialize.body(private_cloud_update, "PrivateCloudUpdate") @@ -870,15 +862,17 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("PrivateCloud", pipeline_response) @@ -988,8 +982,8 @@ def begin_update( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud_update: The private cloud properties to be updated. Is either a model type - or a IO type. Required. + :param private_cloud_update: The private cloud properties to be updated. Is either a + PrivateCloudUpdate type or a IO type. Required. :type private_cloud_update: ~azure.mgmt.avs.models.PrivateCloudUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1010,9 +1004,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateCloud] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1071,9 +1063,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -1088,15 +1078,17 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -1131,9 +1123,7 @@ def begin_delete(self, resource_group_name: str, private_cloud_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1187,9 +1177,7 @@ def _rotate_vcenter_password_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_rotate_vcenter_password_request( @@ -1204,15 +1192,17 @@ def _rotate_vcenter_password_initial( # pylint: disable=inconsistent-return-sta request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -1249,9 +1239,7 @@ def begin_rotate_vcenter_password( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1305,9 +1293,7 @@ def _rotate_nsxt_password_initial( # pylint: disable=inconsistent-return-statem _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_rotate_nsxt_password_request( @@ -1322,15 +1308,17 @@ def _rotate_nsxt_password_initial( # pylint: disable=inconsistent-return-statem request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -1367,9 +1355,7 @@ def begin_rotate_nsxt_password( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1438,9 +1424,7 @@ def list_admin_credentials( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AdminCredentials] = kwargs.pop("cls", None) request = build_list_admin_credentials_request( @@ -1455,15 +1439,17 @@ def list_admin_credentials( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("AdminCredentials", pipeline_response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py index 8f3419046457c..204dbac228375 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -28,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +42,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,11 +55,13 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "scriptPackageName": _SERIALIZER.url("script_package_name", script_package_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "scriptPackageName": _SERIALIZER.url( + "script_package_name", script_package_name, "str", pattern=r"^[-\w\._@]+$" + ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,7 +83,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,12 +96,14 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "scriptPackageName": _SERIALIZER.url("script_package_name", script_package_name, "str"), - "scriptCmdletName": _SERIALIZER.url("script_cmdlet_name", script_cmdlet_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "scriptPackageName": _SERIALIZER.url( + "script_package_name", script_package_name, "str", pattern=r"^[-\w\._@]+$" + ), + "scriptCmdletName": _SERIALIZER.url("script_cmdlet_name", script_cmdlet_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -156,9 +155,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptCmdletsList] = kwargs.pop("cls", None) error_map = { @@ -213,14 +210,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -267,9 +266,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptCmdlet] = kwargs.pop("cls", None) request = build_get_request( @@ -286,15 +283,17 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ScriptCmdlet", pipeline_response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py index cecff23ec9528..c1f4b16372a9f 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, List, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,10 +58,10 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,11 +91,13 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "scriptExecutionName": _SERIALIZER.url("script_execution_name", script_execution_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "scriptExecutionName": _SERIALIZER.url( + "script_execution_name", script_execution_name, "str", pattern=r"^[-\w\._]+$" + ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +114,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,10 +129,12 @@ def build_create_or_update_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "scriptExecutionName": _SERIALIZER.url("script_execution_name", script_execution_name, "str"), + "scriptExecutionName": _SERIALIZER.url( + "script_execution_name", script_execution_name, "str", pattern=r"^[-\w\._]+$" + ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -153,7 +153,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,11 +166,13 @@ def build_delete_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "scriptExecutionName": _SERIALIZER.url("script_execution_name", script_execution_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "scriptExecutionName": _SERIALIZER.url( + "script_execution_name", script_execution_name, "str", pattern=r"^[-\w\._]+$" + ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -187,7 +189,7 @@ def build_get_execution_logs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -201,11 +203,13 @@ def build_get_execution_logs_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "scriptExecutionName": _SERIALIZER.url("script_execution_name", script_execution_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "scriptExecutionName": _SERIALIZER.url( + "script_execution_name", script_execution_name, "str", pattern=r"^[-\w\._]+$" + ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -258,9 +262,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptExecutionsList] = kwargs.pop("cls", None) error_map = { @@ -314,14 +316,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -362,9 +366,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptExecution] = kwargs.pop("cls", None) request = build_get_request( @@ -380,15 +382,17 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ScriptExecution", pipeline_response) @@ -420,16 +424,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ScriptExecution] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(script_execution, (IO, bytes)): + if isinstance(script_execution, (IOBase, bytes)): _content = script_execution else: _json = self._serialize.body(script_execution, "ScriptExecution") @@ -450,15 +452,17 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("ScriptExecution", pipeline_response) @@ -577,8 +581,8 @@ def begin_create_or_update( :type private_cloud_name: str :param script_execution_name: Name of the user-invoked script execution resource. Required. :type script_execution_name: str - :param script_execution: A script running in the private cloud. Is either a model type or a IO - type. Required. + :param script_execution: A script running in the private cloud. Is either a ScriptExecution + type or a IO type. Required. :type script_execution: ~azure.mgmt.avs.models.ScriptExecution or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -599,9 +603,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ScriptExecution] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -661,9 +663,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -679,15 +679,17 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -726,9 +728,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -852,8 +852,8 @@ def get_execution_logs( :param script_execution_name: Name of the user-invoked script execution resource. Required. :type script_execution_name: str :param script_output_stream_type: Name of the desired output stream to return. If not provided, - will return all. An empty array will return nothing. Is either a list type or a IO type. - Default value is None. + will return all. An empty array will return nothing. Is either a [Union[str, + "_models.ScriptOutputStreamType"]] type or a IO type. Default value is None. :type script_output_stream_type: list[str or ~azure.mgmt.avs.models.ScriptOutputStreamType] or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -875,16 +875,14 @@ def get_execution_logs( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ScriptExecution] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(script_output_stream_type, (IO, bytes)): + if isinstance(script_output_stream_type, (IOBase, bytes)): _content = script_output_stream_type else: if script_output_stream_type is not None: @@ -908,15 +906,17 @@ def get_execution_logs( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ScriptExecution", pipeline_response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py index 3197b7aa864d4..04a89fc138ab4 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -28,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +42,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,10 +55,10 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +75,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,11 +88,13 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "scriptPackageName": _SERIALIZER.url("script_package_name", script_package_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "scriptPackageName": _SERIALIZER.url( + "script_package_name", script_package_name, "str", pattern=r"^[-\w\._@]+$" + ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,9 +143,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptPackagesList] = kwargs.pop("cls", None) error_map = { @@ -202,14 +197,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -248,9 +245,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptPackage] = kwargs.pop("cls", None) request = build_get_request( @@ -266,15 +261,17 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ScriptPackage", pipeline_response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py index 36f830629681b..8105422455ca6 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,11 +58,11 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,7 +84,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,12 +97,12 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), "virtualMachineId": _SERIALIZER.url("virtual_machine_id", virtual_machine_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -128,7 +124,7 @@ def build_restrict_movement_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -142,12 +138,12 @@ def build_restrict_movement_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), "virtualMachineId": _SERIALIZER.url("virtual_machine_id", virtual_machine_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -202,9 +198,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualMachinesList] = kwargs.pop("cls", None) error_map = { @@ -259,14 +253,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -314,9 +310,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualMachine] = kwargs.pop("cls", None) request = build_get_request( @@ -333,15 +327,17 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("VirtualMachine", pipeline_response) @@ -374,16 +370,14 @@ def _restrict_movement_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(restrict_movement, (IO, bytes)): + if isinstance(restrict_movement, (IOBase, bytes)): _content = restrict_movement else: _json = self._serialize.body(restrict_movement, "VirtualMachineRestrictMovement") @@ -405,15 +399,17 @@ def _restrict_movement_initial( # pylint: disable=inconsistent-return-statement request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -534,7 +530,7 @@ def begin_restrict_movement( :param virtual_machine_id: Virtual Machine identifier. Required. :type virtual_machine_id: str :param restrict_movement: Whether VM DRS-driven movement is restricted (Enabled) or not - (Disabled). Is either a model type or a IO type. Required. + (Disabled). Is either a VirtualMachineRestrictMovement type or a IO type. Required. :type restrict_movement: ~azure.mgmt.avs.models.VirtualMachineRestrictMovement or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -554,9 +550,7 @@ def begin_restrict_movement( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py index 1742eea89cec5..b13c4a90b99b4 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +49,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,11 +62,11 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "workloadNetworkName": _SERIALIZER.url("workload_network_name", workload_network_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -87,7 +83,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,10 +96,10 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -120,7 +116,7 @@ def build_list_segments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,10 +129,10 @@ def build_list_segments_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -153,7 +149,7 @@ def build_get_segment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,11 +162,11 @@ def build_get_segment_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "segmentId": _SERIALIZER.url("segment_id", segment_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -187,7 +183,7 @@ def build_create_segments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -201,11 +197,11 @@ def build_create_segments_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "segmentId": _SERIALIZER.url("segment_id", segment_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -224,7 +220,7 @@ def build_update_segments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -238,11 +234,11 @@ def build_update_segments_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "segmentId": _SERIALIZER.url("segment_id", segment_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -261,7 +257,7 @@ def build_delete_segment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -274,11 +270,11 @@ def build_delete_segment_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "segmentId": _SERIALIZER.url("segment_id", segment_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -295,7 +291,7 @@ def build_list_dhcp_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,10 +304,10 @@ def build_list_dhcp_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -328,7 +324,7 @@ def build_get_dhcp_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,10 +338,10 @@ def build_get_dhcp_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "dhcpId": _SERIALIZER.url("dhcp_id", dhcp_id, "str"), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -362,7 +358,7 @@ def build_create_dhcp_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -376,11 +372,11 @@ def build_create_dhcp_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "dhcpId": _SERIALIZER.url("dhcp_id", dhcp_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -399,7 +395,7 @@ def build_update_dhcp_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -413,11 +409,11 @@ def build_update_dhcp_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "dhcpId": _SERIALIZER.url("dhcp_id", dhcp_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -436,7 +432,7 @@ def build_delete_dhcp_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -449,11 +445,11 @@ def build_delete_dhcp_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "dhcpId": _SERIALIZER.url("dhcp_id", dhcp_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -470,7 +466,7 @@ def build_list_gateways_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -483,10 +479,10 @@ def build_list_gateways_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -503,7 +499,7 @@ def build_get_gateway_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -516,11 +512,11 @@ def build_get_gateway_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "gatewayId": _SERIALIZER.url("gateway_id", gateway_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -537,7 +533,7 @@ def build_list_port_mirroring_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -550,10 +546,10 @@ def build_list_port_mirroring_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -570,7 +566,7 @@ def build_get_port_mirroring_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -583,11 +579,11 @@ def build_get_port_mirroring_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "portMirroringId": _SERIALIZER.url("port_mirroring_id", port_mirroring_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -604,7 +600,7 @@ def build_create_port_mirroring_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -618,11 +614,11 @@ def build_create_port_mirroring_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "portMirroringId": _SERIALIZER.url("port_mirroring_id", port_mirroring_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -641,7 +637,7 @@ def build_update_port_mirroring_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -655,11 +651,11 @@ def build_update_port_mirroring_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "portMirroringId": _SERIALIZER.url("port_mirroring_id", port_mirroring_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -678,7 +674,7 @@ def build_delete_port_mirroring_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -692,10 +688,10 @@ def build_delete_port_mirroring_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "portMirroringId": _SERIALIZER.url("port_mirroring_id", port_mirroring_id, "str"), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -712,7 +708,7 @@ def build_list_vm_groups_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -725,10 +721,10 @@ def build_list_vm_groups_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -745,7 +741,7 @@ def build_get_vm_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -758,11 +754,11 @@ def build_get_vm_group_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "vmGroupId": _SERIALIZER.url("vm_group_id", vm_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -779,7 +775,7 @@ def build_create_vm_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -793,11 +789,11 @@ def build_create_vm_group_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "vmGroupId": _SERIALIZER.url("vm_group_id", vm_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -816,7 +812,7 @@ def build_update_vm_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -830,11 +826,11 @@ def build_update_vm_group_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "vmGroupId": _SERIALIZER.url("vm_group_id", vm_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -853,7 +849,7 @@ def build_delete_vm_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -867,10 +863,10 @@ def build_delete_vm_group_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "vmGroupId": _SERIALIZER.url("vm_group_id", vm_group_id, "str"), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -887,7 +883,7 @@ def build_list_virtual_machines_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -900,10 +896,10 @@ def build_list_virtual_machines_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -920,7 +916,7 @@ def build_get_virtual_machine_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -933,11 +929,11 @@ def build_get_virtual_machine_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "virtualMachineId": _SERIALIZER.url("virtual_machine_id", virtual_machine_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -954,7 +950,7 @@ def build_list_dns_services_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -967,10 +963,10 @@ def build_list_dns_services_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -987,7 +983,7 @@ def build_get_dns_service_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1000,11 +996,11 @@ def build_get_dns_service_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "dnsServiceId": _SERIALIZER.url("dns_service_id", dns_service_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1021,7 +1017,7 @@ def build_create_dns_service_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1035,11 +1031,11 @@ def build_create_dns_service_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "dnsServiceId": _SERIALIZER.url("dns_service_id", dns_service_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1058,7 +1054,7 @@ def build_update_dns_service_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1072,11 +1068,11 @@ def build_update_dns_service_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "dnsServiceId": _SERIALIZER.url("dns_service_id", dns_service_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1095,7 +1091,7 @@ def build_delete_dns_service_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1109,10 +1105,10 @@ def build_delete_dns_service_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "dnsServiceId": _SERIALIZER.url("dns_service_id", dns_service_id, "str"), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1129,7 +1125,7 @@ def build_list_dns_zones_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1142,10 +1138,10 @@ def build_list_dns_zones_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1162,7 +1158,7 @@ def build_get_dns_zone_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1175,11 +1171,11 @@ def build_get_dns_zone_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "dnsZoneId": _SERIALIZER.url("dns_zone_id", dns_zone_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1196,7 +1192,7 @@ def build_create_dns_zone_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1210,11 +1206,11 @@ def build_create_dns_zone_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "dnsZoneId": _SERIALIZER.url("dns_zone_id", dns_zone_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1233,7 +1229,7 @@ def build_update_dns_zone_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1247,11 +1243,11 @@ def build_update_dns_zone_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "dnsZoneId": _SERIALIZER.url("dns_zone_id", dns_zone_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1270,7 +1266,7 @@ def build_delete_dns_zone_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1284,10 +1280,10 @@ def build_delete_dns_zone_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "dnsZoneId": _SERIALIZER.url("dns_zone_id", dns_zone_id, "str"), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1304,7 +1300,7 @@ def build_list_public_i_ps_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1317,10 +1313,10 @@ def build_list_public_i_ps_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1337,7 +1333,7 @@ def build_get_public_ip_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1350,11 +1346,11 @@ def build_get_public_ip_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "publicIPId": _SERIALIZER.url("public_ip_id", public_ip_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1371,7 +1367,7 @@ def build_create_public_ip_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1385,11 +1381,11 @@ def build_create_public_ip_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "publicIPId": _SERIALIZER.url("public_ip_id", public_ip_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1408,7 +1404,7 @@ def build_delete_public_ip_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1422,10 +1418,10 @@ def build_delete_public_ip_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "publicIPId": _SERIALIZER.url("public_ip_id", public_ip_id, "str"), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1491,9 +1487,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetwork] = kwargs.pop("cls", None) request = build_get_request( @@ -1509,15 +1503,17 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetwork", pipeline_response) @@ -1551,9 +1547,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkList] = kwargs.pop("cls", None) error_map = { @@ -1607,14 +1601,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1646,9 +1642,7 @@ def list_segments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkSegmentsList] = kwargs.pop("cls", None) error_map = { @@ -1702,14 +1696,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1751,9 +1747,7 @@ def get_segment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) request = build_get_segment_request( @@ -1769,15 +1763,17 @@ def get_segment( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) @@ -1809,16 +1805,14 @@ def _create_segments_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_segment, (IO, bytes)): + if isinstance(workload_network_segment, (IOBase, bytes)): _content = workload_network_segment else: _json = self._serialize.body(workload_network_segment, "WorkloadNetworkSegment") @@ -1839,15 +1833,17 @@ def _create_segments_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) @@ -1969,7 +1965,8 @@ def begin_create_segments( :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. Required. :type segment_id: str - :param workload_network_segment: NSX Segment. Is either a model type or a IO type. Required. + :param workload_network_segment: NSX Segment. Is either a WorkloadNetworkSegment type or a IO + type. Required. :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1990,9 +1987,7 @@ def begin_create_segments( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2057,16 +2052,14 @@ def _update_segments_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadNetworkSegment]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_segment, (IO, bytes)): + if isinstance(workload_network_segment, (IOBase, bytes)): _content = workload_network_segment else: _json = self._serialize.body(workload_network_segment, "WorkloadNetworkSegment") @@ -2087,15 +2080,17 @@ def _update_segments_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -2215,7 +2210,8 @@ def begin_update_segments( :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. Required. :type segment_id: str - :param workload_network_segment: NSX Segment. Is either a model type or a IO type. Required. + :param workload_network_segment: NSX Segment. Is either a WorkloadNetworkSegment type or a IO + type. Required. :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -2236,9 +2232,7 @@ def begin_update_segments( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2298,9 +2292,7 @@ def _delete_segment_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_segment_request( @@ -2316,15 +2308,17 @@ def _delete_segment_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -2364,9 +2358,7 @@ def begin_delete_segment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2428,9 +2420,7 @@ def list_dhcp( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDhcpList] = kwargs.pop("cls", None) error_map = { @@ -2484,14 +2474,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2532,9 +2524,7 @@ def get_dhcp( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) request = build_get_dhcp_request( @@ -2550,15 +2540,17 @@ def get_dhcp( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) @@ -2590,16 +2582,14 @@ def _create_dhcp_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dhcp, (IO, bytes)): + if isinstance(workload_network_dhcp, (IOBase, bytes)): _content = workload_network_dhcp else: _json = self._serialize.body(workload_network_dhcp, "WorkloadNetworkDhcp") @@ -2620,15 +2610,17 @@ def _create_dhcp_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) @@ -2747,7 +2739,8 @@ def begin_create_dhcp( :type private_cloud_name: str :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Is either a model type or a IO type. Required. + :param workload_network_dhcp: NSX DHCP. Is either a WorkloadNetworkDhcp type or a IO type. + Required. :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -2768,9 +2761,7 @@ def begin_create_dhcp( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2835,16 +2826,14 @@ def _update_dhcp_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadNetworkDhcp]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dhcp, (IO, bytes)): + if isinstance(workload_network_dhcp, (IOBase, bytes)): _content = workload_network_dhcp else: _json = self._serialize.body(workload_network_dhcp, "WorkloadNetworkDhcp") @@ -2865,15 +2854,17 @@ def _update_dhcp_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -2990,7 +2981,8 @@ def begin_update_dhcp( :type private_cloud_name: str :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Is either a model type or a IO type. Required. + :param workload_network_dhcp: NSX DHCP. Is either a WorkloadNetworkDhcp type or a IO type. + Required. :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -3011,9 +3003,7 @@ def begin_update_dhcp( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3073,9 +3063,7 @@ def _delete_dhcp_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_dhcp_request( @@ -3091,15 +3079,17 @@ def _delete_dhcp_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -3138,9 +3128,7 @@ def begin_delete_dhcp( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3203,9 +3191,7 @@ def list_gateways( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkGatewayList] = kwargs.pop("cls", None) error_map = { @@ -3259,14 +3245,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3308,9 +3296,7 @@ def get_gateway( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkGateway] = kwargs.pop("cls", None) request = build_get_gateway_request( @@ -3326,15 +3312,17 @@ def get_gateway( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkGateway", pipeline_response) @@ -3369,9 +3357,7 @@ def list_port_mirroring( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkPortMirroringList] = kwargs.pop("cls", None) error_map = { @@ -3425,14 +3411,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3474,9 +3462,7 @@ def get_port_mirroring( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) request = build_get_port_mirroring_request( @@ -3492,15 +3478,17 @@ def get_port_mirroring( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) @@ -3532,16 +3520,14 @@ def _create_port_mirroring_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_port_mirroring, (IO, bytes)): + if isinstance(workload_network_port_mirroring, (IOBase, bytes)): _content = workload_network_port_mirroring else: _json = self._serialize.body(workload_network_port_mirroring, "WorkloadNetworkPortMirroring") @@ -3562,15 +3548,17 @@ def _create_port_mirroring_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) @@ -3692,8 +3680,8 @@ def begin_create_port_mirroring( :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. Required. :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Is either a model type or a IO - type. Required. + :param workload_network_port_mirroring: NSX port mirroring. Is either a + WorkloadNetworkPortMirroring type or a IO type. Required. :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -3715,9 +3703,7 @@ def begin_create_port_mirroring( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3782,16 +3768,14 @@ def _update_port_mirroring_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadNetworkPortMirroring]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_port_mirroring, (IO, bytes)): + if isinstance(workload_network_port_mirroring, (IOBase, bytes)): _content = workload_network_port_mirroring else: _json = self._serialize.body(workload_network_port_mirroring, "WorkloadNetworkPortMirroring") @@ -3812,15 +3796,17 @@ def _update_port_mirroring_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -3940,8 +3926,8 @@ def begin_update_port_mirroring( :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. Required. :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Is either a model type or a IO - type. Required. + :param workload_network_port_mirroring: NSX port mirroring. Is either a + WorkloadNetworkPortMirroring type or a IO type. Required. :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -3963,9 +3949,7 @@ def begin_update_port_mirroring( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4025,9 +4009,7 @@ def _delete_port_mirroring_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_port_mirroring_request( @@ -4043,15 +4025,17 @@ def _delete_port_mirroring_initial( # pylint: disable=inconsistent-return-state request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -4091,9 +4075,7 @@ def begin_delete_port_mirroring( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4156,9 +4138,7 @@ def list_vm_groups( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkVMGroupsList] = kwargs.pop("cls", None) error_map = { @@ -4212,14 +4192,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4261,9 +4243,7 @@ def get_vm_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) request = build_get_vm_group_request( @@ -4279,15 +4259,17 @@ def get_vm_group( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) @@ -4319,16 +4301,14 @@ def _create_vm_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_vm_group, (IO, bytes)): + if isinstance(workload_network_vm_group, (IOBase, bytes)): _content = workload_network_vm_group else: _json = self._serialize.body(workload_network_vm_group, "WorkloadNetworkVMGroup") @@ -4349,15 +4329,17 @@ def _create_vm_group_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) @@ -4479,7 +4461,8 @@ def begin_create_vm_group( :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. Required. :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Is either a model type or a IO type. Required. + :param workload_network_vm_group: NSX VM Group. Is either a WorkloadNetworkVMGroup type or a IO + type. Required. :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -4500,9 +4483,7 @@ def begin_create_vm_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4567,16 +4548,14 @@ def _update_vm_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadNetworkVMGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_vm_group, (IO, bytes)): + if isinstance(workload_network_vm_group, (IOBase, bytes)): _content = workload_network_vm_group else: _json = self._serialize.body(workload_network_vm_group, "WorkloadNetworkVMGroup") @@ -4597,15 +4576,17 @@ def _update_vm_group_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -4725,7 +4706,8 @@ def begin_update_vm_group( :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. Required. :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Is either a model type or a IO type. Required. + :param workload_network_vm_group: NSX VM Group. Is either a WorkloadNetworkVMGroup type or a IO + type. Required. :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -4746,9 +4728,7 @@ def begin_update_vm_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4808,9 +4788,7 @@ def _delete_vm_group_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_vm_group_request( @@ -4826,15 +4804,17 @@ def _delete_vm_group_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -4874,9 +4854,7 @@ def begin_delete_vm_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4939,9 +4917,7 @@ def list_virtual_machines( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkVirtualMachinesList] = kwargs.pop("cls", None) error_map = { @@ -4995,14 +4971,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -5043,9 +5021,7 @@ def get_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkVirtualMachine] = kwargs.pop("cls", None) request = build_get_virtual_machine_request( @@ -5061,15 +5037,17 @@ def get_virtual_machine( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkVirtualMachine", pipeline_response) @@ -5104,9 +5082,7 @@ def list_dns_services( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDnsServicesList] = kwargs.pop("cls", None) error_map = { @@ -5160,14 +5136,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -5209,9 +5187,7 @@ def get_dns_service( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) request = build_get_dns_service_request( @@ -5227,15 +5203,17 @@ def get_dns_service( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) @@ -5267,16 +5245,14 @@ def _create_dns_service_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dns_service, (IO, bytes)): + if isinstance(workload_network_dns_service, (IOBase, bytes)): _content = workload_network_dns_service else: _json = self._serialize.body(workload_network_dns_service, "WorkloadNetworkDnsService") @@ -5297,15 +5273,17 @@ def _create_dns_service_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) @@ -5427,8 +5405,8 @@ def begin_create_dns_service( :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's display name. Required. :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Is either a model type or a IO type. - Required. + :param workload_network_dns_service: NSX DNS Service. Is either a WorkloadNetworkDnsService + type or a IO type. Required. :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -5449,9 +5427,7 @@ def begin_create_dns_service( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5516,16 +5492,14 @@ def _update_dns_service_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadNetworkDnsService]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dns_service, (IO, bytes)): + if isinstance(workload_network_dns_service, (IOBase, bytes)): _content = workload_network_dns_service else: _json = self._serialize.body(workload_network_dns_service, "WorkloadNetworkDnsService") @@ -5546,15 +5520,17 @@ def _update_dns_service_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -5674,8 +5650,8 @@ def begin_update_dns_service( :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's display name. Required. :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Is either a model type or a IO type. - Required. + :param workload_network_dns_service: NSX DNS Service. Is either a WorkloadNetworkDnsService + type or a IO type. Required. :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -5696,9 +5672,7 @@ def begin_update_dns_service( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5758,9 +5732,7 @@ def _delete_dns_service_initial( # pylint: disable=inconsistent-return-statemen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_dns_service_request( @@ -5776,15 +5748,17 @@ def _delete_dns_service_initial( # pylint: disable=inconsistent-return-statemen request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -5824,9 +5798,7 @@ def begin_delete_dns_service( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5889,9 +5861,7 @@ def list_dns_zones( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDnsZonesList] = kwargs.pop("cls", None) error_map = { @@ -5945,14 +5915,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -5994,9 +5966,7 @@ def get_dns_zone( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) request = build_get_dns_zone_request( @@ -6012,15 +5982,17 @@ def get_dns_zone( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) @@ -6052,16 +6024,14 @@ def _create_dns_zone_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dns_zone, (IO, bytes)): + if isinstance(workload_network_dns_zone, (IOBase, bytes)): _content = workload_network_dns_zone else: _json = self._serialize.body(workload_network_dns_zone, "WorkloadNetworkDnsZone") @@ -6082,15 +6052,17 @@ def _create_dns_zone_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) @@ -6212,7 +6184,8 @@ def begin_create_dns_zone( :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. Required. :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Is either a model type or a IO type. Required. + :param workload_network_dns_zone: NSX DNS Zone. Is either a WorkloadNetworkDnsZone type or a IO + type. Required. :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -6233,9 +6206,7 @@ def begin_create_dns_zone( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6300,16 +6271,14 @@ def _update_dns_zone_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadNetworkDnsZone]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dns_zone, (IO, bytes)): + if isinstance(workload_network_dns_zone, (IOBase, bytes)): _content = workload_network_dns_zone else: _json = self._serialize.body(workload_network_dns_zone, "WorkloadNetworkDnsZone") @@ -6330,15 +6299,17 @@ def _update_dns_zone_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -6458,7 +6429,8 @@ def begin_update_dns_zone( :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. Required. :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Is either a model type or a IO type. Required. + :param workload_network_dns_zone: NSX DNS Zone. Is either a WorkloadNetworkDnsZone type or a IO + type. Required. :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -6479,9 +6451,7 @@ def begin_update_dns_zone( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6541,9 +6511,7 @@ def _delete_dns_zone_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_dns_zone_request( @@ -6559,15 +6527,17 @@ def _delete_dns_zone_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -6607,9 +6577,7 @@ def begin_delete_dns_zone( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -6672,9 +6640,7 @@ def list_public_i_ps( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkPublicIPsList] = kwargs.pop("cls", None) error_map = { @@ -6728,14 +6694,16 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -6777,9 +6745,7 @@ def get_public_ip( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) request = build_get_public_ip_request( @@ -6795,15 +6761,17 @@ def get_public_ip( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) @@ -6835,16 +6803,14 @@ def _create_public_ip_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_public_ip, (IO, bytes)): + if isinstance(workload_network_public_ip, (IOBase, bytes)): _content = workload_network_public_ip else: _json = self._serialize.body(workload_network_public_ip, "WorkloadNetworkPublicIP") @@ -6865,15 +6831,17 @@ def _create_public_ip_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) @@ -6995,8 +6963,8 @@ def begin_create_public_ip( :param public_ip_id: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. Required. :type public_ip_id: str - :param workload_network_public_ip: NSX Public IP Block. Is either a model type or a IO type. - Required. + :param workload_network_public_ip: NSX Public IP Block. Is either a WorkloadNetworkPublicIP + type or a IO type. Required. :type workload_network_public_ip: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -7017,9 +6985,7 @@ def begin_create_public_ip( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7079,9 +7045,7 @@ def _delete_public_ip_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_public_ip_request( @@ -7097,15 +7061,17 @@ def _delete_public_ip_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -7145,9 +7111,7 @@ def begin_delete_public_ip( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_arc_reg.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_arc_reg.py index 9e4edf65b26bf..3f9a9dae8f254 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_arc_reg.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_arc_reg.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Addons_CreateOrUpdate_ArcReg.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_CreateOrUpdate_ArcReg.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx.py index 69b7f4b715adf..a5b3efa36e7bf 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Addons_CreateOrUpdate_HCX.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_CreateOrUpdate_HCX.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_srm.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_srm.py index d52f632692335..cd4d7867a8568 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_srm.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_srm.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Addons_CreateOrUpdate_SRM.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_CreateOrUpdate_SRM.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_vr.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_vr.py index 749eb88f99260..dad255dffa652 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_vr.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_vr.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Addons_CreateOrUpdate_VR.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_CreateOrUpdate_VR.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_delete.py index 2bf8084dd0f7c..7ffff0eabeb31 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.addons.begin_delete( + client.addons.begin_delete( resource_group_name="group1", private_cloud_name="cloud1", addon_name="srm", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Addons_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_arc_reg.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_arc_reg.py index 23a00a85de085..71fbac432c15d 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_arc_reg.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_arc_reg.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Addons_Get_ArcReg.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Get_ArcReg.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx.py index 0bcdfea40a11b..98d89aeb1a480 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Addons_Get_HCX.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Get_HCX.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_srm.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_srm.py index 36dcdf7fc1739..bfda9f69266e1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_srm.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_srm.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Addons_Get_SRM.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Get_SRM.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_vr.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_vr.py index 1fd1703e4e01d..a151b43acb114 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_vr.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_vr.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Addons_Get_VR.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Get_VR.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_list.py index 8451c511a5d99..eea6094762dd5 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Addons_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_delete.py index 88e6e0fa2d503..583598a6514cd 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.authorizations.begin_delete( + client.authorizations.begin_delete( resource_group_name="group1", private_cloud_name="cloud1", authorization_name="authorization1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Authorizations_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Authorizations_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_get.py index e1f9c1cc51e9a..f1ac08eb888cc 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Authorizations_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Authorizations_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_list.py index 23478b8d02682..1fb518c921520 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Authorizations_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Authorizations_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_create_or_update.py index 043d68c98093d..8f7987fce8844 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_create_or_update.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/CloudLinks_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/CloudLinks_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_delete.py index 0824ffbaf466d..28a16d80be2fb 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.cloud_links.begin_delete( + client.cloud_links.begin_delete( resource_group_name="group1", private_cloud_name="cloud1", cloud_link_name="cloudLink1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/CloudLinks_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/CloudLinks_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_get.py index fcde46f379069..2a5d24083fd35 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/CloudLinks_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/CloudLinks_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_list.py index 56968531f91de..e5f1a46deed4b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/CloudLinks_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/CloudLinks_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_create_or_update.py index f1e3a0b84a94d..121e47d604261 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_create_or_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Clusters_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_delete.py index c485ff111a397..d93c34a7aa5b0 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.clusters.begin_delete( + client.clusters.begin_delete( resource_group_name="group1", private_cloud_name="cloud1", cluster_name="cluster1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Clusters_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_get.py index 545ef239a651d..2f615c9ee17f0 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Clusters_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list.py index 455de4cd907b8..befc375cd66dd 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Clusters_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones.py index ff07aba88c063..1cbdc61e74e19 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Clusters_ListZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_ListZones.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones_stretched.py index 898cdd97c4307..d2310f861b442 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones_stretched.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Clusters_ListZones_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_ListZones_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_update.py index bad9ef0e7bc57..fa0a1af043426 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Clusters_Update.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_Update.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_create_or_update.py index 1678ae0f57ba5..9fa167c876686 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_create_or_update.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Datastores_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Datastores_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_delete.py index e1b4e17115c3c..522e25448fb8e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_delete.py @@ -29,15 +29,14 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.datastores.begin_delete( + client.datastores.begin_delete( resource_group_name="group1", private_cloud_name="cloud1", cluster_name="cluster1", datastore_name="datastore1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Datastores_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Datastores_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_get.py index c45e90aa5b02c..58180a2264834 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Datastores_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Datastores_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_list.py index f004fcfa6b3e2..70195e098e9b8 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Datastores_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Datastores_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_create_or_update.py index b2a1606cf5c60..e9690072c9c83 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_create_or_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/GlobalReachConnections_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/GlobalReachConnections_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_delete.py index 201a7e9a6ecbf..ad04cecf90ce7 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.global_reach_connections.begin_delete( + client.global_reach_connections.begin_delete( resource_group_name="group1", private_cloud_name="cloud1", global_reach_connection_name="connection1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/GlobalReachConnections_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/GlobalReachConnections_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_get.py index df1839be14062..a2639a3161067 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/GlobalReachConnections_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/GlobalReachConnections_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_list.py index 1dbc6c4f5a028..7d9a3af24bb05 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/GlobalReachConnections_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/GlobalReachConnections_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_delete.py index da66eea1ef6d7..77e55eac556b4 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.hcx_enterprise_sites.delete( + client.hcx_enterprise_sites.delete( resource_group_name="group1", private_cloud_name="cloud1", hcx_enterprise_site_name="site1", ) - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/HcxEnterpriseSites_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/HcxEnterpriseSites_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_get.py index e0d595819b221..2b2c0c790ab2c 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/HcxEnterpriseSites_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/HcxEnterpriseSites_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_list.py index 11ff2732e46c3..b9f2d84f9d11e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/HcxEnterpriseSites_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/HcxEnterpriseSites_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_quota_availability.py b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_quota_availability.py index 4b74ab73af76b..8f495af97d4f7 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_quota_availability.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_quota_availability.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Locations_CheckQuotaAvailability.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Locations_CheckQuotaAvailability.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability.py b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability.py index a116ba16c02f5..18fee98caa3db 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Locations_CheckTrialAvailability.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Locations_CheckTrialAvailability.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability_with_sku.py b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability_with_sku.py index 6f42531ea7dc9..3dd1f0430730e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability_with_sku.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability_with_sku.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Locations_CheckTrialAvailabilityWithSku.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Locations_CheckTrialAvailabilityWithSku.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/operations_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/operations_list.py index f7555eeb44188..9814ccd278ae4 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/operations_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/operations_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/Operations_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_create_or_update.py index 0ea0617ec3b3f..18ba649d6aeb4 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_create_or_update.py @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PlacementPolicies_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_delete.py index 04f4340456d70..222427577cbe1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_delete.py @@ -29,15 +29,14 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.placement_policies.begin_delete( + client.placement_policies.begin_delete( resource_group_name="group1", private_cloud_name="cloud1", cluster_name="cluster1", placement_policy_name="policy1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PlacementPolicies_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_get.py index 8c9ffef8b7db2..5f958fa4eed23 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PlacementPolicies_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_list.py index 0eeb23e8ca586..339327280b502 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PlacementPolicies_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_update.py index f84c70702442f..285880596e5be 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_update.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PlacementPolicies_Update.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_Update.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update.py index 8ba8f91117d1b..20dd3c7a17615 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched.py index 63df383ccf382..e3d66ec9cdadd 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_CreateOrUpdate_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_CreateOrUpdate_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_delete.py index ba003e831e370..64bcf10bd1e49 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.private_clouds.begin_delete( + client.private_clouds.begin_delete( resource_group_name="group1", private_cloud_name="cloud1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get.py index 64e76e98e552e..5c4756c3ca132 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get_stretched.py index f1f101a595b2a..d5e74608fcf44 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get_stretched.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_Get_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Get_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list.py index fed6a2b13a0b2..1742d81a3defa 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_admin_credentials.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_admin_credentials.py index 1f6df4caba3b3..c73f573f9420a 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_admin_credentials.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_admin_credentials.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_ListAdminCredentials.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_ListAdminCredentials.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription.py index 1f1f22248cd75..329f5550247b9 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_ListInSubscription.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_ListInSubscription.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription_stretched.py index c4f1d997c758c..959b9247b3371 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription_stretched.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_ListInSubscription_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_ListInSubscription_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_stretched.py index 88fa9fe0a0e4d..018e9bb4c7407 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_stretched.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_List_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_List_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_nsxt_password.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_nsxt_password.py index bc38d157df03f..8e5a0130bcc32 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_nsxt_password.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_nsxt_password.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.private_clouds.begin_rotate_nsxt_password( + client.private_clouds.begin_rotate_nsxt_password( resource_group_name="group1", private_cloud_name="cloud1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_RotateNsxtPassword.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_RotateNsxtPassword.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_vcenter_password.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_vcenter_password.py index 36c0145804914..c0e85efaa0ca3 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_vcenter_password.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_vcenter_password.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.private_clouds.begin_rotate_vcenter_password( + client.private_clouds.begin_rotate_vcenter_password( resource_group_name="group1", private_cloud_name="cloud1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_RotateVcenterPassword.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_RotateVcenterPassword.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update.py index a9b4ae8a76203..34fe1acfa6557 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_Update.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Update.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update_stretched.py index 5538e110f1c1b..d26f07fafe35a 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update_stretched.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/PrivateClouds_Update_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Update_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_get.py index 27f2d3e824461..87fd60f87eb18 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_get.py @@ -31,13 +31,13 @@ def main(): response = client.script_cmdlets.get( resource_group_name="group1", - private_cloud_name="{privateCloudName}", - script_package_name="{scriptPackageName}", + private_cloud_name="cloud1", + script_package_name="package@1.0.2", script_cmdlet_name="New-ExternalSsoDomain", ) print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/ScriptCmdlets_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptCmdlets_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_list.py index 72792058be3d0..2647a8ad06d46 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_list.py @@ -31,13 +31,13 @@ def main(): response = client.script_cmdlets.list( resource_group_name="group1", - private_cloud_name="{privateCloudName}", - script_package_name="{scriptPackageName}", + private_cloud_name="cloud1", + script_package_name="package@1.0.2", ) for item in response: print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/ScriptCmdlets_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptCmdlets_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_create_or_update.py index a978615c32830..f29bcf9fd981b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_create_or_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/ScriptExecutions_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_delete.py index 6ce6820e781b1..352e15cd1e8a9 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.script_executions.begin_delete( + client.script_executions.begin_delete( resource_group_name="group1", private_cloud_name="cloud1", - script_execution_name="{scriptExecutionName}", + script_execution_name="addSsoServer", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/ScriptExecutions_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get.py index 5a36bc8ec3631..85abfb249bef0 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/ScriptExecutions_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get_execution_logs.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get_execution_logs.py index bd9a7d0ab457a..7aa338029cdd6 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get_execution_logs.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get_execution_logs.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/ScriptExecutions_GetExecutionLogs.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_GetExecutionLogs.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_list.py index dcf13e042b445..c8f2debf19d19 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_list.py @@ -31,12 +31,12 @@ def main(): response = client.script_executions.list( resource_group_name="group1", - private_cloud_name="{privateCloudName}", + private_cloud_name="cloud1", ) for item in response: print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/ScriptExecutions_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_get.py index 3ac0f82ef4d33..5a84f40dbd953 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_get.py @@ -31,12 +31,12 @@ def main(): response = client.script_packages.get( resource_group_name="group1", - private_cloud_name="{privateCloudName}", - script_package_name="{scriptPackageName}", + private_cloud_name="cloud1", + script_package_name="Microsoft.AVS.Management@3.0.48", ) print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/ScriptPackages_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptPackages_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_list.py index 2b6b14955ee06..acb15bbdc8e78 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_list.py @@ -31,12 +31,12 @@ def main(): response = client.script_packages.list( resource_group_name="group1", - private_cloud_name="{privateCloudName}", + private_cloud_name="cloud1", ) for item in response: print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/ScriptPackages_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptPackages_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_get.py index 890ecebcd2caf..dbde0e93189fd 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/VirtualMachines_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/VirtualMachines_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_list.py index 02fc3514da635..7d20d2ff75cd7 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/VirtualMachines_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/VirtualMachines_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_restrict_movement.py b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_restrict_movement.py index 61477f2687cd8..46b7f6095b127 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_restrict_movement.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_restrict_movement.py @@ -29,16 +29,15 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.virtual_machines.begin_restrict_movement( + client.virtual_machines.begin_restrict_movement( resource_group_name="group1", private_cloud_name="cloud1", cluster_name="cluster1", virtual_machine_id="vm-209", restrict_movement={"restrictMovement": "Enabled"}, ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/VirtualMachines_RestrictMovement.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/VirtualMachines_RestrictMovement.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp_configurations.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp_configurations.py index b22c677fdbf88..e64fc5e63a2cb 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp_configurations.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp_configurations.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_CreateDhcpConfigurations.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateDhcpConfigurations.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_services.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_services.py index 0afe412003ba5..66241173c64cb 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_services.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_services.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_CreateDnsServices.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateDnsServices.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zones.py index 413dbfc5503fc..6bf48554d91de 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zones.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_CreateDnsZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateDnsZones.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring_profiles.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring_profiles.py index ffa91c2aafc36..e7a677b0c6dd8 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring_profiles.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring_profiles.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_CreatePortMirroringProfiles.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreatePortMirroringProfiles.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_segments.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_segments.py index b1c8343be6a34..a5533302bdb8f 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_segments.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_segments.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_CreateSegments.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateSegments.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_public_ips.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_vm_groups.py similarity index 74% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_public_ips.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_vm_groups.py index c96d2f11b8bea..97ec4a11354a6 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_public_ips.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_vm_groups.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_get_public_ips.py + python workload_networks_create_vm_groups.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -29,14 +29,21 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.workload_networks.get_public_ip( + response = client.workload_networks.begin_create_vm_group( resource_group_name="group1", private_cloud_name="cloud1", - public_ip_id="publicIP1", - ) + vm_group_id="vmGroup1", + workload_network_vm_group={ + "properties": { + "displayName": "vmGroup1", + "members": ["564d43da-fefc-2a3b-1d92-42855622fa50"], + "revision": 1, + } + }, + ).result() print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_GetPublicIPs.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateVMGroups.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp_configurations.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp_configurations.py index 83dec2349747b..e609dad697aa5 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp_configurations.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp_configurations.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.workload_networks.begin_delete_dhcp( + client.workload_networks.begin_delete_dhcp( resource_group_name="group1", private_cloud_name="cloud1", dhcp_id="dhcp1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_DeleteDhcpConfigurations.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteDhcpConfigurations.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_services.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_services.py index a52413ffdbc71..b02f950ed69b9 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_services.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_services.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.workload_networks.begin_delete_dns_service( + client.workload_networks.begin_delete_dns_service( resource_group_name="group1", dns_service_id="dnsService1", private_cloud_name="cloud1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_DeleteDnsServices.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteDnsServices.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zones.py index e0252ef1babfa..e7bbfe2379150 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zones.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.workload_networks.begin_delete_dns_zone( + client.workload_networks.begin_delete_dns_zone( resource_group_name="group1", dns_zone_id="dnsZone1", private_cloud_name="cloud1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_DeleteDnsZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteDnsZones.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring_profiles.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring_profiles.py index ac17e6192171b..ef77220dfe286 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring_profiles.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring_profiles.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.workload_networks.begin_delete_port_mirroring( + client.workload_networks.begin_delete_port_mirroring( resource_group_name="group1", port_mirroring_id="portMirroring1", private_cloud_name="cloud1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_DeletePortMirroringProfiles.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeletePortMirroringProfiles.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segments.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segments.py index fc4f5300336cd..bb3144e51b7e6 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segments.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segments.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.workload_networks.begin_delete_segment( + client.workload_networks.begin_delete_segment( resource_group_name="group1", private_cloud_name="cloud1", segment_id="segment1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_DeleteSegments.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteSegments.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_groups.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_groups.py index 7561ce67d0c09..360f811ab43d1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_groups.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_groups.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.workload_networks.begin_delete_vm_group( + client.workload_networks.begin_delete_vm_group( resource_group_name="group1", vm_group_id="vmGroup1", private_cloud_name="cloud1", ).result() - print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_DeleteVMGroups.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteVMGroups.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get.py index 60db6d3b5326e..d4bee508c1622 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp_configurations.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp_configurations.py index 515443904f0c5..e053eb758a035 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp_configurations.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp_configurations.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_GetDhcpConfigurations.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetDhcpConfigurations.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_services.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_services.py index 894861af0b4ea..865877e3f1c0c 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_services.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_services.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_GetDnsServices.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetDnsServices.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zones.py index 5e5404919fb91..9c3d86c26187d 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zones.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_GetDnsZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetDnsZones.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_gateway.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_gateway.py index 20e9a32716c75..8831a501a995d 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_gateway.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_gateway.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_GetGateway.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetGateway.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring_profiles.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring_profiles.py index 95b1c3f3d577e..8d496c2438e1b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring_profiles.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring_profiles.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_GetPortMirroringProfiles.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetPortMirroringProfiles.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segments.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segments.py index 20514f2f6e8e2..61099130bd5fe 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segments.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segments.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_GetSegments.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetSegments.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_virtual_machine.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_virtual_machine.py index 4018e060d6600..d8ff8718d1ef6 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_virtual_machine.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_virtual_machine.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_GetVirtualMachine.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetVirtualMachine.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_groups.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_groups.py index 8ead7829e57b3..afffc7ce7a844 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_groups.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_groups.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_GetVMGroups.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetVMGroups.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list.py index 613e2cea547f6..bc563948f2042 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp_configurations.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp_configurations.py index 6605ac31beed6..b83e642c70f4b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp_configurations.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp_configurations.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_ListDhcpConfigurations.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListDhcpConfigurations.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_services.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_services.py index 8219da1ce85a6..e92222ba29d81 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_services.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_services.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_ListDnsServices.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListDnsServices.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_zones.py index 2bc5f0e78e23f..58293e5eda627 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_zones.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_ListDnsZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListDnsZones.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_gateways.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_gateways.py index 978d7b95683e9..1928d16fb2904 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_gateways.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_gateways.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_ListGateways.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListGateways.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring_profiles.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring_profiles.py index 0d44477bb11c8..b8ddb568a4f7f 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring_profiles.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring_profiles.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_ListPortMirroringProfiles.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListPortMirroringProfiles.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_public_ips.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_public_ips.py index fa7cea5c07e13..fb3af3f5691b6 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_public_ips.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_public_ips.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_ListPublicIPs.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListPublicIPs.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_segments.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_segments.py index f4cfe5f8f4d00..0604b151accf8 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_segments.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_segments.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_ListSegments.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListSegments.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_virtual_machines.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_virtual_machines.py index 5c0476b45004e..f34f1e20a8a78 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_virtual_machines.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_virtual_machines.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_ListVirtualMachines.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListVirtualMachines.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_vm_groups.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_vm_groups.py index 967280ab6e38b..8c5d7ce91fbb2 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_vm_groups.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_vm_groups.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_ListVMGroups.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListVMGroups.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp_configurations.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp_configurations.py index ca1021af6eb30..8e4a93b5ab0e1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp_configurations.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp_configurations.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_UpdateDhcpConfigurations.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateDhcpConfigurations.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_services.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_services.py index 03d60e16eb869..8e1a57120a5f3 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_services.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_services.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_UpdateDnsServices.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateDnsServices.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zones.py index 483afe1f95209..b6eee6037b5c4 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zones.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_UpdateDnsZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateDnsZones.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring_profiles.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring_profiles.py index b060984bbc34e..2b061f61e1d05 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring_profiles.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring_profiles.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_UpdatePortMirroringProfiles.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdatePortMirroringProfiles.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_segments.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_segments.py index f78bfbd5bb9ba..40851c0f9d7e2 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_segments.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_segments.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_UpdateSegments.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateSegments.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_public_ips.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_vm_groups.py similarity index 80% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_public_ips.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_vm_groups.py index 009f0b0b463ab..f203352c5a2c8 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_public_ips.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_vm_groups.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_delete_public_ips.py + python workload_networks_update_vm_groups.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -29,14 +29,15 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.workload_networks.begin_delete_public_ip( + response = client.workload_networks.begin_update_vm_group( resource_group_name="group1", - public_ip_id="publicIP1", private_cloud_name="cloud1", + vm_group_id="vmGroup1", + workload_network_vm_group={"properties": {"members": ["564d43da-fefc-2a3b-1d92-42855622fa50"], "revision": 1}}, ).result() print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2022-05-01/examples/WorkloadNetworks_DeletePublicIPs.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateVMGroups.json if __name__ == "__main__": main()