From 6c322edb2c294a8c24f6bfa52b2caf546b43dd2c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 22 Mar 2023 01:58:39 +0000 Subject: [PATCH] CodeGen from PR 23208 in Azure/azure-rest-api-specs Merge b6b8b17fb388324cdf042a4cd863789aa7f53626 into b1806afc5064a18eca79fa14137bccc94937f88f --- .../azure-mgmt-resourceconnector/_meta.json | 6 +- .../azure/mgmt/resourceconnector/__init__.py | 4 +- .../mgmt/resourceconnector/_configuration.py | 6 +- ....py => _resource_connector_mgmt_client.py} | 14 +-- .../mgmt/resourceconnector/_serialization.py | 87 ++++++++++++------- .../azure/mgmt/resourceconnector/_vendor.py | 5 +- .../azure/mgmt/resourceconnector/_version.py | 2 +- .../mgmt/resourceconnector/aio/__init__.py | 4 +- .../resourceconnector/aio/_configuration.py | 6 +- ....py => _resource_connector_mgmt_client.py} | 14 +-- .../aio/operations/_appliances_operations.py | 39 ++++++--- .../mgmt/resourceconnector/models/__init__.py | 16 ++-- .../resourceconnector/models/_models_py3.py | 69 ++++++++------- ... _resource_connector_mgmt_client_enums.py} | 0 .../operations/_appliances_operations.py | 39 ++++++--- .../appliances_create_update.py | 4 +- .../generated_samples/appliances_delete.py | 4 +- .../generated_samples/appliances_get.py | 4 +- .../appliances_list_by_resource_group.py | 4 +- .../appliances_list_by_subscription.py | 4 +- ...appliances_list_cluster_user_credential.py | 4 +- .../generated_samples/appliances_list_keys.py | 4 +- .../appliances_list_operations.py | 4 +- .../generated_samples/appliances_patch.py | 4 +- .../generated_samples/telemetry_config.py | 4 +- .../generated_samples/upgrade_graph.py | 4 +- 26 files changed, 209 insertions(+), 146 deletions(-) rename sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/{_appliances.py => _resource_connector_mgmt_client.py} (87%) rename sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/{_appliances.py => _resource_connector_mgmt_client.py} (86%) rename sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/models/{_appliances_enums.py => _resource_connector_mgmt_client_enums.py} (100%) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/_meta.json b/sdk/resourceconnector/azure-mgmt-resourceconnector/_meta.json index 6effdc4c658b..b15d230e20e0 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/_meta.json +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/_meta.json @@ -1,11 +1,11 @@ { - "commit": "23b62d4e4dab07dccda851cfe50f6c6afb705a3b", + "commit": "6f9f06366a155b0801e1837a6201439992a32f7f", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.7", + "@autorest/python@6.4.3", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/resourceconnector/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/resourceconnector/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.4.3 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/resourceconnector/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/__init__.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/__init__.py index 7ccd3ca9df5f..417696cd56e4 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/__init__.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._appliances import Appliances +from ._resource_connector_mgmt_client import ResourceConnectorMgmtClient from ._version import VERSION __version__ = VERSION @@ -19,7 +19,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "Appliances", + "ResourceConnectorMgmtClient", ] __all__.extend([p for p in _patch_all if p not in __all__]) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_configuration.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_configuration.py index 4046c507f111..cb0751bb3a09 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_configuration.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_configuration.py @@ -25,8 +25,8 @@ from azure.core.credentials import TokenCredential -class AppliancesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for Appliances. +class ResourceConnectorMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for ResourceConnectorMgmtClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -41,7 +41,7 @@ class AppliancesConfiguration(Configuration): # pylint: disable=too-many-instan """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppliancesConfiguration, self).__init__(**kwargs) + super(ResourceConnectorMgmtClientConfiguration, self).__init__(**kwargs) api_version: Literal["2022-10-27"] = kwargs.pop("api_version", "2022-10-27") if credential is None: diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_appliances.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_resource_connector_mgmt_client.py similarity index 87% rename from sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_appliances.py rename to sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_resource_connector_mgmt_client.py index 6129a1984ebd..9acd949d88d3 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_appliances.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_resource_connector_mgmt_client.py @@ -13,7 +13,7 @@ from azure.mgmt.core import ARMPipelineClient from . import models as _models -from ._configuration import AppliancesConfiguration +from ._configuration import ResourceConnectorMgmtClientConfiguration from ._serialization import Deserializer, Serializer from .operations import AppliancesOperations @@ -22,7 +22,7 @@ from azure.core.credentials import TokenCredential -class Appliances: # pylint: disable=client-accepts-api-version-keyword +class ResourceConnectorMgmtClient: # pylint: disable=client-accepts-api-version-keyword """The appliances Rest API spec. :ivar appliances: AppliancesOperations operations @@ -47,8 +47,10 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = AppliancesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = ResourceConnectorMgmtClientConfiguration( + credential=credential, subscription_id=subscription_id, **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) @@ -81,9 +83,9 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: def close(self) -> None: self._client.close() - def __enter__(self) -> "Appliances": + def __enter__(self) -> "ResourceConnectorMgmtClient": 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/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_serialization.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_serialization.py index 2c170e28dbca..f17c068e833e 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_serialization.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_serialization.py @@ -38,7 +38,22 @@ import re import sys import codecs -from typing import Optional, Union, AnyStr, IO, Mapping +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) try: from urllib import quote # type: ignore @@ -48,12 +63,14 @@ import isodate # type: ignore -from typing import Dict, Any, cast - from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + class RawDeserializer: @@ -277,8 +294,8 @@ class Model(object): _attribute_map: Dict[str, Dict[str, Any]] = {} _validation: Dict[str, Dict[str, Any]] = {} - def __init__(self, **kwargs): - self.additional_properties = {} + def __init__(self, **kwargs: Any) -> None: + self.additional_properties: Dict[str, Any] = {} for k in kwargs: if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -287,25 +304,25 @@ def __init__(self, **kwargs): else: setattr(self, k, kwargs[k]) - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" return not self.__eq__(other) - def __str__(self): + def __str__(self) -> str: return str(self.__dict__) @classmethod - def enable_additional_properties_sending(cls): + def enable_additional_properties_sending(cls) -> None: cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} @classmethod - def is_xml_model(cls): + def is_xml_model(cls) -> bool: try: cls._xml_map # type: ignore except AttributeError: @@ -322,7 +339,7 @@ def _create_xml_node(cls): return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - def serialize(self, keep_readonly=False, **kwargs): + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: """Return the JSON that would be sent to azure from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -336,8 +353,13 @@ def serialize(self, keep_readonly=False, **kwargs): serializer = Serializer(self._infer_class_models()) return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) - def as_dict(self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs): - """Return a dict that can be JSONify using json.dump. + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: @@ -384,7 +406,7 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls, data, content_type=None): + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. @@ -396,7 +418,12 @@ def deserialize(cls, data, content_type=None): return deserializer(cls.__name__, data, content_type=content_type) @classmethod - def from_dict(cls, data, key_extractors=None, content_type=None): + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: """Parse a dict using given key extractor return a model. By default consider key @@ -409,8 +436,8 @@ def from_dict(cls, data, key_extractors=None, content_type=None): :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( - [ + deserializer.key_extractors = ( # type: ignore + [ # type: ignore attribute_key_case_insensitive_extractor, rest_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, @@ -518,7 +545,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -534,7 +561,7 @@ def __init__(self, classes=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -626,8 +653,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized.append(local_node) # type: ignore else: # JSON for k in reversed(keys): # type: ignore - unflattened = {k: new_attr} - new_attr = unflattened + new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized @@ -656,8 +682,8 @@ def body(self, data, data_type, **kwargs): """ # Just in case this is a dict - internal_data_type = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type, None) + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: @@ -777,6 +803,8 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: + if data is AzureCoreNull: + return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -1161,7 +1189,8 @@ def rest_key_extractor(attr, attr_desc, data): working_data = data while "." in key: - dict_keys = _FLATTEN.split(key) + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1332,7 +1361,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1352,7 +1381,7 @@ def __init__(self, classes=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1471,7 +1500,7 @@ def _classify_target(self, target, data): Once classification has been determined, initialize object. :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. """ if target is None: return None, None @@ -1486,7 +1515,7 @@ def _classify_target(self, target, data): target = target._classify(data, self.dependencies) except AttributeError: pass # Target is not a Model, no classify - return target, target.__class__.__name__ + return target, target.__class__.__name__ # type: ignore def failsafe_deserialize(self, target_obj, data, content_type=None): """Ignores any errors encountered in deserialization, @@ -1496,7 +1525,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): a deserialization error. :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. """ try: diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_vendor.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_vendor.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_vendor.py @@ -5,6 +5,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import List, cast + from azure.core.pipeline.transport import HttpRequest @@ -22,6 +24,7 @@ def _format_url_section(template, **kwargs): try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_version.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_version.py index 20971492f129..e5754a47ce68 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_version.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b3" +VERSION = "1.0.0b1" diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/__init__.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/__init__.py index 592e502ed736..b75bc89845c2 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/__init__.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._appliances import Appliances +from ._resource_connector_mgmt_client import ResourceConnectorMgmtClient try: from ._patch import __all__ as _patch_all @@ -16,7 +16,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "Appliances", + "ResourceConnectorMgmtClient", ] __all__.extend([p for p in _patch_all if p not in __all__]) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/_configuration.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/_configuration.py index ecd73c38559f..9b75318b9fcb 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/_configuration.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/_configuration.py @@ -25,8 +25,8 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppliancesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for Appliances. +class ResourceConnectorMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for ResourceConnectorMgmtClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -41,7 +41,7 @@ class AppliancesConfiguration(Configuration): # pylint: disable=too-many-instan """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppliancesConfiguration, self).__init__(**kwargs) + super(ResourceConnectorMgmtClientConfiguration, self).__init__(**kwargs) api_version: Literal["2022-10-27"] = kwargs.pop("api_version", "2022-10-27") if credential is None: diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/_appliances.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/_resource_connector_mgmt_client.py similarity index 86% rename from sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/_appliances.py rename to sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/_resource_connector_mgmt_client.py index 2b11f03690e7..99ada5481c7b 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/_appliances.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/_resource_connector_mgmt_client.py @@ -14,7 +14,7 @@ from .. import models as _models from .._serialization import Deserializer, Serializer -from ._configuration import AppliancesConfiguration +from ._configuration import ResourceConnectorMgmtClientConfiguration from .operations import AppliancesOperations if TYPE_CHECKING: @@ -22,7 +22,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class Appliances: # pylint: disable=client-accepts-api-version-keyword +class ResourceConnectorMgmtClient: # pylint: disable=client-accepts-api-version-keyword """The appliances Rest API spec. :ivar appliances: AppliancesOperations operations @@ -47,8 +47,10 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = AppliancesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = ResourceConnectorMgmtClientConfiguration( + credential=credential, subscription_id=subscription_id, **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) @@ -81,9 +83,9 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "Appliances": + async def __aenter__(self) -> "ResourceConnectorMgmtClient": 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/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/operations/_appliances_operations.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/operations/_appliances_operations.py index 68b823320827..bc7e0bf87bf6 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/operations/_appliances_operations.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/aio/operations/_appliances_operations.py @@ -59,7 +59,7 @@ class AppliancesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.resourceconnector.aio.Appliances`'s + :class:`~azure.mgmt.resourceconnector.aio.ResourceConnectorMgmtClient`'s :attr:`appliances` attribute. """ @@ -138,8 +138,9 @@ 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 @@ -223,8 +224,9 @@ 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 @@ -278,8 +280,9 @@ async def get_telemetry_config(self, **kwargs: Any) -> _models.ApplianceGetTelem 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 @@ -373,8 +376,9 @@ 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 @@ -435,8 +439,9 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) 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 @@ -500,8 +505,9 @@ 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 @@ -615,8 +621,8 @@ async def begin_create_or_update( :type resource_group_name: str :param resource_name: Appliances name. Required. :type resource_name: str - :param parameters: Parameters supplied to create or update an Appliance. Is either a model type - or a IO type. Required. + :param parameters: Parameters supplied to create or update an Appliance. Is either a Appliance + type or a IO type. Required. :type parameters: ~azure.mgmt.resourceconnector.models.Appliance or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -718,8 +724,9 @@ 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 @@ -862,8 +869,9 @@ async def 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 @@ -930,8 +938,9 @@ async def list_cluster_user_credential( 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 @@ -998,8 +1007,9 @@ async def list_keys( 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 @@ -1070,8 +1080,9 @@ async def get_upgrade_graph( 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 diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/models/__init__.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/models/__init__.py index e01069f234bc..5151e791dfb1 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/models/__init__.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/models/__init__.py @@ -33,14 +33,14 @@ from ._models_py3 import UpgradeGraph from ._models_py3 import UpgradeGraphProperties -from ._appliances_enums import AccessProfileType -from ._appliances_enums import ArtifactType -from ._appliances_enums import CreatedByType -from ._appliances_enums import Distro -from ._appliances_enums import Provider -from ._appliances_enums import ResourceIdentityType -from ._appliances_enums import SSHKeyType -from ._appliances_enums import Status +from ._resource_connector_mgmt_client_enums import AccessProfileType +from ._resource_connector_mgmt_client_enums import ArtifactType +from ._resource_connector_mgmt_client_enums import CreatedByType +from ._resource_connector_mgmt_client_enums import Distro +from ._resource_connector_mgmt_client_enums import Provider +from ._resource_connector_mgmt_client_enums import ResourceIdentityType +from ._resource_connector_mgmt_client_enums import SSHKeyType +from ._resource_connector_mgmt_client_enums import Status from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/models/_models_py3.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/models/_models_py3.py index e65f13aa1577..82f00321a32c 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/models/_models_py3.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/models/_models_py3.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from .. import _serialization @@ -49,7 +49,7 @@ class Resource(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -59,7 +59,8 @@ def __init__(self, **kwargs): class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. @@ -99,7 +100,7 @@ class TrackedResource(Resource): "location": {"key": "location", "type": "str"}, } - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -197,8 +198,8 @@ def __init__( infrastructure_config: Optional["_models.AppliancePropertiesInfrastructureConfig"] = None, public_key: Optional[str] = None, version: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -249,7 +250,7 @@ class ApplianceCredentialKubeconfig(_serialization.Model): "value": {"key": "value", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -273,7 +274,7 @@ class ApplianceGetTelemetryConfigResult(_serialization.Model): "telemetry_instrumentation_key": {"key": "telemetryInstrumentationKey", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.telemetry_instrumentation_key = None @@ -301,7 +302,7 @@ class ApplianceListCredentialResults(_serialization.Model): "kubeconfigs": {"key": "kubeconfigs", "type": "[ApplianceCredentialKubeconfig]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.hybrid_connection_config = None @@ -334,7 +335,7 @@ class ApplianceListKeysResults(_serialization.Model): "ssh_keys": {"key": "sshKeys", "type": "{SSHKey}"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.artifact_profiles = None @@ -363,7 +364,7 @@ class ApplianceListResult(_serialization.Model): "value": {"key": "value", "type": "[Appliance]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.next_link = None @@ -411,7 +412,7 @@ class ApplianceOperation(_serialization.Model): "resource": {"key": "display.resource", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.is_data_action = None @@ -443,7 +444,9 @@ class ApplianceOperationsList(_serialization.Model): "value": {"key": "value", "type": "[ApplianceOperation]"}, } - def __init__(self, *, value: List["_models.ApplianceOperation"], next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: List["_models.ApplianceOperation"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword next_link: Next page of operations. :paramtype next_link: str @@ -467,7 +470,7 @@ class AppliancePropertiesInfrastructureConfig(_serialization.Model): "provider": {"key": "provider", "type": "str"}, } - def __init__(self, *, provider: Optional[Union[str, "_models.Provider"]] = None, **kwargs): + def __init__(self, *, provider: Optional[Union[str, "_models.Provider"]] = None, **kwargs: Any) -> None: """ :keyword provider: Information about the connected appliance. Known values are: "VMWare", "HCI", "SCVMM", "KubeVirt", and "OpenStack". @@ -494,7 +497,7 @@ class ArtifactProfile(_serialization.Model): "endpoint": {"key": "endpoint", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.endpoint = None @@ -521,7 +524,7 @@ class ErrorAdditionalInfo(_serialization.Model): "info": {"key": "info", "type": "object"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.type = None @@ -561,7 +564,7 @@ class ErrorDetail(_serialization.Model): "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -572,7 +575,8 @@ def __init__(self, **kwargs): class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). :ivar error: The error object. :vartype error: ~azure.mgmt.resourceconnector.models.ErrorDetail @@ -582,7 +586,7 @@ class ErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: """ :keyword error: The error object. :paramtype error: ~azure.mgmt.resourceconnector.models.ErrorDetail @@ -592,7 +596,8 @@ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs): class HybridConnectionConfig(_serialization.Model): - """Contains the REP (rendezvous endpoint) and “Listener” access token from notification service (NS). + """Contains the REP (rendezvous endpoint) and “Listener” access token from notification service + (NS). Variables are only populated by the server, and will be ignored when sending a request. @@ -620,7 +625,7 @@ class HybridConnectionConfig(_serialization.Model): "token": {"key": "token", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.expiration_time = None @@ -653,7 +658,7 @@ class Identity(_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 identity type. Known values are: "SystemAssigned" and "None". :paramtype type: str or ~azure.mgmt.resourceconnector.models.ResourceIdentityType @@ -675,7 +680,7 @@ class PatchableAppliance(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -717,7 +722,7 @@ class SSHKey(_serialization.Model): "public_key": {"key": "publicKey", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.certificate = None @@ -748,7 +753,7 @@ class SupportedVersion(_serialization.Model): "version": {"key": "version", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.metadata = None @@ -780,7 +785,7 @@ class SupportedVersionCatalogVersion(_serialization.Model): "namespace": {"key": "namespace", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.data = None @@ -817,7 +822,7 @@ class SupportedVersionCatalogVersionData(_serialization.Model): "version": {"key": "version", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.audience = None @@ -843,7 +848,7 @@ class SupportedVersionMetadata(_serialization.Model): "catalog_version": {"key": "catalogVersion", "type": "SupportedVersionCatalogVersion"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.catalog_version = None @@ -886,8 +891,8 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -937,7 +942,7 @@ class UpgradeGraph(_serialization.Model): "properties": {"key": "properties", "type": "UpgradeGraphProperties"}, } - def __init__(self, *, properties: Optional["_models.UpgradeGraphProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.UpgradeGraphProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: The properties of supported version. :paramtype properties: ~azure.mgmt.resourceconnector.models.UpgradeGraphProperties @@ -969,7 +974,7 @@ class UpgradeGraphProperties(_serialization.Model): "supported_versions": {"key": "supportedVersions", "type": "[SupportedVersion]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.appliance_version = None diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/models/_appliances_enums.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/models/_resource_connector_mgmt_client_enums.py similarity index 100% rename from sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/models/_appliances_enums.py rename to sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/models/_resource_connector_mgmt_client_enums.py diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/operations/_appliances_operations.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/operations/_appliances_operations.py index 3167b0b71b76..578d570568f3 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/operations/_appliances_operations.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/azure/mgmt/resourceconnector/operations/_appliances_operations.py @@ -435,7 +435,7 @@ class AppliancesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.resourceconnector.Appliances`'s + :class:`~azure.mgmt.resourceconnector.ResourceConnectorMgmtClient`'s :attr:`appliances` attribute. """ @@ -513,8 +513,9 @@ 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 @@ -598,8 +599,9 @@ 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 @@ -653,8 +655,9 @@ def get_telemetry_config(self, **kwargs: Any) -> _models.ApplianceGetTelemetryCo 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 @@ -748,8 +751,9 @@ 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 @@ -810,8 +814,9 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m 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 @@ -875,8 +880,9 @@ 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 @@ -988,8 +994,8 @@ def begin_create_or_update( :type resource_group_name: str :param resource_name: Appliances name. Required. :type resource_name: str - :param parameters: Parameters supplied to create or update an Appliance. Is either a model type - or a IO type. Required. + :param parameters: Parameters supplied to create or update an Appliance. Is either a Appliance + type or a IO type. Required. :type parameters: ~azure.mgmt.resourceconnector.models.Appliance or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1089,8 +1095,9 @@ 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 @@ -1232,8 +1239,9 @@ def 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 @@ -1300,8 +1308,9 @@ def list_cluster_user_credential( 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 @@ -1368,8 +1377,9 @@ def list_keys( 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 @@ -1440,8 +1450,9 @@ def get_upgrade_graph( 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 diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_create_update.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_create_update.py index de05d063845b..187f30f3ba86 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_create_update.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_create_update.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.resourceconnector import Appliances +from azure.mgmt.resourceconnector import ResourceConnectorMgmtClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = Appliances( + client = ResourceConnectorMgmtClient( credential=DefaultAzureCredential(), subscription_id="11111111-2222-3333-4444-555555555555", ) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_delete.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_delete.py index afc76df7d414..2fd4a0b35d22 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_delete.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_delete.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.resourceconnector import Appliances +from azure.mgmt.resourceconnector import ResourceConnectorMgmtClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = Appliances( + client = ResourceConnectorMgmtClient( credential=DefaultAzureCredential(), subscription_id="11111111-2222-3333-4444-555555555555", ) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_get.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_get.py index 59c27f9b66ed..16f19d3064e3 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_get.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_get.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.resourceconnector import Appliances +from azure.mgmt.resourceconnector import ResourceConnectorMgmtClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = Appliances( + client = ResourceConnectorMgmtClient( credential=DefaultAzureCredential(), subscription_id="11111111-2222-3333-4444-555555555555", ) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_by_resource_group.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_by_resource_group.py index 1a8592a458fd..ab04e9dec1bd 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_by_resource_group.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_by_resource_group.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.resourceconnector import Appliances +from azure.mgmt.resourceconnector import ResourceConnectorMgmtClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = Appliances( + client = ResourceConnectorMgmtClient( credential=DefaultAzureCredential(), subscription_id="11111111-2222-3333-4444-555555555555", ) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_by_subscription.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_by_subscription.py index b6c864c50077..6f3f086c9eca 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_by_subscription.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_by_subscription.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.resourceconnector import Appliances +from azure.mgmt.resourceconnector import ResourceConnectorMgmtClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = Appliances( + client = ResourceConnectorMgmtClient( credential=DefaultAzureCredential(), subscription_id="11111111-2222-3333-4444-555555555555", ) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_cluster_user_credential.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_cluster_user_credential.py index 301e444ba412..251cdefc1f66 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_cluster_user_credential.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_cluster_user_credential.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.resourceconnector import Appliances +from azure.mgmt.resourceconnector import ResourceConnectorMgmtClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = Appliances( + client = ResourceConnectorMgmtClient( credential=DefaultAzureCredential(), subscription_id="11111111-2222-3333-4444-555555555555", ) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_keys.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_keys.py index 944e8c9e8690..344be9ec4164 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_keys.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_keys.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.resourceconnector import Appliances +from azure.mgmt.resourceconnector import ResourceConnectorMgmtClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = Appliances( + client = ResourceConnectorMgmtClient( credential=DefaultAzureCredential(), subscription_id="11111111-2222-3333-4444-555555555555", ) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_operations.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_operations.py index 0d6a920faeef..1e0598efcccb 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_operations.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_list_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.resourceconnector import Appliances +from azure.mgmt.resourceconnector import ResourceConnectorMgmtClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = Appliances( + client = ResourceConnectorMgmtClient( credential=DefaultAzureCredential(), subscription_id="SUBSCRIPTION_ID", ) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_patch.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_patch.py index 17ebbfaf3915..c10ef463cd72 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_patch.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/appliances_patch.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.resourceconnector import Appliances +from azure.mgmt.resourceconnector import ResourceConnectorMgmtClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = Appliances( + client = ResourceConnectorMgmtClient( credential=DefaultAzureCredential(), subscription_id="11111111-2222-3333-4444-555555555555", ) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/telemetry_config.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/telemetry_config.py index e69bd4a59506..482cf32c3920 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/telemetry_config.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/telemetry_config.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.resourceconnector import Appliances +from azure.mgmt.resourceconnector import ResourceConnectorMgmtClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = Appliances( + client = ResourceConnectorMgmtClient( credential=DefaultAzureCredential(), subscription_id="11111111-2222-3333-4444-555555555555", ) diff --git a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/upgrade_graph.py b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/upgrade_graph.py index 933cfb05c078..3b78480e8aae 100644 --- a/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/upgrade_graph.py +++ b/sdk/resourceconnector/azure-mgmt-resourceconnector/generated_samples/upgrade_graph.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.resourceconnector import Appliances +from azure.mgmt.resourceconnector import ResourceConnectorMgmtClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = Appliances( + client = ResourceConnectorMgmtClient( credential=DefaultAzureCredential(), subscription_id="11111111-2222-3333-4444-555555555555", )