From 571defc8ee6b5d21128844bc49cdac3cb1a29573 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 2 Apr 2025 18:50:14 +0000 Subject: [PATCH] CodeGen from PR 33253 in Azure/azure-rest-api-specs Merge b3c051d64e1bd620c5d16d66afec4ef156ce065d into fb5c8fa550e9dd280236a93a974a2262000ab0b6 --- .../azure-mgmt-hybridcompute/CHANGELOG.md | 43 ++ .../azure-mgmt-hybridcompute/README.md | 2 +- .../azure-mgmt-hybridcompute/_meta.json | 6 +- .../azure/mgmt/hybridcompute/__init__.py | 12 +- .../mgmt/hybridcompute/_configuration.py | 5 +- .../_hybrid_compute_management_client.py | 22 +- .../mgmt/hybridcompute/_serialization.py | 434 +++++++---- .../azure/mgmt/hybridcompute/_vendor.py | 1 - .../azure/mgmt/hybridcompute/_version.py | 2 +- .../azure/mgmt/hybridcompute/aio/__init__.py | 12 +- .../mgmt/hybridcompute/aio/_configuration.py | 5 +- .../aio/_hybrid_compute_management_client.py | 23 +- .../azure/mgmt/hybridcompute/aio/_vendor.py | 1 - .../hybridcompute/aio/operations/__init__.py | 46 +- .../_extension_metadata_operations.py | 9 +- .../_extension_metadata_v2_operations.py | 204 ++++++ .../_extension_publisher_operations.py | 133 ++++ .../operations/_extension_type_operations.py | 135 ++++ .../aio/operations/_gateways_operations.py | 29 +- ...id_compute_management_client_operations.py | 216 +++++- .../_license_profiles_operations.py | 14 +- .../aio/operations/_licenses_operations.py | 19 +- .../_machine_extensions_operations.py | 15 +- .../_machine_run_commands_operations.py | 13 +- .../aio/operations/_machines_operations.py | 111 ++- .../operations/_network_profile_operations.py | 7 +- ...ity_perimeter_configurations_operations.py | 12 +- .../aio/operations/_operations.py | 7 +- ...private_endpoint_connections_operations.py | 13 +- .../_private_link_resources_operations.py | 9 +- .../_private_link_scopes_operations.py | 21 +- .../aio/operations/_settings_operations.py | 11 +- .../mgmt/hybridcompute/models/__init__.py | 347 +++++---- ..._hybrid_compute_management_client_enums.py | 8 + .../mgmt/hybridcompute/models/_models_py3.py | 693 ++++++++++++------ .../mgmt/hybridcompute/operations/__init__.py | 46 +- .../_extension_metadata_operations.py | 13 +- .../_extension_metadata_v2_operations.py | 264 +++++++ .../_extension_publisher_operations.py | 159 ++++ .../operations/_extension_type_operations.py | 165 +++++ .../operations/_gateways_operations.py | 41 +- ...id_compute_management_client_operations.py | 248 ++++++- .../_license_profiles_operations.py | 25 +- .../operations/_licenses_operations.py | 34 +- .../_machine_extensions_operations.py | 25 +- .../_machine_run_commands_operations.py | 21 +- .../operations/_machines_operations.py | 123 +++- .../operations/_network_profile_operations.py | 9 +- ...ity_perimeter_configurations_operations.py | 18 +- .../hybridcompute/operations/_operations.py | 9 +- ...private_endpoint_connections_operations.py | 21 +- .../_private_link_resources_operations.py | 13 +- .../_private_link_scopes_operations.py | 38 +- .../operations/_settings_operations.py | 17 +- .../extension/extension_add.py | 48 ++ .../extension/extension_create_or_update.py | 2 +- .../extension/extension_delete.py | 2 +- .../extension/extension_get.py | 2 +- .../extension/extension_list.py | 2 +- .../extension/extension_metadata_get.py | 2 +- .../extension/extension_metadata_list.py | 2 +- .../extension/extension_metadata_v2_get.py | 44 ++ .../extension/extension_metadata_v2_list.py | 44 ++ .../extension/extension_publisher_list.py | 42 ++ .../extension/extension_type_list.py | 43 ++ .../extension/extension_update.py | 2 +- .../extension/extensions_upgrade.py | 2 +- .../gateway/gateway_create_or_update.py | 2 +- .../gateway/gateway_delete.py | 2 +- .../generated_samples/gateway/gateway_get.py | 2 +- .../gateway/gateway_list_by_resource_group.py | 2 +- .../gateway/gateway_list_by_subscription.py | 2 +- .../gateway/gateway_update.py | 2 +- .../license/license_create_or_update.py | 2 +- .../license/license_delete.py | 2 +- .../generated_samples/license/license_get.py | 2 +- .../license/license_list_by_resource_group.py | 2 +- .../license/license_list_by_subscription.py | 2 +- .../license/license_update.py | 2 +- .../license/license_validate_license.py | 2 +- .../license_profile_create_or_update.py | 2 +- .../license_profile/license_profile_delete.py | 2 +- .../license_profile/license_profile_get.py | 2 +- .../license_profile/license_profile_list.py | 2 +- .../license_profile/license_profile_update.py | 2 +- .../machine/machine_assess_patches.py | 2 +- .../machine/machine_install_patches.py | 4 +- .../machine/machines_delete.py | 6 +- .../generated_samples/machine/machines_get.py | 2 +- ...hines_get_license_profile_instance_view.py | 2 +- .../machines_list_by_resource_group.py | 2 +- .../machine/machines_list_by_subscription.py | 2 +- .../generated_samples/network_profile_get.py | 2 +- ...rk_security_perimeter_configuration_get.py | 2 +- ...k_security_perimeter_configuration_list.py | 2 +- ...urity_perimeter_configuration_reconcile.py | 2 +- .../generated_samples/operations_list.py | 2 +- .../private_endpoint_connection_delete.py | 2 +- .../private_endpoint_connection_get.py | 2 +- .../private_endpoint_connection_list.py | 2 +- .../private_endpoint_connection_update.py | 2 +- ...te_link_scope_private_link_resource_get.py | 2 +- ...nk_scope_private_link_resource_list_get.py | 2 +- .../private_link_scopes_create.py | 2 +- .../private_link_scopes_delete.py | 2 +- .../private_link_scopes_get.py | 2 +- .../private_link_scopes_get_validation.py | 2 +- ..._link_scopes_get_validation_for_machine.py | 2 +- .../private_link_scopes_list.py | 2 +- ...vate_link_scopes_list_by_resource_group.py | 2 +- .../private_link_scopes_update.py | 2 +- .../run_commands_create_or_update.py | 2 +- .../run_command/run_commands_delete.py | 2 +- .../run_command/run_commands_get.py | 2 +- .../run_command/run_commands_list.py | 2 +- .../settings/settings_get.py | 2 +- .../settings/settings_patch.py | 2 +- .../settings/settings_update.py | 2 +- .../generated_tests/conftest.py | 2 +- .../test_hybrid_compute_management.py | 41 +- .../test_hybrid_compute_management_async.py | 43 +- ...anagement_extension_metadata_operations.py | 8 +- ...ent_extension_metadata_operations_async.py | 8 +- ...gement_extension_metadata_v2_operations.py | 46 ++ ..._extension_metadata_v2_operations_async.py | 47 ++ ...nagement_extension_publisher_operations.py | 30 + ...nt_extension_publisher_operations_async.py | 31 + ...te_management_extension_type_operations.py | 31 + ...agement_extension_type_operations_async.py | 32 + ..._compute_management_gateways_operations.py | 24 +- ...te_management_gateways_operations_async.py | 24 +- ..._management_license_profiles_operations.py | 20 +- ...ement_license_profiles_operations_async.py | 20 +- ..._compute_management_licenses_operations.py | 28 +- ...te_management_licenses_operations_async.py | 28 +- ...anagement_machine_extensions_operations.py | 20 +- ...ent_machine_extensions_operations_async.py | 20 +- ...agement_machine_run_commands_operations.py | 16 +- ...t_machine_run_commands_operations_async.py | 16 +- ..._compute_management_machines_operations.py | 30 +- ...te_management_machines_operations_async.py | 36 +- ...e_management_network_profile_operations.py | 4 +- ...gement_network_profile_operations_async.py | 4 +- ...ity_perimeter_configurations_operations.py | 12 +- ...rimeter_configurations_operations_async.py | 14 +- ...st_hybrid_compute_management_operations.py | 4 +- ...rid_compute_management_operations_async.py | 4 +- ...private_endpoint_connections_operations.py | 16 +- ...e_endpoint_connections_operations_async.py | 16 +- ...ement_private_link_resources_operations.py | 8 +- ...private_link_resources_operations_async.py | 8 +- ...nagement_private_link_scopes_operations.py | 32 +- ...nt_private_link_scopes_operations_async.py | 32 +- ..._compute_management_settings_operations.py | 12 +- ...te_management_settings_operations_async.py | 12 +- .../azure-mgmt-hybridcompute/setup.py | 8 +- 156 files changed, 3859 insertions(+), 1202 deletions(-) create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_v2_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_publisher_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_type_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_v2_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_publisher_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_type_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_add.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_get.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_list.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_publisher_list.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_type_list.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations_async.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations_async.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations_async.py diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/CHANGELOG.md b/sdk/hybridcompute/azure-mgmt-hybridcompute/CHANGELOG.md index 16112f350b80..5fb5b1531a46 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/CHANGELOG.md +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/CHANGELOG.md @@ -1,5 +1,48 @@ # Release History +## 9.1.0b2 (2025-04-02) + +### Features Added + + - Client `HybridComputeManagementClient` added method `begin_setup_extensions` + - Client `HybridComputeManagementClient` added operation group `extension_metadata_v2` + - Client `HybridComputeManagementClient` added operation group `extension_type` + - Client `HybridComputeManagementClient` added operation group `extension_publisher` + - Model `Machine` added property `identity_key_store` + - Model `Machine` added property `tpm_ek_certificate` + - Model `Machine` added property `hardware_resource_id` + - Model `MachineUpdate` added property `identity_key_store` + - Model `MachineUpdate` added property `tpm_ek_certificate` + - Enum `StatusTypes` added member `AWAITING_CONNECTION` + - Model `WindowsParameters` added property `patch_name_masks_to_include` + - Model `WindowsParameters` added property `patch_name_masks_to_exclude` + - Added model `ExtensionPublisher` + - Added model `ExtensionPublisherListResult` + - Added model `ExtensionType` + - Added model `ExtensionTypeListResult` + - Added model `ExtensionValueListResultV2` + - Added model `ExtensionValueProperties` + - Added model `ExtensionValueV2` + - Added model `ExtensionValueV2Properties` + - Added enum `IdentityKeyStore` + - Added model `SetupExtensionRequest` + - Model `HybridComputeManagementClientOperationsMixin` added method `begin_setup_extensions` + - Model `MachinesOperations` added method `begin_delete` + - Added model `ExtensionMetadataV2Operations` + - Added model `ExtensionPublisherOperations` + - Added model `ExtensionTypeOperations` + - Method `HybridComputeManagementClient.begin_setup_extensions` has a new overload `def begin_setup_extensions(self: None, resource_group_name: str, machine_name: str, extensions: SetupExtensionRequest, content_type: str)` + - Method `HybridComputeManagementClient.begin_setup_extensions` has a new overload `def begin_setup_extensions(self: None, resource_group_name: str, machine_name: str, extensions: IO[bytes], content_type: str)` + - Method `HybridComputeManagementClientOperationsMixin.begin_setup_extensions` has a new overload `def begin_setup_extensions(self: None, resource_group_name: str, machine_name: str, extensions: SetupExtensionRequest, content_type: str)` + - Method `HybridComputeManagementClientOperationsMixin.begin_setup_extensions` has a new overload `def begin_setup_extensions(self: None, resource_group_name: str, machine_name: str, extensions: IO[bytes], content_type: str)` + +### Breaking Changes + + - Deleted or renamed model `ErrorDetailAutoGenerated` + - Deleted or renamed model `ErrorResponseAutoGenerated` + - Deleted or renamed model `TrackedResourceAutoGenerated` + - Deleted or renamed method `MachinesOperations.delete` + ## 9.1.0b1 (2024-11-15) ### Features Added diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/README.md b/sdk/hybridcompute/azure-mgmt-hybridcompute/README.md index 893956f706f1..6857cf91d341 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/README.md +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/README.md @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. +By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json b/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json index 7a80b5de9fb6..7d342e23d1d0 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json @@ -1,11 +1,11 @@ { - "commit": "fe44d3261ff0ea816315126120672ccec78c3074", + "commit": "564c8c7329ca228ae69f4bfcf3cf905e0be18abe", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.19.0", + "@autorest/python@6.27.4", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/hybridcompute/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/hybridcompute/resource-manager/readme.md --generate-sample=True --generate-test=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.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/hybridcompute/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/__init__.py index 19568a4f473c..a3f74a11e9a8 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._hybrid_compute_management_client import HybridComputeManagementClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._hybrid_compute_management_client import HybridComputeManagementClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "HybridComputeManagementClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py index 1a3808472f3b..737612c3c7dc 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py @@ -14,7 +14,6 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -28,13 +27,13 @@ class HybridComputeManagementClientConfiguration: # pylint: disable=too-many-in :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 "2024-07-31-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2025-02-19-preview". 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: - api_version: str = kwargs.pop("api_version", "2024-07-31-preview") + api_version: str = kwargs.pop("api_version", "2025-02-19-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py index 001f8c458838..ec6cdaab4980 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py @@ -20,6 +20,9 @@ from ._serialization import Deserializer, Serializer from .operations import ( ExtensionMetadataOperations, + ExtensionMetadataV2Operations, + ExtensionPublisherOperations, + ExtensionTypeOperations, GatewaysOperations, HybridComputeManagementClientOperationsMixin, LicenseProfilesOperations, @@ -37,13 +40,12 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential class HybridComputeManagementClient( HybridComputeManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +): # pylint: disable=too-many-instance-attributes """The Hybrid Compute Management Client. :ivar licenses: LicensesOperations operations @@ -56,6 +58,13 @@ class HybridComputeManagementClient( :vartype machine_extensions: azure.mgmt.hybridcompute.operations.MachineExtensionsOperations :ivar extension_metadata: ExtensionMetadataOperations operations :vartype extension_metadata: azure.mgmt.hybridcompute.operations.ExtensionMetadataOperations + :ivar extension_metadata_v2: ExtensionMetadataV2Operations operations + :vartype extension_metadata_v2: + azure.mgmt.hybridcompute.operations.ExtensionMetadataV2Operations + :ivar extension_type: ExtensionTypeOperations operations + :vartype extension_type: azure.mgmt.hybridcompute.operations.ExtensionTypeOperations + :ivar extension_publisher: ExtensionPublisherOperations operations + :vartype extension_publisher: azure.mgmt.hybridcompute.operations.ExtensionPublisherOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.hybridcompute.operations.Operations :ivar network_profile: NetworkProfileOperations operations @@ -84,7 +93,7 @@ class HybridComputeManagementClient( :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 "2024-07-31-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2025-02-19-preview". 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 @@ -136,6 +145,13 @@ def __init__( self.extension_metadata = ExtensionMetadataOperations( self._client, self._config, self._serialize, self._deserialize ) + self.extension_metadata_v2 = ExtensionMetadataV2Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.extension_type = ExtensionTypeOperations(self._client, self._config, self._serialize, self._deserialize) + self.extension_publisher = ExtensionPublisherOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.network_profile = NetworkProfileOperations(self._client, self._config, self._serialize, self._deserialize) self.machine_run_commands = MachineRunCommandsOperations( diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_serialization.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_serialization.py index 8139854b97bb..b24ab2885450 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_serialization.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_serialization.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. @@ -24,7 +25,6 @@ # # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -52,7 +52,6 @@ MutableMapping, Type, List, - Mapping, ) try: @@ -91,6 +90,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: :param data: Input, could be bytes or stream (will be decoded with UTF8) or text :type data: str or bytes or IO :param str content_type: The content type. + :return: The deserialized data. + :rtype: object """ if hasattr(data, "read"): # Assume a stream @@ -112,7 +113,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: try: return json.loads(data_as_str) except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) + raise DeserializationError("JSON is invalid: {}".format(err), err) from err elif "xml" in (content_type or []): try: @@ -155,6 +156,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], Use bytes and headers to NOT use any requests/aiohttp or whatever specific implementation. Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object """ # Try to use content-type from headers if available content_type = None @@ -184,15 +190,30 @@ class UTC(datetime.tzinfo): """Time Zone info for handling UTC""" def utcoffset(self, dt): - """UTF offset for UTC is 0.""" + """UTF offset for UTC is 0. + + :param datetime.datetime dt: The datetime + :returns: The offset + :rtype: datetime.timedelta + """ return datetime.timedelta(0) def tzname(self, dt): - """Timestamp representation.""" + """Timestamp representation. + + :param datetime.datetime dt: The datetime + :returns: The timestamp representation + :rtype: str + """ return "Z" def dst(self, dt): - """No daylight saving for UTC.""" + """No daylight saving for UTC. + + :param datetime.datetime dt: The datetime + :returns: The daylight saving time + :rtype: datetime.timedelta + """ return datetime.timedelta(hours=1) @@ -206,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore :param datetime.timedelta offset: offset in timedelta format """ - def __init__(self, offset): + def __init__(self, offset) -> None: self.__offset = offset def utcoffset(self, dt): @@ -235,24 +256,26 @@ def __getinitargs__(self): _FLATTEN = re.compile(r"(? None: self.additional_properties: Optional[Dict[str, Any]] = {} - for k in kwargs: + for k in kwargs: # pylint: disable=consider-using-dict-items 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__) elif k in self._validation and self._validation[k].get("readonly", False): @@ -300,13 +330,23 @@ def __init__(self, **kwargs: Any) -> None: setattr(self, k, kwargs[k]) def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ return not self.__eq__(other) def __str__(self) -> str: @@ -326,7 +366,11 @@ def is_xml_model(cls) -> bool: @classmethod def _create_xml_node(cls): - """Create XML node.""" + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ try: xml_map = cls._xml_map # type: ignore except AttributeError: @@ -346,7 +390,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) def as_dict( self, @@ -380,12 +426,15 @@ def my_key_transformer(key, attr_desc, value): If you want XML serialization, you can pass the kwargs is_xml=True. + :param bool keep_readonly: If you want to serialize the readonly attributes :param function key_transformer: A key transformer function. :returns: A dict JSON compatible object :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) @classmethod def _infer_class_models(cls): @@ -395,7 +444,7 @@ def _infer_class_models(cls): client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} if cls.__name__ not in client_models: raise ValueError("Not Autorest generated code") - except Exception: + except Exception: # pylint: disable=broad-exception-caught # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. client_models = {cls.__name__: cls} return client_models @@ -408,6 +457,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong + :rtype: ModelType """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @@ -426,9 +476,11 @@ def from_dict( and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong + :rtype: ModelType """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -448,21 +500,25 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access return result @classmethod def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class """ for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): subtype_value = None if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -501,11 +557,13 @@ def _decode_attribute_map_key(key): inside the received data. :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str """ return key.replace("\\.", ".") -class Serializer(object): +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -540,7 +598,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -560,13 +618,16 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): self.key_transformer = full_restapi_key_transformer self.client_side_validation = True - def _serialize(self, target_obj, data_type=None, **kwargs): + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): """Serialize data into a string according to type. - :param target_obj: The data to be serialized. + :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict :raises: SerializationError if serialization fails. + :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) keep_readonly = kwargs.get("keep_readonly", False) @@ -592,12 +653,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized = {} if is_xml_model_serialization: - serialized = target_obj._create_xml_node() + serialized = target_obj._create_xml_node() # pylint: disable=protected-access try: - attributes = target_obj._attribute_map + attributes = target_obj._attribute_map # pylint: disable=protected-access for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): continue if attr_name == "additional_properties" and attr_desc["key"] == "": @@ -633,7 +696,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if isinstance(new_attr, list): serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): splitted_tag = new_attr.tag.split("}") if len(splitted_tag) == 2: # Namespace @@ -664,17 +728,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs): except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) raise SerializationError(msg) from err - else: - return serialized + return serialized def body(self, data, data_type, **kwargs): """Serialize data intended for a request body. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict :raises: SerializationError if serialization fails. :raises: ValueError if data is None + :returns: The serialized request body """ # Just in case this is a dict @@ -703,7 +767,7 @@ def body(self, data, data_type, **kwargs): attribute_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] - data = deserializer._deserialize(data_type, data) + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access except DeserializationError as err: raise SerializationError("Unable to build a model: " + str(err)) from err @@ -712,9 +776,11 @@ def body(self, data, data_type, **kwargs): def url(self, name, data, data_type, **kwargs): """Serialize data intended for a URL path. - :param data: The data to be serialized. + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str + :returns: The serialized URL path :raises: TypeError if serialization fails. :raises: ValueError if data is None """ @@ -728,21 +794,20 @@ def url(self, name, data, data_type, **kwargs): output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output def query(self, name, data, data_type, **kwargs): """Serialize data intended for a URL query. - :param data: The data to be serialized. + :param str name: The name of the query parameter. + :param object 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, list :raises: TypeError if serialization fails. :raises: ValueError if data is None + :returns: The serialized query parameter """ try: # Treat the list aside, since we don't want to encode the div separator @@ -759,19 +824,20 @@ def query(self, name, data, data_type, **kwargs): output = str(output) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def header(self, name, data, data_type, **kwargs): """Serialize data intended for a request header. - :param data: The data to be serialized. + :param str name: The name of the header. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None + :returns: The serialized header """ try: if data_type in ["[str]"]: @@ -780,21 +846,20 @@ def header(self, name, data, data_type, **kwargs): output = self.serialize_data(data, data_type, **kwargs) if data_type == "bool": output = json.dumps(output) - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def serialize_data(self, data, data_type, **kwargs): """Serialize generic data according to supplied data type. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :param bool required: Whether it's essential that the data not be - empty or None :raises: AttributeError if required data is None. :raises: ValueError if data is None :raises: SerializationError if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list """ if data is None: raise ValueError("No value for given attribute") @@ -805,7 +870,7 @@ def serialize_data(self, data, data_type, **kwargs): if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) - elif data_type in self.serialize_type: + if data_type in self.serialize_type: return self.serialize_type[data_type](data, **kwargs) # If dependencies is empty, try with current data class @@ -821,11 +886,10 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." raise SerializationError(msg.format(data, data_type)) from err - else: - return self._serialize(data, **kwargs) + return self._serialize(data, **kwargs) @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) if custom_serializer: return custom_serializer @@ -841,23 +905,26 @@ def serialize_basic(cls, data, data_type, **kwargs): - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - is_xml bool : If set, use xml_basic_types_serializers - :param data: Object to be serialized. + :param obj data: Object to be serialized. :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec + return eval(data_type)(data) # nosec # pylint: disable=eval-used @classmethod def serialize_unicode(cls, data): """Special handling for serializing unicode strings in Py2. Encode to UTF-8 if unicode, otherwise handle as a str. - :param data: Object to be serialized. + :param str data: Object to be serialized. :rtype: str + :return: serialized object """ try: # If I received an enum, return its value return data.value @@ -871,8 +938,7 @@ def serialize_unicode(cls, data): return data except NameError: return str(data) - else: - return str(data) + return str(data) def serialize_iter(self, data, iter_type, div=None, **kwargs): """Serialize iterable. @@ -882,15 +948,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): serialization_ctxt['type'] should be same as data_type. - is_xml bool : If set, serialize as XML - :param list attr: Object to be serialized. + :param list data: Object to be serialized. :param str iter_type: Type of object in the iterable. - :param bool required: Whether the objects in the iterable must - 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 + :return: serialized iterable """ if isinstance(data, str): raise SerializationError("Refuse str type as a valid iter type.") @@ -945,9 +1009,8 @@ def serialize_dict(self, attr, dict_type, **kwargs): :param dict attr: Object to be serialized. :param str dict_type: Type of object in the dictionary. - :param bool required: Whether the objects in the dictionary must - not be None or empty. :rtype: dict + :return: serialized dictionary """ serialization_ctxt = kwargs.get("serialization_ctxt", {}) serialized = {} @@ -971,7 +1034,7 @@ def serialize_dict(self, attr, dict_type, **kwargs): return serialized - def serialize_object(self, attr, **kwargs): + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Serialize a generic object. This will be handled as a dictionary. If object passed in is not a basic type (str, int, float, dict, list) it will simply be @@ -979,6 +1042,7 @@ def serialize_object(self, attr, **kwargs): :param dict attr: Object to be serialized. :rtype: dict or str + :return: serialized object """ if attr is None: return None @@ -1003,7 +1067,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_decimal(attr) # If it's a model or I know this dependency, serialize as a Model - elif obj_type in self.dependencies.values() or isinstance(attr, Model): + if obj_type in self.dependencies.values() or isinstance(attr, Model): return self._serialize(attr) if obj_type == dict: @@ -1034,56 +1098,61 @@ def serialize_enum(attr, enum_obj=None): try: enum_obj(result) # type: ignore return result - except ValueError: + except ValueError as exc: for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) + raise SerializationError(error.format(attr, enum_obj)) from exc @staticmethod - def serialize_bytearray(attr, **kwargs): + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument """Serialize bytearray into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ return b64encode(attr).decode() @staticmethod - def serialize_base64(attr, **kwargs): + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument """Serialize str into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ encoded = b64encode(attr).decode("ascii") return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod - def serialize_decimal(attr, **kwargs): + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument """Serialize Decimal object to float. - :param attr: Object to be serialized. + :param decimal attr: Object to be serialized. :rtype: float + :return: serialized decimal """ return float(attr) @staticmethod - def serialize_long(attr, **kwargs): + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument """Serialize long (Py2) or int (Py3). - :param attr: Object to be serialized. + :param int attr: Object to be serialized. :rtype: int/long + :return: serialized long """ return _long_type(attr) @staticmethod - def serialize_date(attr, **kwargs): + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument """Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str + :return: serialized date """ if isinstance(attr, str): attr = isodate.parse_date(attr) @@ -1091,11 +1160,12 @@ def serialize_date(attr, **kwargs): return t @staticmethod - def serialize_time(attr, **kwargs): + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument """Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str + :return: serialized time """ if isinstance(attr, str): attr = isodate.parse_time(attr) @@ -1105,30 +1175,32 @@ def serialize_time(attr, **kwargs): return t @staticmethod - def serialize_duration(attr, **kwargs): + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument """Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str + :return: serialized duration """ if isinstance(attr, str): attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod - def serialize_rfc(attr, **kwargs): + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: TypeError if format invalid. + :return: serialized rfc """ try: if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() - except AttributeError: - raise TypeError("RFC1123 object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( Serializer.days[utc.tm_wday], @@ -1141,12 +1213,13 @@ def serialize_rfc(attr, **kwargs): ) @staticmethod - def serialize_iso(attr, **kwargs): + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: SerializationError if format invalid. + :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) @@ -1172,13 +1245,14 @@ def serialize_iso(attr, **kwargs): raise TypeError(msg) from err @staticmethod - def serialize_unix(attr, **kwargs): + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into IntTime format. This is represented as seconds. :param Datetime attr: Object to be serialized. :rtype: int :raises: SerializationError if format invalid + :return: serialied unix """ if isinstance(attr, int): return attr @@ -1186,11 +1260,11 @@ def serialize_unix(attr, **kwargs): if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") return int(calendar.timegm(attr.utctimetuple())) - except AttributeError: - raise TypeError("Unix time object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc -def rest_key_extractor(attr, attr_desc, data): +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument key = attr_desc["key"] working_data = data @@ -1211,7 +1285,9 @@ def rest_key_extractor(attr, attr_desc, data): return working_data.get(key) -def rest_key_case_insensitive_extractor(attr, attr_desc, data): +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): key = attr_desc["key"] working_data = data @@ -1232,17 +1308,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): return attribute_key_case_insensitive_extractor(key, None, working_data) -def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key.""" +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) return attribute_key_extractor(dict_keys[-1], None, data) -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument """Extract the attribute in "data" based on the last part of the JSON path key. This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) @@ -1279,7 +1367,7 @@ def _extract_name_from_internal_type(internal_type): return xml_name -def xml_key_extractor(attr, attr_desc, data): +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements if isinstance(data, dict): return None @@ -1331,22 +1419,21 @@ def xml_key_extractor(attr, attr_desc, data): if is_iter_type: if is_wrapped: return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list + return [] # not wrapped, assume empty list return None # Assume it's not there, maybe an optional node. # If is_iter_type and not wrapped, return all found children if is_iter_type: if not is_wrapped: return children - else: # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + xml_name ) - return list(children[0]) # Might be empty list and that's ok. + ) + return list(children[0]) # Might be empty list and that's ok. # Here it's not a itertype, we should have found one element only or empty if len(children) > 1: @@ -1354,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data): return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1363,9 +1450,9 @@ class Deserializer(object): basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - 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}]?") + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1403,11 +1490,12 @@ def __call__(self, target_obj, response_data, content_type=None): :param str content_type: Swagger "produces" if available. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) - def _deserialize(self, target_obj, data): + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements """Call the deserializer on a model. Data needs to be already deserialized as JSON or XML ElementTree @@ -1416,12 +1504,13 @@ def _deserialize(self, target_obj, data): :param object data: Object to deserialize. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ # This is already a model, go recursive just in case if hasattr(data, "_attribute_map"): constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] try: - for attr, mapconfig in data._attribute_map.items(): + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access if attr in constants: continue value = getattr(data, attr) @@ -1440,13 +1529,13 @@ def _deserialize(self, target_obj, data): if isinstance(response, str): return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): + if isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) if data is None or data is CoreNull: return data try: - attributes = response._attribute_map # type: ignore + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1476,9 +1565,8 @@ def _deserialize(self, target_obj, data): except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore raise DeserializationError(msg) from err - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) def _build_additional_properties(self, attribute_map, data): if not self.additional_properties_detection: @@ -1505,6 +1593,8 @@ def _classify_target(self, target, data): :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple """ if target is None: return None, None @@ -1516,7 +1606,7 @@ def _classify_target(self, target, data): return target, target try: - target = target._classify(data, self.dependencies) # type: ignore + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1531,10 +1621,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): :param str target_obj: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object """ try: return self(target_obj, data, content_type=content_type) - except: + except: # pylint: disable=bare-except _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -1552,10 +1644,12 @@ def _unpack_content(raw_data, content_type=None): If raw_data is something else, bypass all logic and return it directly. - :param raw_data: Data to be processed. - :param content_type: How to parse if raw_data is a string/bytes. + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. :raises JSONDecodeError: If JSON is requested and parsing is impossible. :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. """ # Assume this is enough to detect a Pipeline Response without importing it context = getattr(raw_data, "context", {}) @@ -1579,24 +1673,35 @@ def _unpack_content(raw_data, content_type=None): def _instantiate_model(self, response, attrs, additional_properties=None): """Instantiate a response model passing in deserialized args. - :param response: The response model class. - :param d_attrs: The deserialized response attributes. + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. """ if callable(response): subtype = getattr(response, "_subtype_map", {}) try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) + raise DeserializationError(msg + str(err)) from err else: try: for attr, value in attrs.items(): @@ -1605,15 +1710,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None): except Exception as exp: msg = "Unable to populate response model. " msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) + raise DeserializationError(msg) from exp - def deserialize_data(self, data, data_type): + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements """Process data for deserialization according to data type. :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ if data is None: return data @@ -1627,7 +1733,11 @@ def deserialize_data(self, data, data_type): if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): return data - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: return None data_val = self.deserialize_type[data_type](data) @@ -1647,14 +1757,14 @@ def deserialize_data(self, data, data_type): msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) raise DeserializationError(msg) from err - else: - return self._deserialize(obj_type, data) + return self._deserialize(obj_type, data) def deserialize_iter(self, attr, iter_type): """Deserialize an iterable. :param list attr: Iterable to be deserialized. :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. :rtype: list """ if attr is None: @@ -1671,6 +1781,7 @@ def deserialize_dict(self, attr, dict_type): :param dict/list attr: Dictionary to be deserialized. Also accepts a list of key, value pairs. :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. :rtype: dict """ if isinstance(attr, list): @@ -1681,11 +1792,12 @@ def deserialize_dict(self, attr, dict_type): attr = {el.tag: el.text for el in attr} return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - def deserialize_object(self, attr, **kwargs): + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. :rtype: dict :raises: TypeError if non-builtin datatype encountered. """ @@ -1720,11 +1832,10 @@ def deserialize_object(self, attr, **kwargs): pass return deserialized - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) - def deserialize_basic(self, attr, data_type): + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements """Deserialize basic builtin data type from string. Will attempt to convert to str, int, float and bool. This function will also accept '1', '0', 'true' and 'false' as @@ -1732,6 +1843,7 @@ def deserialize_basic(self, attr, data_type): :param str attr: response string to be deserialized. :param str data_type: deserialization data type. + :return: Deserialized basic type. :rtype: str, int, float or bool :raises: TypeError if string format is not valid. """ @@ -1743,24 +1855,23 @@ def deserialize_basic(self, attr, data_type): if data_type == "str": # None or '', node is empty string. return "" - else: - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, str): + if isinstance(attr, str): if attr.lower() in ["true", "1"]: return True - elif attr.lower() in ["false", "0"]: + if attr.lower() in ["false", "0"]: return False raise TypeError("Invalid boolean value: {}".format(attr)) if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec + return eval(data_type)(attr) # nosec # pylint: disable=eval-used @staticmethod def deserialize_unicode(data): @@ -1768,6 +1879,7 @@ def deserialize_unicode(data): as a string. :param str data: response string to be deserialized. + :return: Deserialized string. :rtype: str or unicode """ # We might be here because we have an enum modeled as string, @@ -1781,8 +1893,7 @@ def deserialize_unicode(data): return data except NameError: return str(data) - else: - return str(data) + return str(data) @staticmethod def deserialize_enum(data, enum_obj): @@ -1794,6 +1905,7 @@ def deserialize_enum(data, enum_obj): :param str data: Response string to be deserialized. If this value is None or invalid it will be returned as-is. :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. :rtype: Enum """ if isinstance(data, enum_obj) or data is None: @@ -1804,9 +1916,9 @@ def deserialize_enum(data, enum_obj): # Workaround. We might consider remove it in the future. try: return list(enum_obj.__members__.values())[data] - except IndexError: + except IndexError as exc: error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) + raise DeserializationError(error.format(data, enum_obj)) from exc try: return enum_obj(str(data)) except ValueError: @@ -1822,6 +1934,7 @@ def deserialize_bytearray(attr): """Deserialize string into bytearray. :param str attr: response string to be deserialized. + :return: Deserialized bytearray :rtype: bytearray :raises: TypeError if string format invalid. """ @@ -1834,6 +1947,7 @@ def deserialize_base64(attr): """Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. + :return: Deserialized base64 string :rtype: bytearray :raises: TypeError if string format invalid. """ @@ -1849,8 +1963,9 @@ def deserialize_decimal(attr): """Deserialize string into Decimal object. :param str attr: response string to be deserialized. - :rtype: Decimal + :return: Deserialized decimal :raises: DeserializationError if string format invalid. + :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text @@ -1865,6 +1980,7 @@ def deserialize_long(attr): """Deserialize string into long (Py2) or int (Py3). :param str attr: response string to be deserialized. + :return: Deserialized int :rtype: long or int :raises: ValueError if string format invalid. """ @@ -1877,6 +1993,7 @@ def deserialize_duration(attr): """Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. + :return: Deserialized duration :rtype: TimeDelta :raises: DeserializationError if string format invalid. """ @@ -1887,14 +2004,14 @@ def deserialize_duration(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." raise DeserializationError(msg) from err - else: - return duration + return duration @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. + :return: Deserialized date :rtype: Date :raises: DeserializationError if string format invalid. """ @@ -1910,6 +2027,7 @@ def deserialize_time(attr): """Deserialize ISO-8601 formatted string into time object. :param str attr: response string to be deserialized. + :return: Deserialized time :rtype: datetime.time :raises: DeserializationError if string format invalid. """ @@ -1924,6 +2042,7 @@ def deserialize_rfc(attr): """Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime :rtype: Datetime :raises: DeserializationError if string format invalid. """ @@ -1939,14 +2058,14 @@ def deserialize_rfc(attr): except ValueError as err: msg = "Cannot deserialize to rfc datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime :rtype: Datetime :raises: DeserializationError if string format invalid. """ @@ -1976,8 +2095,7 @@ def deserialize_iso(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_unix(attr): @@ -1985,6 +2103,7 @@ def deserialize_unix(attr): This is represented as seconds. :param int attr: Object to be serialized. + :return: Deserialized datetime :rtype: Datetime :raises: DeserializationError if format invalid """ @@ -1996,5 +2115,4 @@ def deserialize_unix(attr): except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_vendor.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_vendor.py index 4dfd4a465081..6167de35d0ae 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_vendor.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_vendor.py @@ -11,7 +11,6 @@ from ._configuration import HybridComputeManagementClientConfiguration if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core import PipelineClient from ._serialization import Deserializer, Serializer diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py index 9c108f450a9a..7419d7214922 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "9.1.0b1" +VERSION = "9.1.0b2" diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/__init__.py index 59bab567ae8f..457fdd1a4ff4 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/__init__.py @@ -5,12 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._hybrid_compute_management_client import HybridComputeManagementClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._hybrid_compute_management_client import HybridComputeManagementClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "HybridComputeManagementClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py index 415527974e1e..eabe3f32e321 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py @@ -14,7 +14,6 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -28,13 +27,13 @@ class HybridComputeManagementClientConfiguration: # pylint: disable=too-many-in :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 "2024-07-31-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2025-02-19-preview". 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: - api_version: str = kwargs.pop("api_version", "2024-07-31-preview") + api_version: str = kwargs.pop("api_version", "2025-02-19-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py index b22e5ef728b6..f056180288d6 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py @@ -20,6 +20,9 @@ from ._configuration import HybridComputeManagementClientConfiguration from .operations import ( ExtensionMetadataOperations, + ExtensionMetadataV2Operations, + ExtensionPublisherOperations, + ExtensionTypeOperations, GatewaysOperations, HybridComputeManagementClientOperationsMixin, LicenseProfilesOperations, @@ -37,13 +40,12 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential class HybridComputeManagementClient( HybridComputeManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +): # pylint: disable=too-many-instance-attributes """The Hybrid Compute Management Client. :ivar licenses: LicensesOperations operations @@ -58,6 +60,14 @@ class HybridComputeManagementClient( :ivar extension_metadata: ExtensionMetadataOperations operations :vartype extension_metadata: azure.mgmt.hybridcompute.aio.operations.ExtensionMetadataOperations + :ivar extension_metadata_v2: ExtensionMetadataV2Operations operations + :vartype extension_metadata_v2: + azure.mgmt.hybridcompute.aio.operations.ExtensionMetadataV2Operations + :ivar extension_type: ExtensionTypeOperations operations + :vartype extension_type: azure.mgmt.hybridcompute.aio.operations.ExtensionTypeOperations + :ivar extension_publisher: ExtensionPublisherOperations operations + :vartype extension_publisher: + azure.mgmt.hybridcompute.aio.operations.ExtensionPublisherOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.hybridcompute.aio.operations.Operations :ivar network_profile: NetworkProfileOperations operations @@ -88,7 +98,7 @@ class HybridComputeManagementClient( :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 "2024-07-31-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2025-02-19-preview". 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 @@ -140,6 +150,13 @@ def __init__( self.extension_metadata = ExtensionMetadataOperations( self._client, self._config, self._serialize, self._deserialize ) + self.extension_metadata_v2 = ExtensionMetadataV2Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.extension_type = ExtensionTypeOperations(self._client, self._config, self._serialize, self._deserialize) + self.extension_publisher = ExtensionPublisherOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.network_profile = NetworkProfileOperations(self._client, self._config, self._serialize, self._deserialize) self.machine_run_commands = MachineRunCommandsOperations( diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_vendor.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_vendor.py index 0479090855c8..c8c5f4c912c3 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_vendor.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_vendor.py @@ -11,7 +11,6 @@ from ._configuration import HybridComputeManagementClientConfiguration if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core import AsyncPipelineClient from .._serialization import Deserializer, Serializer diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py index 068f98844fb6..e5655430283c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py @@ -5,25 +5,34 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._licenses_operations import LicensesOperations -from ._machines_operations import MachinesOperations -from ._license_profiles_operations import LicenseProfilesOperations -from ._machine_extensions_operations import MachineExtensionsOperations -from ._hybrid_compute_management_client_operations import HybridComputeManagementClientOperationsMixin -from ._extension_metadata_operations import ExtensionMetadataOperations -from ._operations import Operations -from ._network_profile_operations import NetworkProfileOperations -from ._machine_run_commands_operations import MachineRunCommandsOperations -from ._gateways_operations import GatewaysOperations -from ._settings_operations import SettingsOperations -from ._private_link_scopes_operations import PrivateLinkScopesOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._network_security_perimeter_configurations_operations import NetworkSecurityPerimeterConfigurationsOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._licenses_operations import LicensesOperations # type: ignore +from ._machines_operations import MachinesOperations # type: ignore +from ._license_profiles_operations import LicenseProfilesOperations # type: ignore +from ._machine_extensions_operations import MachineExtensionsOperations # type: ignore +from ._hybrid_compute_management_client_operations import HybridComputeManagementClientOperationsMixin # type: ignore +from ._extension_metadata_operations import ExtensionMetadataOperations # type: ignore +from ._extension_metadata_v2_operations import ExtensionMetadataV2Operations # type: ignore +from ._extension_type_operations import ExtensionTypeOperations # type: ignore +from ._extension_publisher_operations import ExtensionPublisherOperations # type: ignore +from ._operations import Operations # type: ignore +from ._network_profile_operations import NetworkProfileOperations # type: ignore +from ._machine_run_commands_operations import MachineRunCommandsOperations # type: ignore +from ._gateways_operations import GatewaysOperations # type: ignore +from ._settings_operations import SettingsOperations # type: ignore +from ._private_link_scopes_operations import PrivateLinkScopesOperations # type: ignore +from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore +from ._network_security_perimeter_configurations_operations import NetworkSecurityPerimeterConfigurationsOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -33,6 +42,9 @@ "MachineExtensionsOperations", "HybridComputeManagementClientOperationsMixin", "ExtensionMetadataOperations", + "ExtensionMetadataV2Operations", + "ExtensionTypeOperations", + "ExtensionPublisherOperations", "Operations", "NetworkProfileOperations", "MachineRunCommandsOperations", @@ -43,5 +55,5 @@ "PrivateEndpointConnectionsOperations", "NetworkSecurityPerimeterConfigurationsOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_operations.py index 5ac0757143f7..42514a363c9a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -32,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +73,7 @@ async def get( :rtype: ~azure.mgmt.hybridcompute.models.ExtensionValue :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -142,7 +141,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExtensionValueListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_v2_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_v2_operations.py new file mode 100644 index 000000000000..38ab0a4d0bdd --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_v2_operations.py @@ -0,0 +1,204 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# 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 + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ...operations._extension_metadata_v2_operations import build_get_request, build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ExtensionMetadataV2Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.aio.HybridComputeManagementClient`'s + :attr:`extension_metadata_v2` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, location: str, publisher: str, extension_type: str, version: str, **kwargs: Any + ) -> _models.ExtensionValueV2: + """Gets an Extension Metadata based on location, publisher, extensionType and version. + + :param location: The name of Azure region. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :param extension_type: The extensionType of the Extension being received. Required. + :type extension_type: str + :param version: The version of the Extension being received. Required. + :type version: str + :return: ExtensionValueV2 or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.ExtensionValueV2 + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionValueV2] = kwargs.pop("cls", None) + + _request = build_get_request( + location=location, + publisher=publisher, + extension_type=extension_type, + version=version, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExtensionValueV2", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, location: str, publisher: str, extension_type: str, **kwargs: Any + ) -> AsyncIterable["_models.ExtensionValueV2"]: + """Gets all Extension versions based on location, publisher, extensionType. + + :param location: The name of Azure region. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :param extension_type: The extensionType of the Extension being received. Required. + :type extension_type: str + :return: An iterator like instance of either ExtensionValueV2 or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.ExtensionValueV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionValueListResultV2] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + publisher=publisher, + extension_type=extension_type, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionValueListResultV2", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + 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=_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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_publisher_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_publisher_operations.py new file mode 100644 index 000000000000..c898804424a9 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_publisher_operations.py @@ -0,0 +1,133 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# 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 + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ...operations._extension_publisher_operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ExtensionPublisherOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.aio.HybridComputeManagementClient`'s + :attr:`extension_publisher` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.ExtensionPublisher"]: + """Gets all Extension publishers based on the location. + + :param location: The name of Azure region. Required. + :type location: str + :return: An iterator like instance of either ExtensionPublisher or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.ExtensionPublisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionPublisherListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionPublisherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + 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=_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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_type_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_type_operations.py new file mode 100644 index 000000000000..aba47bbb5a13 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_type_operations.py @@ -0,0 +1,135 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# 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 + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ...operations._extension_type_operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ExtensionTypeOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.aio.HybridComputeManagementClient`'s + :attr:`extension_type` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, location: str, publisher: str, **kwargs: Any) -> AsyncIterable["_models.ExtensionType"]: + """Gets all Extension types based on location and publisher. + + :param location: The name of Azure region. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :return: An iterator like instance of either ExtensionType or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.ExtensionType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionTypeListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + publisher=publisher, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionTypeListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + 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=_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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_gateways_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_gateways_operations.py index 9e226434437c..b98b84e63bf1 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_gateways_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_gateways_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -44,7 +43,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +70,7 @@ def __init__(self, *args, **kwargs) -> None: async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, parameters: Union[_models.Gateway, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -121,7 +120,7 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -337,7 +336,7 @@ async def update( :rtype: ~azure.mgmt.hybridcompute.models.Gateway :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -382,7 +381,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Gateway", pipeline_response.http_response) @@ -405,7 +404,7 @@ async def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) :rtype: ~azure.mgmt.hybridcompute.models.Gateway :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +437,7 @@ async def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Gateway", pipeline_response.http_response) @@ -449,7 +448,7 @@ async def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) return deserialized # type: ignore async def _delete_initial(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +486,7 @@ async def _delete_initial(self, resource_group_name: str, gateway_name: str, **k except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -575,7 +574,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GatewaysListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -630,7 +629,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -651,7 +650,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Gateway" api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GatewaysListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -705,7 +704,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + 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/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py index d3af83dd2329..de3f9ab5e6d9 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,13 +28,16 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ...operations._hybrid_compute_management_client_operations import build_upgrade_extensions_request +from ...operations._hybrid_compute_management_client_operations import ( + build_setup_extensions_request, + build_upgrade_extensions_request, +) from .._vendor import HybridComputeManagementClientMixinABC if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +53,7 @@ async def _upgrade_extensions_initial( extension_upgrade_parameters: Union[_models.MachineExtensionUpgrade, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -240,3 +242,207 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _setup_extensions_initial( + self, + resource_group_name: str, + machine_name: str, + extensions: Union[_models.SetupExtensionRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(extensions, (IOBase, bytes)): + _content = extensions + else: + _json = self._serialize.body(extensions, "SetupExtensionRequest") + + _request = build_setup_extensions_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_setup_extensions( + self, + resource_group_name: str, + machine_name: str, + extensions: _models.SetupExtensionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SetupExtensionRequest]: + """The operation to Setup Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param extensions: Parameters supplied to the Setup Extensions operation. Required. + :type extensions: ~azure.mgmt.hybridcompute.models.SetupExtensionRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either SetupExtensionRequest or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.SetupExtensionRequest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_setup_extensions( + self, + resource_group_name: str, + machine_name: str, + extensions: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SetupExtensionRequest]: + """The operation to Setup Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param extensions: Parameters supplied to the Setup Extensions operation. Required. + :type extensions: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either SetupExtensionRequest or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.SetupExtensionRequest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_setup_extensions( + self, + resource_group_name: str, + machine_name: str, + extensions: Union[_models.SetupExtensionRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SetupExtensionRequest]: + """The operation to Setup Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param extensions: Parameters supplied to the Setup Extensions operation. Is either a + SetupExtensionRequest type or a IO[bytes] type. Required. + :type extensions: ~azure.mgmt.hybridcompute.models.SetupExtensionRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either SetupExtensionRequest or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.SetupExtensionRequest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + 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.SetupExtensionRequest] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._setup_extensions_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + extensions=extensions, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SetupExtensionRequest", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SetupExtensionRequest].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SetupExtensionRequest]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_license_profiles_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_license_profiles_operations.py index b6b5813f57c8..17aa82486f17 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_license_profiles_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_license_profiles_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -17,7 +16,6 @@ IO, Literal, Optional, - Type, TypeVar, Union, cast, @@ -57,7 +55,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +86,7 @@ async def _create_or_update_initial( parameters: Union[_models.LicenseProfile, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -295,7 +293,7 @@ async def _update_initial( parameters: Union[_models.LicenseProfileUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -506,7 +504,7 @@ async def get(self, resource_group_name: str, machine_name: str, **kwargs: Any) :rtype: ~azure.mgmt.hybridcompute.models.LicenseProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -552,7 +550,7 @@ async def get(self, resource_group_name: str, machine_name: str, **kwargs: Any) return deserialized # type: ignore async def _delete_initial(self, resource_group_name: str, machine_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -687,7 +685,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LicenseProfilesListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_licenses_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_licenses_operations.py index c1d4c34071e7..3151748a03fe 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_licenses_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_licenses_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -45,7 +44,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +71,7 @@ def __init__(self, *args, **kwargs) -> None: async def _validate_license_initial( self, parameters: Union[_models.License, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +225,7 @@ def get_long_running_output(pipeline_response): async def _create_or_update_initial( self, resource_group_name: str, license_name: str, parameters: Union[_models.License, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -415,7 +414,7 @@ async def _update_initial( parameters: Union[_models.LicenseUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -614,7 +613,7 @@ async def get(self, resource_group_name: str, license_name: str, **kwargs: Any) :rtype: ~azure.mgmt.hybridcompute.models.License :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -658,7 +657,7 @@ async def get(self, resource_group_name: str, license_name: str, **kwargs: Any) return deserialized # type: ignore async def _delete_initial(self, resource_group_name: str, license_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -776,7 +775,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LicensesListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -852,7 +851,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.License" api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LicensesListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py index f3b3dc65e2a9..a704c902150b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -43,7 +42,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +74,7 @@ async def _create_or_update_initial( extension_parameters: Union[_models.MachineExtension, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -285,7 +284,7 @@ async def _update_initial( extension_parameters: Union[_models.MachineExtensionUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -499,7 +498,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, machine_name: str, extension_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -631,7 +630,7 @@ async def get( :rtype: ~azure.mgmt.hybridcompute.models.MachineExtension :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -699,7 +698,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MachineExtensionsListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_run_commands_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_run_commands_operations.py index 28fedffa7100..54f76a8c11a1 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_run_commands_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_run_commands_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,7 +41,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +73,7 @@ async def _create_or_update_initial( run_command_properties: Union[_models.MachineRunCommand, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -285,7 +284,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, machine_name: str, run_command_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -419,7 +418,7 @@ async def get( :rtype: ~azure.mgmt.hybridcompute.models.MachineRunCommand :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +486,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MachineRunCommandsListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machines_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machines_operations.py index 00b488870e6e..3bda34beaea2 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machines_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machines_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -44,7 +43,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,22 +67,8 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, machine_name: str, **kwargs: Any - ) -> None: - """The operation to delete a hybrid machine. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param machine_name: The name of the hybrid machine. Required. - :type machine_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + async def _delete_initial(self, resource_group_name: str, machine_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -95,7 +80,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -107,20 +92,90 @@ async def delete( # pylint: disable=inconsistent-return-statements ) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, machine_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """The operation to delete a hybrid machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + 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) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def get( @@ -144,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.hybridcompute.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -189,7 +244,7 @@ async def get( return deserialized # type: ignore async def _assess_patches_initial(self, resource_group_name: str, name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -310,7 +365,7 @@ async def _install_patches_initial( install_patches_input: Union[_models.MachineInstallPatchesParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -527,7 +582,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -605,7 +660,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Machine" api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_network_profile_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_network_profile_operations.py index a2e39754284a..d6d8a6ec95d4 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_network_profile_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_network_profile_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +65,7 @@ async def get(self, resource_group_name: str, machine_name: str, **kwargs: Any) :rtype: ~azure.mgmt.hybridcompute.models.NetworkProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_network_security_perimeter_configurations_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_network_security_perimeter_configurations_operations.py index 73591658c3c7..f79c97df802b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_network_security_perimeter_configurations_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_network_security_perimeter_configurations_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, Type, TypeVar, Union, cast +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,7 +39,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +81,7 @@ async def get_by_private_link_scope( :rtype: ~azure.mgmt.hybridcompute.models.NetworkSecurityPerimeterConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -149,7 +148,7 @@ def list_by_private_link_scope( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NetworkSecurityPerimeterConfigurationListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -215,7 +214,7 @@ async def get_next(next_link=None): async def _reconcile_for_private_link_scope_initial( # pylint: disable=name-too-long self, resource_group_name: str, scope_name: str, perimeter_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,6 +275,7 @@ async def _reconcile_for_private_link_scope_initial( # pylint: disable=name-too async def begin_reconcile_for_private_link_scope( self, resource_group_name: str, scope_name: str, perimeter_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.NetworkSecurityPerimeterConfigurationReconcileResult]: + # pylint: disable=line-too-long """Forces the network security perimeter configuration to refresh for a private link scope. :param resource_group_name: The name of the resource group. The name is case insensitive. diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_operations.py index 7e2eb9a28035..60419d0543a3 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +69,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_endpoint_connections_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_endpoint_connections_operations.py index 435b25f4f022..9e366efb6e17 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_endpoint_connections_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,7 +41,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +82,7 @@ async def get( :rtype: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -135,7 +134,7 @@ async def _create_or_update_initial( parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -337,7 +336,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, scope_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -475,7 +474,7 @@ def list_by_private_link_scope( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_resources_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_resources_operations.py index 660dbf96d8e8..cb03466fff02 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_resources_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_resources_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -32,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +77,7 @@ def list_by_private_link_scope( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +157,7 @@ async def get( :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_scopes_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_scopes_operations.py index e0aa60dfa524..e4a5b05e10db 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_scopes_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_scopes_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -46,7 +45,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +85,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.HybridComputePrivateLink api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.HybridComputePrivateLinkScopeListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +167,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.HybridComputePrivateLinkScopeListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -231,7 +230,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) async def _delete_initial(self, resource_group_name: str, scope_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +354,7 @@ async def get( :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -480,7 +479,7 @@ async def create_or_update( :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -616,7 +615,7 @@ async def update_tags( :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -686,7 +685,7 @@ async def get_validation_details( :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkScopeValidationDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -745,7 +744,7 @@ async def get_validation_details_for_machine( :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkScopeValidationDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_settings_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_settings_operations.py index 871de0b1ec6b..3163b8514c55 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_settings_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_settings_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +29,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +80,7 @@ async def get( :rtype: ~azure.mgmt.hybridcompute.models.Settings :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -229,7 +228,7 @@ async def update( :rtype: ~azure.mgmt.hybridcompute.models.Settings :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -389,7 +388,7 @@ async def patch( :rtype: ~azure.mgmt.hybridcompute.models.Settings :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py index 9d1cc2afc019..185aa4150a84 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py @@ -5,166 +5,184 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models_py3 import AccessRule -from ._models_py3 import AgentConfiguration -from ._models_py3 import AgentUpgrade -from ._models_py3 import AgentVersion -from ._models_py3 import AgentVersionsList -from ._models_py3 import AvailablePatchCountByClassification -from ._models_py3 import CloudMetadata -from ._models_py3 import ConfigurationExtension -from ._models_py3 import ConnectionDetail -from ._models_py3 import Disk -from ._models_py3 import ErrorAdditionalInfo -from ._models_py3 import ErrorDetail -from ._models_py3 import ErrorDetailAutoGenerated -from ._models_py3 import ErrorResponse -from ._models_py3 import ErrorResponseAutoGenerated -from ._models_py3 import EsuKey -from ._models_py3 import ExtensionTargetProperties -from ._models_py3 import ExtensionValue -from ._models_py3 import ExtensionValueListResult -from ._models_py3 import ExtensionsResourceStatus -from ._models_py3 import FirmwareProfile -from ._models_py3 import Gateway -from ._models_py3 import GatewayUpdate -from ._models_py3 import GatewaysListResult -from ._models_py3 import HardwareProfile -from ._models_py3 import HybridComputePrivateLinkScope -from ._models_py3 import HybridComputePrivateLinkScopeListResult -from ._models_py3 import HybridComputePrivateLinkScopeProperties -from ._models_py3 import HybridIdentityMetadata -from ._models_py3 import HybridIdentityMetadataList -from ._models_py3 import Identity -from ._models_py3 import IpAddress -from ._models_py3 import KeyDetails -from ._models_py3 import KeyProperties -from ._models_py3 import License -from ._models_py3 import LicenseDetails -from ._models_py3 import LicenseProfile -from ._models_py3 import LicenseProfileArmEsuProperties -from ._models_py3 import LicenseProfileArmEsuPropertiesWithoutAssignedLicense -from ._models_py3 import LicenseProfileMachineInstanceView -from ._models_py3 import LicenseProfileMachineInstanceViewEsuProperties -from ._models_py3 import LicenseProfileStorageModelEsuProperties -from ._models_py3 import LicenseProfileUpdate -from ._models_py3 import LicenseProfilesListResult -from ._models_py3 import LicenseUpdate -from ._models_py3 import LicensesListResult -from ._models_py3 import LinuxParameters -from ._models_py3 import LocationData -from ._models_py3 import Machine -from ._models_py3 import MachineAssessPatchesResult -from ._models_py3 import MachineExtension -from ._models_py3 import MachineExtensionInstanceView -from ._models_py3 import MachineExtensionInstanceViewStatus -from ._models_py3 import MachineExtensionProperties -from ._models_py3 import MachineExtensionUpdate -from ._models_py3 import MachineExtensionUpgrade -from ._models_py3 import MachineExtensionsListResult -from ._models_py3 import MachineInstallPatchesParameters -from ._models_py3 import MachineInstallPatchesResult -from ._models_py3 import MachineListResult -from ._models_py3 import MachineRunCommand -from ._models_py3 import MachineRunCommandInstanceView -from ._models_py3 import MachineRunCommandScriptSource -from ._models_py3 import MachineRunCommandUpdate -from ._models_py3 import MachineRunCommandsListResult -from ._models_py3 import MachineUpdate -from ._models_py3 import NetworkConfiguration -from ._models_py3 import NetworkInterface -from ._models_py3 import NetworkProfile -from ._models_py3 import NetworkSecurityPerimeter -from ._models_py3 import NetworkSecurityPerimeterConfiguration -from ._models_py3 import NetworkSecurityPerimeterConfigurationListResult -from ._models_py3 import NetworkSecurityPerimeterConfigurationReconcileResult -from ._models_py3 import NetworkSecurityPerimeterProfile -from ._models_py3 import OSProfile -from ._models_py3 import OSProfileLinuxConfiguration -from ._models_py3 import OSProfileWindowsConfiguration -from ._models_py3 import OperationListResult -from ._models_py3 import OperationValue -from ._models_py3 import OperationValueDisplay -from ._models_py3 import PatchSettingsStatus -from ._models_py3 import PrivateEndpointConnection -from ._models_py3 import PrivateEndpointConnectionDataModel -from ._models_py3 import PrivateEndpointConnectionListResult -from ._models_py3 import PrivateEndpointConnectionProperties -from ._models_py3 import PrivateEndpointProperty -from ._models_py3 import PrivateLinkResource -from ._models_py3 import PrivateLinkResourceListResult -from ._models_py3 import PrivateLinkResourceProperties -from ._models_py3 import PrivateLinkScopeValidationDetails -from ._models_py3 import PrivateLinkScopesResource -from ._models_py3 import PrivateLinkServiceConnectionStateProperty -from ._models_py3 import Processor -from ._models_py3 import ProductFeature -from ._models_py3 import ProductFeatureUpdate -from ._models_py3 import ProvisioningIssue -from ._models_py3 import ProxyResource -from ._models_py3 import ProxyResourceAutoGenerated -from ._models_py3 import Resource -from ._models_py3 import ResourceAssociation -from ._models_py3 import ResourceAutoGenerated -from ._models_py3 import ResourceUpdate -from ._models_py3 import RunCommandInputParameter -from ._models_py3 import RunCommandManagedIdentity -from ._models_py3 import ServiceStatus -from ._models_py3 import ServiceStatuses -from ._models_py3 import Settings -from ._models_py3 import StorageProfile -from ._models_py3 import Subnet -from ._models_py3 import SystemData -from ._models_py3 import TagsResource -from ._models_py3 import TrackedResource -from ._models_py3 import TrackedResourceAutoGenerated -from ._models_py3 import VolumeLicenseDetails -from ._models_py3 import WindowsParameters +from typing import TYPE_CHECKING -from ._hybrid_compute_management_client_enums import AccessMode -from ._hybrid_compute_management_client_enums import AccessRuleDirection -from ._hybrid_compute_management_client_enums import AgentConfigurationMode -from ._hybrid_compute_management_client_enums import ArcKindEnum -from ._hybrid_compute_management_client_enums import AssessmentModeTypes -from ._hybrid_compute_management_client_enums import CreatedByType -from ._hybrid_compute_management_client_enums import EsuEligibility -from ._hybrid_compute_management_client_enums import EsuKeyState -from ._hybrid_compute_management_client_enums import EsuServerType -from ._hybrid_compute_management_client_enums import ExecutionState -from ._hybrid_compute_management_client_enums import ExtensionsStatusLevelTypes -from ._hybrid_compute_management_client_enums import GatewayType -from ._hybrid_compute_management_client_enums import HotpatchEnablementStatus -from ._hybrid_compute_management_client_enums import InstanceViewTypes -from ._hybrid_compute_management_client_enums import LastAttemptStatusEnum -from ._hybrid_compute_management_client_enums import LicenseAssignmentState -from ._hybrid_compute_management_client_enums import LicenseCoreType -from ._hybrid_compute_management_client_enums import LicenseEdition -from ._hybrid_compute_management_client_enums import LicenseProfileProductType -from ._hybrid_compute_management_client_enums import LicenseProfileSubscriptionStatus -from ._hybrid_compute_management_client_enums import LicenseProfileSubscriptionStatusUpdate -from ._hybrid_compute_management_client_enums import LicenseState -from ._hybrid_compute_management_client_enums import LicenseStatus -from ._hybrid_compute_management_client_enums import LicenseTarget -from ._hybrid_compute_management_client_enums import LicenseType -from ._hybrid_compute_management_client_enums import OsType -from ._hybrid_compute_management_client_enums import PatchModeTypes -from ._hybrid_compute_management_client_enums import PatchOperationStartedBy -from ._hybrid_compute_management_client_enums import PatchOperationStatus -from ._hybrid_compute_management_client_enums import PatchServiceUsed -from ._hybrid_compute_management_client_enums import ProgramYear -from ._hybrid_compute_management_client_enums import ProvisioningIssueSeverity -from ._hybrid_compute_management_client_enums import ProvisioningIssueType -from ._hybrid_compute_management_client_enums import ProvisioningState -from ._hybrid_compute_management_client_enums import PublicNetworkAccessType -from ._hybrid_compute_management_client_enums import StatusLevelTypes -from ._hybrid_compute_management_client_enums import StatusTypes -from ._hybrid_compute_management_client_enums import VMGuestPatchClassificationLinux -from ._hybrid_compute_management_client_enums import VMGuestPatchClassificationWindows -from ._hybrid_compute_management_client_enums import VMGuestPatchRebootSetting -from ._hybrid_compute_management_client_enums import VMGuestPatchRebootStatus +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models_py3 import ( # type: ignore + AccessRule, + AgentConfiguration, + AgentUpgrade, + AgentVersion, + AgentVersionsList, + AvailablePatchCountByClassification, + CloudMetadata, + ConfigurationExtension, + ConnectionDetail, + Disk, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + EsuKey, + ExtensionPublisher, + ExtensionPublisherListResult, + ExtensionTargetProperties, + ExtensionType, + ExtensionTypeListResult, + ExtensionValue, + ExtensionValueListResult, + ExtensionValueListResultV2, + ExtensionValueProperties, + ExtensionValueV2, + ExtensionValueV2Properties, + ExtensionsResourceStatus, + FirmwareProfile, + Gateway, + GatewayUpdate, + GatewaysListResult, + HardwareProfile, + HybridComputePrivateLinkScope, + HybridComputePrivateLinkScopeListResult, + HybridComputePrivateLinkScopeProperties, + HybridIdentityMetadata, + HybridIdentityMetadataList, + Identity, + IpAddress, + KeyDetails, + KeyProperties, + License, + LicenseDetails, + LicenseProfile, + LicenseProfileArmEsuProperties, + LicenseProfileArmEsuPropertiesWithoutAssignedLicense, + LicenseProfileMachineInstanceView, + LicenseProfileMachineInstanceViewEsuProperties, + LicenseProfileStorageModelEsuProperties, + LicenseProfileUpdate, + LicenseProfilesListResult, + LicenseUpdate, + LicensesListResult, + LinuxParameters, + LocationData, + Machine, + MachineAssessPatchesResult, + MachineExtension, + MachineExtensionInstanceView, + MachineExtensionInstanceViewStatus, + MachineExtensionProperties, + MachineExtensionUpdate, + MachineExtensionUpgrade, + MachineExtensionsListResult, + MachineInstallPatchesParameters, + MachineInstallPatchesResult, + MachineListResult, + MachineRunCommand, + MachineRunCommandInstanceView, + MachineRunCommandScriptSource, + MachineRunCommandUpdate, + MachineRunCommandsListResult, + MachineUpdate, + NetworkConfiguration, + NetworkInterface, + NetworkProfile, + NetworkSecurityPerimeter, + NetworkSecurityPerimeterConfiguration, + NetworkSecurityPerimeterConfigurationListResult, + NetworkSecurityPerimeterConfigurationReconcileResult, + NetworkSecurityPerimeterProfile, + OSProfile, + OSProfileLinuxConfiguration, + OSProfileWindowsConfiguration, + OperationListResult, + OperationValue, + OperationValueDisplay, + PatchSettingsStatus, + PrivateEndpointConnection, + PrivateEndpointConnectionDataModel, + PrivateEndpointConnectionListResult, + PrivateEndpointConnectionProperties, + PrivateEndpointProperty, + PrivateLinkResource, + PrivateLinkResourceListResult, + PrivateLinkResourceProperties, + PrivateLinkScopeValidationDetails, + PrivateLinkScopesResource, + PrivateLinkServiceConnectionStateProperty, + Processor, + ProductFeature, + ProductFeatureUpdate, + ProvisioningIssue, + ProxyResource, + ProxyResourceAutoGenerated, + Resource, + ResourceAssociation, + ResourceAutoGenerated, + ResourceUpdate, + RunCommandInputParameter, + RunCommandManagedIdentity, + ServiceStatus, + ServiceStatuses, + Settings, + SetupExtensionRequest, + StorageProfile, + Subnet, + SystemData, + TagsResource, + TrackedResource, + VolumeLicenseDetails, + WindowsParameters, +) + +from ._hybrid_compute_management_client_enums import ( # type: ignore + AccessMode, + AccessRuleDirection, + AgentConfigurationMode, + ArcKindEnum, + AssessmentModeTypes, + CreatedByType, + EsuEligibility, + EsuKeyState, + EsuServerType, + ExecutionState, + ExtensionsStatusLevelTypes, + GatewayType, + HotpatchEnablementStatus, + IdentityKeyStore, + InstanceViewTypes, + LastAttemptStatusEnum, + LicenseAssignmentState, + LicenseCoreType, + LicenseEdition, + LicenseProfileProductType, + LicenseProfileSubscriptionStatus, + LicenseProfileSubscriptionStatusUpdate, + LicenseState, + LicenseStatus, + LicenseTarget, + LicenseType, + OsType, + PatchModeTypes, + PatchOperationStartedBy, + PatchOperationStatus, + PatchServiceUsed, + ProgramYear, + ProvisioningIssueSeverity, + ProvisioningIssueType, + ProvisioningState, + PublicNetworkAccessType, + StatusLevelTypes, + StatusTypes, + VMGuestPatchClassificationLinux, + VMGuestPatchClassificationWindows, + VMGuestPatchRebootSetting, + VMGuestPatchRebootStatus, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -180,13 +198,19 @@ "Disk", "ErrorAdditionalInfo", "ErrorDetail", - "ErrorDetailAutoGenerated", "ErrorResponse", - "ErrorResponseAutoGenerated", "EsuKey", + "ExtensionPublisher", + "ExtensionPublisherListResult", "ExtensionTargetProperties", + "ExtensionType", + "ExtensionTypeListResult", "ExtensionValue", "ExtensionValueListResult", + "ExtensionValueListResultV2", + "ExtensionValueProperties", + "ExtensionValueV2", + "ExtensionValueV2Properties", "ExtensionsResourceStatus", "FirmwareProfile", "Gateway", @@ -275,12 +299,12 @@ "ServiceStatus", "ServiceStatuses", "Settings", + "SetupExtensionRequest", "StorageProfile", "Subnet", "SystemData", "TagsResource", "TrackedResource", - "TrackedResourceAutoGenerated", "VolumeLicenseDetails", "WindowsParameters", "AccessMode", @@ -296,6 +320,7 @@ "ExtensionsStatusLevelTypes", "GatewayType", "HotpatchEnablementStatus", + "IdentityKeyStore", "InstanceViewTypes", "LastAttemptStatusEnum", "LicenseAssignmentState", @@ -325,5 +350,5 @@ "VMGuestPatchRebootSetting", "VMGuestPatchRebootStatus", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py index db932333d81b..33a7347ecf54 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py @@ -127,6 +127,13 @@ class HotpatchEnablementStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" +class IdentityKeyStore(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies the identity key store a machine is using.""" + + TPM = "TPM" + DEFAULT = "Default" + + class InstanceViewTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """InstanceViewTypes.""" @@ -338,6 +345,7 @@ class StatusTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): CONNECTED = "Connected" DISCONNECTED = "Disconnected" ERROR = "Error" + AWAITING_CONNECTION = "AwaitingConnection" class VMGuestPatchClassificationLinux(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py index 90a242ba5a95..7af97fda1e92 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py @@ -1,5 +1,5 @@ -# coding=utf-8 # pylint: disable=too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -13,7 +13,6 @@ from .. import _serialization if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models @@ -541,49 +540,6 @@ def __init__(self, **kwargs: Any) -> None: self.additional_info = None -class ErrorDetailAutoGenerated(_serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.hybridcompute.models.ErrorDetailAutoGenerated] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.hybridcompute.models.ErrorAdditionalInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDetailAutoGenerated]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - 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.). @@ -605,27 +561,6 @@ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: A self.error = error -class ErrorResponseAutoGenerated(_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.hybridcompute.models.ErrorDetailAutoGenerated - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetailAutoGenerated"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDetailAutoGenerated"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.hybridcompute.models.ErrorDetailAutoGenerated - """ - super().__init__(**kwargs) - self.error = error - - class EsuKey(_serialization.Model): """ESU key. @@ -654,6 +589,68 @@ def __init__(self, *, sku: Optional[str] = None, license_status: Optional[int] = self.license_status = license_status +class ExtensionPublisher(_serialization.Model): + """Describes an Extension Publisher. + + :ivar id: The ID of the extension publisher. + :vartype id: str + :ivar name: The name of the extension publisher. + :vartype name: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: The ID of the extension publisher. + :paramtype id: str + :keyword name: The name of the extension publisher. + :paramtype name: str + """ + super().__init__(**kwargs) + self.id = id + self.name = name + + +class ExtensionPublisherListResult(_serialization.Model): + """The List of Extension Publishers. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of extension publishers. + :vartype value: list[~azure.mgmt.hybridcompute.models.ExtensionPublisher] + :ivar next_link: The URI to fetch the next page of extension publishers. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ExtensionPublisher]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: The URI to fetch the next page of extension publishers. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = None + self.next_link = next_link + + class ExtensionsResourceStatus(_serialization.Model): """Instance view status. @@ -727,13 +724,75 @@ def __init__(self, *, target_version: Optional[str] = None, **kwargs: Any) -> No self.target_version = target_version -class ResourceAutoGenerated(_serialization.Model): +class ExtensionType(_serialization.Model): + """Describes an Extension Type. + + :ivar id: The ID of the extension type. + :vartype id: str + :ivar name: The name of the extension type. + :vartype name: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: The ID of the extension type. + :paramtype id: str + :keyword name: The name of the extension type. + :paramtype name: str + """ + super().__init__(**kwargs) + self.id = id + self.name = name + + +class ExtensionTypeListResult(_serialization.Model): + """The List of Extension Types. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of extension types. + :vartype value: list[~azure.mgmt.hybridcompute.models.ExtensionType] + :ivar next_link: The URI to fetch the next page of extension types. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ExtensionType]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: The URI to fetch the next page of extension types. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class Resource(_serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -768,14 +827,14 @@ def __init__(self, **kwargs: Any) -> None: self.system_data = None -class ProxyResource(ResourceAutoGenerated): +class ProxyResource(Resource): """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -793,8 +852,8 @@ class ExtensionValue(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -863,6 +922,252 @@ def __init__(self, **kwargs: Any) -> None: self.value = None +class ExtensionValueListResultV2(_serialization.Model): + """The List Extension Metadata response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of extension metadata. + :vartype value: list[~azure.mgmt.hybridcompute.models.ExtensionValueV2] + :ivar next_link: The URI to fetch the next page of extension metadata. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ExtensionValueV2]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: The URI to fetch the next page of extension metadata. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class ExtensionValueProperties(_serialization.Model): + """Describes Extension Metadata properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar version: The version of the Extension being received. + :vartype version: str + :ivar extension_type: The type of the Extension being received. + :vartype extension_type: str + :ivar publisher: The publisher of the Extension being received. + :vartype publisher: str + """ + + _validation = { + "version": {"readonly": True}, + "extension_type": {"readonly": True}, + "publisher": {"readonly": True}, + } + + _attribute_map = { + "version": {"key": "version", "type": "str"}, + "extension_type": {"key": "extensionType", "type": "str"}, + "publisher": {"key": "publisher", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.version = None + self.extension_type = None + self.publisher = None + + +class ResourceAutoGenerated(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class ProxyResourceAutoGenerated(ResourceAutoGenerated): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + """ + + +class ExtensionValueV2(ProxyResourceAutoGenerated): + """Describes an Extension Metadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + :ivar version: The version of the Extension being received. + :vartype version: str + :ivar extension_type: The type of the Extension being received. + :vartype extension_type: str + :ivar publisher: The publisher of the Extension being received. + :vartype publisher: str + :ivar extension_uris: A list of locations where the extension packages can be found. + :vartype extension_uris: list[str] + :ivar extension_signature_uri: Location of the signature files for the extension. + :vartype extension_signature_uri: str + :ivar operating_system: The operating system (Windows, Linux, etc.) this extension supports. + :vartype operating_system: str + :ivar architecture: Architectures (x64, arms64, etc.) that this extension supports. + :vartype architecture: list[str] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "version": {"readonly": True}, + "extension_type": {"readonly": True}, + "publisher": {"readonly": True}, + "extension_uris": {"readonly": True}, + "extension_signature_uri": {"readonly": True}, + "operating_system": {"readonly": True}, + "architecture": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "version": {"key": "properties.version", "type": "str"}, + "extension_type": {"key": "properties.extensionType", "type": "str"}, + "publisher": {"key": "properties.publisher", "type": "str"}, + "extension_uris": {"key": "properties.extensionUris", "type": "[str]"}, + "extension_signature_uri": {"key": "properties.extensionSignatureUri", "type": "str"}, + "operating_system": {"key": "properties.operatingSystem", "type": "str"}, + "architecture": {"key": "properties.architecture", "type": "[str]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.version = None + self.extension_type = None + self.publisher = None + self.extension_uris = None + self.extension_signature_uri = None + self.operating_system = None + self.architecture = None + + +class ExtensionValueV2Properties(ExtensionValueProperties): + """Describes Extension Metadata properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar version: The version of the Extension being received. + :vartype version: str + :ivar extension_type: The type of the Extension being received. + :vartype extension_type: str + :ivar publisher: The publisher of the Extension being received. + :vartype publisher: str + :ivar extension_uris: A list of locations where the extension packages can be found. + :vartype extension_uris: list[str] + :ivar extension_signature_uri: Location of the signature files for the extension. + :vartype extension_signature_uri: str + :ivar operating_system: The operating system (Windows, Linux, etc.) this extension supports. + :vartype operating_system: str + :ivar architecture: Architectures (x64, arms64, etc.) that this extension supports. + :vartype architecture: list[str] + """ + + _validation = { + "version": {"readonly": True}, + "extension_type": {"readonly": True}, + "publisher": {"readonly": True}, + "extension_uris": {"readonly": True}, + "extension_signature_uri": {"readonly": True}, + "operating_system": {"readonly": True}, + "architecture": {"readonly": True}, + } + + _attribute_map = { + "version": {"key": "version", "type": "str"}, + "extension_type": {"key": "extensionType", "type": "str"}, + "publisher": {"key": "publisher", "type": "str"}, + "extension_uris": {"key": "extensionUris", "type": "[str]"}, + "extension_signature_uri": {"key": "extensionSignatureUri", "type": "str"}, + "operating_system": {"key": "operatingSystem", "type": "str"}, + "architecture": {"key": "architecture", "type": "[str]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.extension_uris = None + self.extension_signature_uri = None + self.operating_system = None + self.architecture = None + + class FirmwareProfile(_serialization.Model): """Describes the firmware of the machine. @@ -891,7 +1196,7 @@ def __init__(self, **kwargs: Any) -> None: self.type = None -class TrackedResourceAutoGenerated(ResourceAutoGenerated): +class TrackedResource(Resource): """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. @@ -899,8 +1204,8 @@ class TrackedResourceAutoGenerated(ResourceAutoGenerated): All required parameters must be populated in order to send to server. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -945,15 +1250,15 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw self.location = location -class Gateway(TrackedResourceAutoGenerated): # pylint: disable=too-many-instance-attributes +class Gateway(TrackedResource): """Describes an Arc Gateway. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1347,68 +1652,7 @@ def __init__( self.private_endpoint_connections = None -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ProxyResourceAutoGenerated(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - """ - - -class HybridIdentityMetadata(ProxyResourceAutoGenerated): +class HybridIdentityMetadata(ProxyResource): """Defines the HybridIdentityMetadata. Variables are only populated by the server, and will be ignored when sending a request. @@ -1631,60 +1875,6 @@ def __init__(self, **kwargs: Any) -> None: self.candidate_public_key = None -class TrackedResource(Resource): - """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. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - """ - super().__init__(**kwargs) - self.tags = tags - self.location = location - - class License(TrackedResource): """Describes a license in a hybrid machine. @@ -1853,7 +2043,7 @@ def __init__( self.volume_license_details = volume_license_details -class LicenseProfile(TrackedResource): # pylint: disable=too-many-instance-attributes +class LicenseProfile(TrackedResource): """Describes a license profile in a hybrid machine. Variables are only populated by the server, and will be ignored when sending a request. @@ -2135,7 +2325,7 @@ def __init__(self, *, assigned_license: Optional[str] = None, **kwargs: Any) -> self.assigned_license = assigned_license -class LicenseProfileMachineInstanceView(_serialization.Model): # pylint: disable=too-many-instance-attributes +class LicenseProfileMachineInstanceView(_serialization.Model): """License Profile Instance View in Machine Properties. Variables are only populated by the server, and will be ignored when sending a request. @@ -2617,7 +2807,7 @@ def __init__( self.country_or_region = country_or_region -class Machine(TrackedResource): # pylint: disable=too-many-instance-attributes +class Machine(TrackedResource): """Describes a hybrid machine. Variables are only populated by the server, and will be ignored when sending a request. @@ -2670,7 +2860,7 @@ class Machine(TrackedResource): # pylint: disable=too-many-instance-attributes :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar status: The status of the hybrid machine agent. Known values are: "Connected", - "Disconnected", and "Error". + "Disconnected", "Error", and "AwaitingConnection". :vartype status: str or ~azure.mgmt.hybridcompute.models.StatusTypes :ivar last_status_change: The time of the last status change. :vartype last_status_change: ~datetime.datetime @@ -2687,6 +2877,12 @@ class Machine(TrackedResource): # pylint: disable=too-many-instance-attributes :ivar client_public_key: Public Key that the client provides to be used during initial resource onboarding. :vartype client_public_key: str + :ivar identity_key_store: Specifies the identity key store a machine is using. Known values + are: "TPM" and "Default". + :vartype identity_key_store: str or ~azure.mgmt.hybridcompute.models.IdentityKeyStore + :ivar tpm_ek_certificate: Endorsement Key Certificate of the Trusted Platform Module (TPM) that + the client provides to be used during initial resource onboarding. + :vartype tpm_ek_certificate: str :ivar os_name: The Operating System running on the hybrid machine. :vartype os_name: str :ivar os_version: The version of Operating System running on the hybrid machine. @@ -2713,6 +2909,9 @@ class Machine(TrackedResource): # pylint: disable=too-many-instance-attributes :ivar parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. :vartype parent_cluster_resource_id: str + :ivar hardware_resource_id: Specifies the resource ID of the associated hardware device. Only + settable by HCI RP. + :vartype hardware_resource_id: str :ivar mssql_discovered: Specifies whether any MS SQL instance is discovered on the machine. :vartype mssql_discovered: str :ivar detected_properties: Detected properties from the machine. @@ -2780,6 +2979,8 @@ class Machine(TrackedResource): # pylint: disable=too-many-instance-attributes "display_name": {"key": "properties.displayName", "type": "str"}, "machine_fqdn": {"key": "properties.machineFqdn", "type": "str"}, "client_public_key": {"key": "properties.clientPublicKey", "type": "str"}, + "identity_key_store": {"key": "properties.identityKeyStore", "type": "str"}, + "tpm_ek_certificate": {"key": "properties.tpmEkCertificate", "type": "str"}, "os_name": {"key": "properties.osName", "type": "str"}, "os_version": {"key": "properties.osVersion", "type": "str"}, "os_type": {"key": "properties.osType", "type": "str"}, @@ -2792,6 +2993,7 @@ class Machine(TrackedResource): # pylint: disable=too-many-instance-attributes "dns_fqdn": {"key": "properties.dnsFqdn", "type": "str"}, "private_link_scope_resource_id": {"key": "properties.privateLinkScopeResourceId", "type": "str"}, "parent_cluster_resource_id": {"key": "properties.parentClusterResourceId", "type": "str"}, + "hardware_resource_id": {"key": "properties.hardwareResourceId", "type": "str"}, "mssql_discovered": {"key": "properties.mssqlDiscovered", "type": "str"}, "detected_properties": {"key": "properties.detectedProperties", "type": "{str}"}, "network_profile": {"key": "properties.networkProfile", "type": "NetworkProfile"}, @@ -2812,10 +3014,13 @@ def __init__( # pylint: disable=too-many-locals license_profile: Optional["_models.LicenseProfileMachineInstanceView"] = None, vm_id: Optional[str] = None, client_public_key: Optional[str] = None, + identity_key_store: Optional[Union[str, "_models.IdentityKeyStore"]] = None, + tpm_ek_certificate: Optional[str] = None, os_type: Optional[str] = None, extensions: Optional[List["_models.MachineExtensionInstanceView"]] = None, private_link_scope_resource_id: Optional[str] = None, parent_cluster_resource_id: Optional[str] = None, + hardware_resource_id: Optional[str] = None, mssql_discovered: Optional[str] = None, **kwargs: Any ) -> None: @@ -2846,6 +3051,12 @@ def __init__( # pylint: disable=too-many-locals :keyword client_public_key: Public Key that the client provides to be used during initial resource onboarding. :paramtype client_public_key: str + :keyword identity_key_store: Specifies the identity key store a machine is using. Known values + are: "TPM" and "Default". + :paramtype identity_key_store: str or ~azure.mgmt.hybridcompute.models.IdentityKeyStore + :keyword tpm_ek_certificate: Endorsement Key Certificate of the Trusted Platform Module (TPM) + that the client provides to be used during initial resource onboarding. + :paramtype tpm_ek_certificate: str :keyword os_type: The type of Operating System (windows/linux). :paramtype os_type: str :keyword extensions: Machine Extensions information (deprecated field). @@ -2856,6 +3067,9 @@ def __init__( # pylint: disable=too-many-locals :keyword parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. :paramtype parent_cluster_resource_id: str + :keyword hardware_resource_id: Specifies the resource ID of the associated hardware device. + Only settable by HCI RP. + :paramtype hardware_resource_id: str :keyword mssql_discovered: Specifies whether any MS SQL instance is discovered on the machine. :paramtype mssql_discovered: str """ @@ -2882,6 +3096,8 @@ def __init__( # pylint: disable=too-many-locals self.display_name = None self.machine_fqdn = None self.client_public_key = client_public_key + self.identity_key_store = identity_key_store + self.tpm_ek_certificate = tpm_ek_certificate self.os_name = None self.os_version = None self.os_type = os_type @@ -2894,6 +3110,7 @@ def __init__( # pylint: disable=too-many-locals self.dns_fqdn = None self.private_link_scope_resource_id = private_link_scope_resource_id self.parent_cluster_resource_id = parent_cluster_resource_id + self.hardware_resource_id = hardware_resource_id self.mssql_discovered = mssql_discovered self.detected_properties = None self.network_profile = None @@ -3463,7 +3680,7 @@ def __init__( self.linux_parameters = linux_parameters -class MachineInstallPatchesResult(_serialization.Model): # pylint: disable=too-many-instance-attributes +class MachineInstallPatchesResult(_serialization.Model): """The result summary of an installation operation. Variables are only populated by the server, and will be ignored when sending a request. @@ -3604,7 +3821,7 @@ def __init__(self, *, value: List["_models.Machine"], next_link: Optional[str] = self.next_link = next_link -class MachineRunCommand(TrackedResource): # pylint: disable=too-many-instance-attributes +class MachineRunCommand(TrackedResource): """Describes a Run Command. Variables are only populated by the server, and will be ignored when sending a request. @@ -3993,6 +4210,11 @@ class MachineUpdate(ResourceUpdate): :ivar private_link_scope_resource_id: The resource id of the private link scope this machine is assigned to, if any. :vartype private_link_scope_resource_id: str + :ivar identity_key_store: Identity key store type of the machine. + :vartype identity_key_store: str + :ivar tpm_ek_certificate: Endorsement Key Certificate of the Trusted Platform Module (TPM) that + the client provides to be used during initial resource onboarding. + :vartype tpm_ek_certificate: str """ _attribute_map = { @@ -4005,6 +4227,8 @@ class MachineUpdate(ResourceUpdate): "agent_upgrade": {"key": "properties.agentUpgrade", "type": "AgentUpgrade"}, "parent_cluster_resource_id": {"key": "properties.parentClusterResourceId", "type": "str"}, "private_link_scope_resource_id": {"key": "properties.privateLinkScopeResourceId", "type": "str"}, + "identity_key_store": {"key": "properties.identityKeyStore", "type": "str"}, + "tpm_ek_certificate": {"key": "properties.tpmEkCertificate", "type": "str"}, } def __init__( @@ -4019,6 +4243,8 @@ def __init__( agent_upgrade: Optional["_models.AgentUpgrade"] = None, parent_cluster_resource_id: Optional[str] = None, private_link_scope_resource_id: Optional[str] = None, + identity_key_store: Optional[str] = None, + tpm_ek_certificate: Optional[str] = None, **kwargs: Any ) -> None: """ @@ -4043,6 +4269,11 @@ def __init__( :keyword private_link_scope_resource_id: The resource id of the private link scope this machine is assigned to, if any. :paramtype private_link_scope_resource_id: str + :keyword identity_key_store: Identity key store type of the machine. + :paramtype identity_key_store: str + :keyword tpm_ek_certificate: Endorsement Key Certificate of the Trusted Platform Module (TPM) + that the client provides to be used during initial resource onboarding. + :paramtype tpm_ek_certificate: str """ super().__init__(tags=tags, **kwargs) self.identity = identity @@ -4053,9 +4284,11 @@ def __init__( self.agent_upgrade = agent_upgrade self.parent_cluster_resource_id = parent_cluster_resource_id self.private_link_scope_resource_id = private_link_scope_resource_id + self.identity_key_store = identity_key_store + self.tpm_ek_certificate = tpm_ek_certificate -class NetworkConfiguration(ProxyResourceAutoGenerated): +class NetworkConfiguration(ProxyResource): """NetworkConfiguration. Variables are only populated by the server, and will be ignored when sending a request. @@ -4697,7 +4930,7 @@ def __init__( self.error = None -class PrivateEndpointConnection(ProxyResourceAutoGenerated): +class PrivateEndpointConnection(ProxyResource): """A private endpoint connection. Variables are only populated by the server, and will be ignored when sending a request. @@ -4887,7 +5120,7 @@ def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylin self.id = id -class PrivateLinkResource(ProxyResourceAutoGenerated): +class PrivateLinkResource(ProxyResource): """A private link resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -5418,7 +5651,7 @@ def __init__( self.guest_configuration_service = guest_configuration_service -class Settings(ProxyResourceAutoGenerated): +class Settings(ProxyResource): """Settings. Variables are only populated by the server, and will be ignored when sending a request. @@ -5467,6 +5700,28 @@ def __init__(self, *, gateway_resource_id: Optional[str] = None, **kwargs: Any) self.gateway_resource_id = gateway_resource_id +class SetupExtensionRequest(_serialization.Model): + """SetupExtensionRequest. + + :ivar extensions: The list of extensions. + :vartype extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionProperties] + """ + + _attribute_map = { + "extensions": {"key": "extensions", "type": "[MachineExtensionProperties]"}, + } + + def __init__( + self, *, extensions: Optional[List["_models.MachineExtensionProperties"]] = None, **kwargs: Any + ) -> None: + """ + :keyword extensions: The list of extensions. + :paramtype extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionProperties] + """ + super().__init__(**kwargs) + self.extensions = extensions + + class StorageProfile(_serialization.Model): """Describes the storage configuration of the machine. @@ -5643,6 +5898,16 @@ class WindowsParameters(_serialization.Model): :ivar max_patch_publish_date: This is used to install patches that were published on or before this given max published date. :vartype max_patch_publish_date: ~datetime.datetime + :ivar patch_name_masks_to_include: This is used to include patches that match the given patch + name masks. Alphanumeric strings and wildcard expressions consisting of * and ? are only + supported as input values in the list. Null, empty and only whitespaces strings as inputs + values are not supported. + :vartype patch_name_masks_to_include: list[str] + :ivar patch_name_masks_to_exclude: This is used to exclude patches that match the given patch + name masks. Alphanumeric strings and wildcard expressions consisting of * and ? are only + supported as input values in the list. Null, empty and only whitespaces strings as inputs + values are not supported. + :vartype patch_name_masks_to_exclude: list[str] """ _attribute_map = { @@ -5651,6 +5916,8 @@ class WindowsParameters(_serialization.Model): "kb_numbers_to_exclude": {"key": "kbNumbersToExclude", "type": "[str]"}, "exclude_kbs_requiring_reboot": {"key": "excludeKbsRequiringReboot", "type": "bool"}, "max_patch_publish_date": {"key": "maxPatchPublishDate", "type": "iso-8601"}, + "patch_name_masks_to_include": {"key": "patchNameMasksToInclude", "type": "[str]"}, + "patch_name_masks_to_exclude": {"key": "patchNameMasksToExclude", "type": "[str]"}, } def __init__( @@ -5661,6 +5928,8 @@ def __init__( kb_numbers_to_exclude: Optional[List[str]] = None, exclude_kbs_requiring_reboot: Optional[bool] = None, max_patch_publish_date: Optional[datetime.datetime] = None, + patch_name_masks_to_include: Optional[List[str]] = None, + patch_name_masks_to_exclude: Optional[List[str]] = None, **kwargs: Any ) -> None: """ @@ -5678,6 +5947,16 @@ def __init__( :keyword max_patch_publish_date: This is used to install patches that were published on or before this given max published date. :paramtype max_patch_publish_date: ~datetime.datetime + :keyword patch_name_masks_to_include: This is used to include patches that match the given + patch name masks. Alphanumeric strings and wildcard expressions consisting of * and ? are only + supported as input values in the list. Null, empty and only whitespaces strings as inputs + values are not supported. + :paramtype patch_name_masks_to_include: list[str] + :keyword patch_name_masks_to_exclude: This is used to exclude patches that match the given + patch name masks. Alphanumeric strings and wildcard expressions consisting of * and ? are only + supported as input values in the list. Null, empty and only whitespaces strings as inputs + values are not supported. + :paramtype patch_name_masks_to_exclude: list[str] """ super().__init__(**kwargs) self.classifications_to_include = classifications_to_include @@ -5685,3 +5964,5 @@ def __init__( self.kb_numbers_to_exclude = kb_numbers_to_exclude self.exclude_kbs_requiring_reboot = exclude_kbs_requiring_reboot self.max_patch_publish_date = max_patch_publish_date + self.patch_name_masks_to_include = patch_name_masks_to_include + self.patch_name_masks_to_exclude = patch_name_masks_to_exclude diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py index 068f98844fb6..e5655430283c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py @@ -5,25 +5,34 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._licenses_operations import LicensesOperations -from ._machines_operations import MachinesOperations -from ._license_profiles_operations import LicenseProfilesOperations -from ._machine_extensions_operations import MachineExtensionsOperations -from ._hybrid_compute_management_client_operations import HybridComputeManagementClientOperationsMixin -from ._extension_metadata_operations import ExtensionMetadataOperations -from ._operations import Operations -from ._network_profile_operations import NetworkProfileOperations -from ._machine_run_commands_operations import MachineRunCommandsOperations -from ._gateways_operations import GatewaysOperations -from ._settings_operations import SettingsOperations -from ._private_link_scopes_operations import PrivateLinkScopesOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._network_security_perimeter_configurations_operations import NetworkSecurityPerimeterConfigurationsOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._licenses_operations import LicensesOperations # type: ignore +from ._machines_operations import MachinesOperations # type: ignore +from ._license_profiles_operations import LicenseProfilesOperations # type: ignore +from ._machine_extensions_operations import MachineExtensionsOperations # type: ignore +from ._hybrid_compute_management_client_operations import HybridComputeManagementClientOperationsMixin # type: ignore +from ._extension_metadata_operations import ExtensionMetadataOperations # type: ignore +from ._extension_metadata_v2_operations import ExtensionMetadataV2Operations # type: ignore +from ._extension_type_operations import ExtensionTypeOperations # type: ignore +from ._extension_publisher_operations import ExtensionPublisherOperations # type: ignore +from ._operations import Operations # type: ignore +from ._network_profile_operations import NetworkProfileOperations # type: ignore +from ._machine_run_commands_operations import MachineRunCommandsOperations # type: ignore +from ._gateways_operations import GatewaysOperations # type: ignore +from ._settings_operations import SettingsOperations # type: ignore +from ._private_link_scopes_operations import PrivateLinkScopesOperations # type: ignore +from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore +from ._network_security_perimeter_configurations_operations import NetworkSecurityPerimeterConfigurationsOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -33,6 +42,9 @@ "MachineExtensionsOperations", "HybridComputeManagementClientOperationsMixin", "ExtensionMetadataOperations", + "ExtensionMetadataV2Operations", + "ExtensionTypeOperations", + "ExtensionPublisherOperations", "Operations", "NetworkProfileOperations", "MachineRunCommandsOperations", @@ -43,5 +55,5 @@ "PrivateEndpointConnectionsOperations", "NetworkSecurityPerimeterConfigurationsOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_operations.py index 74e29388abb6..d684f9e5196b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +44,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +77,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +140,7 @@ def get( :rtype: ~azure.mgmt.hybridcompute.models.ExtensionValue :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -208,7 +207,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExtensionValueListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_v2_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_v2_operations.py new file mode 100644 index 000000000000..3a1cf816daa2 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_v2_operations.py @@ -0,0 +1,264 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# 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 + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request(location: str, publisher: str, extension_type: str, version: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str", min_length=1), + "publisher": _SERIALIZER.url("publisher", publisher, "str"), + "extensionType": _SERIALIZER.url("extension_type", extension_type, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request(location: str, publisher: str, extension_type: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str", min_length=1), + "publisher": _SERIALIZER.url("publisher", publisher, "str"), + "extensionType": _SERIALIZER.url("extension_type", extension_type, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ExtensionMetadataV2Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.HybridComputeManagementClient`'s + :attr:`extension_metadata_v2` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, location: str, publisher: str, extension_type: str, version: str, **kwargs: Any + ) -> _models.ExtensionValueV2: + """Gets an Extension Metadata based on location, publisher, extensionType and version. + + :param location: The name of Azure region. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :param extension_type: The extensionType of the Extension being received. Required. + :type extension_type: str + :param version: The version of the Extension being received. Required. + :type version: str + :return: ExtensionValueV2 or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.ExtensionValueV2 + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionValueV2] = kwargs.pop("cls", None) + + _request = build_get_request( + location=location, + publisher=publisher, + extension_type=extension_type, + version=version, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExtensionValueV2", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, location: str, publisher: str, extension_type: str, **kwargs: Any + ) -> Iterable["_models.ExtensionValueV2"]: + """Gets all Extension versions based on location, publisher, extensionType. + + :param location: The name of Azure region. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :param extension_type: The extensionType of the Extension being received. Required. + :type extension_type: str + :return: An iterator like instance of either ExtensionValueV2 or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.ExtensionValueV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionValueListResultV2] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + publisher=publisher, + extension_type=extension_type, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionValueListResultV2", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + 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=_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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_publisher_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_publisher_operations.py new file mode 100644 index 000000000000..40b3b93c75f7 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_publisher_operations.py @@ -0,0 +1,159 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# 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 + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(location: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.HybridCompute/locations/{location}/publishers") + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ExtensionPublisherOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.HybridComputeManagementClient`'s + :attr:`extension_publisher` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> Iterable["_models.ExtensionPublisher"]: + """Gets all Extension publishers based on the location. + + :param location: The name of Azure region. Required. + :type location: str + :return: An iterator like instance of either ExtensionPublisher or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.ExtensionPublisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionPublisherListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionPublisherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + 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=_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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_type_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_type_operations.py new file mode 100644 index 000000000000..03328964d08b --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_type_operations.py @@ -0,0 +1,165 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# 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 + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(location: str, publisher: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes" + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str", min_length=1), + "publisher": _SERIALIZER.url("publisher", publisher, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ExtensionTypeOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.HybridComputeManagementClient`'s + :attr:`extension_type` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, location: str, publisher: str, **kwargs: Any) -> Iterable["_models.ExtensionType"]: + """Gets all Extension types based on location and publisher. + + :param location: The name of Azure region. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :return: An iterator like instance of either ExtensionType or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.ExtensionType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionTypeListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + publisher=publisher, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionTypeListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + 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=_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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_gateways_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_gateways_operations.py index 064a80db8086..31a63a8712fc 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_gateways_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_gateways_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +49,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -86,7 +85,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -120,7 +119,7 @@ def build_get_request(resource_group_name: str, gateway_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +152,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +183,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +213,7 @@ def build_list_by_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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +255,7 @@ def __init__(self, *args, **kwargs): def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, parameters: Union[_models.Gateway, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -306,7 +305,7 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -519,7 +518,7 @@ def update( :rtype: ~azure.mgmt.hybridcompute.models.Gateway :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -564,7 +563,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Gateway", pipeline_response.http_response) @@ -587,7 +586,7 @@ def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.hybridcompute.models.Gateway :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -620,7 +619,7 @@ def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> _mo if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Gateway", pipeline_response.http_response) @@ -631,7 +630,7 @@ def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> _mo return deserialized # type: ignore def _delete_initial(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -669,7 +668,7 @@ def _delete_initial(self, resource_group_name: str, gateway_name: str, **kwargs: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -757,7 +756,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GatewaysListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -812,7 +811,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -833,7 +832,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Gateway"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GatewaysListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -887,7 +886,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + 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/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py index cb8e8f1ac20e..e0acea94c73f 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,7 +34,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +48,7 @@ def build_upgrade_extensions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -81,6 +80,44 @@ def build_upgrade_extensions_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_setup_extensions_request( + resource_group_name: str, machine_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/addExtensions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", max_length=54, min_length=1, pattern=r"^[a-zA-Z0-9-_\.]{1,54}$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class HybridComputeManagementClientOperationsMixin( # pylint: disable=name-too-long HybridComputeManagementClientMixinABC ): @@ -92,7 +129,7 @@ def _upgrade_extensions_initial( extension_upgrade_parameters: Union[_models.MachineExtensionUpgrade, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -281,3 +318,204 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _setup_extensions_initial( + self, + resource_group_name: str, + machine_name: str, + extensions: Union[_models.SetupExtensionRequest, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + 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[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(extensions, (IOBase, bytes)): + _content = extensions + else: + _json = self._serialize.body(extensions, "SetupExtensionRequest") + + _request = build_setup_extensions_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_setup_extensions( + self, + resource_group_name: str, + machine_name: str, + extensions: _models.SetupExtensionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SetupExtensionRequest]: + """The operation to Setup Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param extensions: Parameters supplied to the Setup Extensions operation. Required. + :type extensions: ~azure.mgmt.hybridcompute.models.SetupExtensionRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either SetupExtensionRequest or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.SetupExtensionRequest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_setup_extensions( + self, + resource_group_name: str, + machine_name: str, + extensions: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SetupExtensionRequest]: + """The operation to Setup Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param extensions: Parameters supplied to the Setup Extensions operation. Required. + :type extensions: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either SetupExtensionRequest or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.SetupExtensionRequest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_setup_extensions( + self, + resource_group_name: str, + machine_name: str, + extensions: Union[_models.SetupExtensionRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SetupExtensionRequest]: + """The operation to Setup Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param extensions: Parameters supplied to the Setup Extensions operation. Is either a + SetupExtensionRequest type or a IO[bytes] type. Required. + :type extensions: ~azure.mgmt.hybridcompute.models.SetupExtensionRequest or IO[bytes] + :return: An instance of LROPoller that returns either SetupExtensionRequest or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.SetupExtensionRequest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + 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.SetupExtensionRequest] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._setup_extensions_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + extensions=extensions, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SetupExtensionRequest", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SetupExtensionRequest].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SetupExtensionRequest]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_license_profiles_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_license_profiles_operations.py index b0e5aa46bd49..28d0b33be3ec 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_license_profiles_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_license_profiles_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Literal, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Literal, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +49,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) license_profile_name: Literal["default"] = kwargs.pop("license_profile_name", "default") content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -88,7 +87,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) license_profile_name: Literal["default"] = kwargs.pop("license_profile_name", "default") content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -124,7 +123,7 @@ def build_get_request(resource_group_name: str, machine_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) license_profile_name: Literal["default"] = kwargs.pop("license_profile_name", "default") accept = _headers.pop("Accept", "application/json") @@ -159,7 +158,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) license_profile_name: Literal["default"] = kwargs.pop("license_profile_name", "default") accept = _headers.pop("Accept", "application/json") @@ -192,7 +191,7 @@ def build_list_request(resource_group_name: str, machine_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -247,7 +246,7 @@ def _create_or_update_initial( parameters: Union[_models.LicenseProfile, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +453,7 @@ def _update_initial( parameters: Union[_models.LicenseProfileUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +664,7 @@ def get(self, resource_group_name: str, machine_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.hybridcompute.models.LicenseProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -711,7 +710,7 @@ def get(self, resource_group_name: str, machine_name: str, **kwargs: Any) -> _mo return deserialized # type: ignore def _delete_initial(self, resource_group_name: str, machine_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -843,7 +842,7 @@ def list(self, resource_group_name: str, machine_name: str, **kwargs: Any) -> It api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LicenseProfilesListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_licenses_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_licenses_operations.py index 3effafa930b7..cbd1fbad3468 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_licenses_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_licenses_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +36,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_validate_license_request(subscription_id: str, **kwargs: Any) -> HttpR _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -79,7 +79,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -115,7 +115,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -149,7 +149,7 @@ def build_get_request(resource_group_name: str, license_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +182,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +213,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +243,7 @@ def build_list_by_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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -285,7 +285,7 @@ def __init__(self, *args, **kwargs): def _validate_license_initial( self, parameters: Union[_models.License, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +436,7 @@ def get_long_running_output(pipeline_response): def _create_or_update_initial( self, resource_group_name: str, license_name: str, parameters: Union[_models.License, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -622,7 +622,7 @@ def _update_initial( parameters: Union[_models.LicenseUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -818,7 +818,7 @@ def get(self, resource_group_name: str, license_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.hybridcompute.models.License :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -862,7 +862,7 @@ def get(self, resource_group_name: str, license_name: str, **kwargs: Any) -> _mo return deserialized # type: ignore def _delete_initial(self, resource_group_name: str, license_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -980,7 +980,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LicensesListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1056,7 +1056,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.License"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LicensesListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py index 21bbfa3a3eff..c0b7feadcd48 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +49,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -89,7 +88,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -128,7 +127,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +163,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +199,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -258,7 +257,7 @@ def _create_or_update_initial( extension_parameters: Union[_models.MachineExtension, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -468,7 +467,7 @@ def _update_initial( extension_parameters: Union[_models.MachineExtensionUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -682,7 +681,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, machine_name: str, extension_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -814,7 +813,7 @@ def get( :rtype: ~azure.mgmt.hybridcompute.models.MachineExtension :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -881,7 +880,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MachineExtensionsListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_run_commands_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_run_commands_operations.py index 55011f16e299..187cf11b638c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_run_commands_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_run_commands_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +49,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -87,7 +86,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +120,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,7 +154,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -211,7 +210,7 @@ def _create_or_update_initial( run_command_properties: Union[_models.MachineRunCommand, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -421,7 +420,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, machine_name: str, run_command_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -555,7 +554,7 @@ def get( :rtype: ~azure.mgmt.hybridcompute.models.MachineRunCommand :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -622,7 +621,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MachineRunCommandsListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py index 2f12f3394d0b..801e02dd764c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +49,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +89,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +126,7 @@ def build_assess_patches_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,7 +157,7 @@ def build_install_patches_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -192,7 +191,7 @@ def build_list_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +223,7 @@ def build_list_by_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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -263,22 +262,8 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, machine_name: str, **kwargs: Any - ) -> None: - """The operation to delete a hybrid machine. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param machine_name: The name of the hybrid machine. Required. - :type machine_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + def _delete_initial(self, resource_group_name: str, machine_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -290,7 +275,7 @@ def delete( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -302,20 +287,90 @@ def delete( # pylint: disable=inconsistent-return-statements ) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, machine_name: str, **kwargs: Any) -> LROPoller[None]: + """The operation to delete a hybrid machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + 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) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def get( @@ -339,7 +394,7 @@ def get( :rtype: ~azure.mgmt.hybridcompute.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +439,7 @@ def get( return deserialized # type: ignore def _assess_patches_initial(self, resource_group_name: str, name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +560,7 @@ def _install_patches_initial( install_patches_input: Union[_models.MachineInstallPatchesParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -722,7 +777,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -800,7 +855,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Machine"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_profile_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_profile_operations.py index 383da7c0b1e6..bdec5133b2c7 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_profile_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_profile_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ def build_get_request(resource_group_name: str, machine_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +101,7 @@ def get(self, resource_group_name: str, machine_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.hybridcompute.models.NetworkProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_security_perimeter_configurations_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_security_perimeter_configurations_operations.py index a166fe030eb6..03edf0cd0632 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_security_perimeter_configurations_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_security_perimeter_configurations_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Iterator, Optional, Type, TypeVar, Union, cast +from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, cast import urllib.parse from azure.core.exceptions import ( @@ -35,7 +34,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +48,7 @@ def build_get_by_private_link_scope_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +87,7 @@ def build_list_by_private_link_scope_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +120,7 @@ def build_reconcile_for_private_link_scope_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +190,7 @@ def get_by_private_link_scope( :rtype: ~azure.mgmt.hybridcompute.models.NetworkSecurityPerimeterConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -258,7 +257,7 @@ def list_by_private_link_scope( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NetworkSecurityPerimeterConfigurationListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -324,7 +323,7 @@ def get_next(next_link=None): def _reconcile_for_private_link_scope_initial( # pylint: disable=name-too-long self, resource_group_name: str, scope_name: str, perimeter_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -385,6 +384,7 @@ def _reconcile_for_private_link_scope_initial( # pylint: disable=name-too-long def begin_reconcile_for_private_link_scope( self, resource_group_name: str, scope_name: str, perimeter_name: str, **kwargs: Any ) -> LROPoller[_models.NetworkSecurityPerimeterConfigurationReconcileResult]: + # pylint: disable=line-too-long """Forces the network security perimeter configuration to refresh for a private link scope. :param resource_group_name: The name of the resource group. The name is case insensitive. diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py index cd5880c2cabe..c28ff5c2d61e 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +90,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py index 9e36c76a8de4..c4cbbec4c991 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -54,7 +53,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +93,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -137,7 +136,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +172,7 @@ def build_list_by_private_link_scope_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -236,7 +235,7 @@ def get( :rtype: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -288,7 +287,7 @@ def _create_or_update_initial( parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +489,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, scope_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -628,7 +627,7 @@ def list_by_private_link_scope( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py index 65f7fda6f556..8c9b34f0a44c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +44,7 @@ def build_list_by_private_link_scope_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +77,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +145,7 @@ def list_by_private_link_scope( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +225,7 @@ def get( :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py index 2a0ef3b63756..751beabb15e3 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +36,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +104,7 @@ def build_delete_request(resource_group_name: str, scope_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +135,7 @@ def build_get_request(resource_group_name: str, scope_name: str, subscription_id _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +168,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -204,7 +204,7 @@ def build_update_tags_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -240,7 +240,7 @@ def build_get_validation_details_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +271,7 @@ def build_get_validation_details_for_machine_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -335,7 +335,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.HybridComputePrivateLinkScope api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.HybridComputePrivateLinkScopeListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -417,7 +417,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.HybridComputePrivateLinkScopeListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -480,7 +480,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) def _delete_initial(self, resource_group_name: str, scope_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +602,7 @@ def get(self, resource_group_name: str, scope_name: str, **kwargs: Any) -> _mode :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +727,7 @@ def create_or_update( :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -863,7 +863,7 @@ def update_tags( :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -933,7 +933,7 @@ def get_validation_details( :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkScopeValidationDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -992,7 +992,7 @@ def get_validation_details_for_machine( :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkScopeValidationDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_settings_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_settings_operations.py index 34f3e0787bf7..851ee9a0aaa7 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_settings_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_settings_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +29,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +97,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -149,7 +148,7 @@ def build_patch_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-31-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-19-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -234,7 +233,7 @@ def get( :rtype: ~azure.mgmt.hybridcompute.models.Settings :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -382,7 +381,7 @@ def update( :rtype: ~azure.mgmt.hybridcompute.models.Settings :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +541,7 @@ def patch( :rtype: ~azure.mgmt.hybridcompute.models.Settings :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_add.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_add.py new file mode 100644 index 000000000000..3ac69e6e7c40 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_add.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python extension_add.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, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="{subscriptionId}", + ) + + response = client.begin_setup_extensions( + resource_group_name="myResourceGroup", + machine_name="myMachine", + extensions={ + "extensions": [ + {"publisher": "Microsoft.Azure.Monitoring", "type": "AzureMonitorAgentLinux"}, + {"publisher": "", "type": ""}, + ] + }, + ).result() + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/extension/Extension_Add.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_create_or_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_create_or_update.py index 6f56b64acabf..766de4b875df 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_create_or_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_create_or_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extension_CreateOrUpdate.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/extension/Extension_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_delete.py index 52b1769eb9e2..5d329607a244 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extension_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/extension/Extension_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_get.py index 146a61effb3a..8c4223e45737 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extension_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/extension/Extension_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_list.py index f59ff6f96e20..7f1ab5430f90 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extension_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/extension/Extension_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_get.py index 1d5e183244f8..8ad06c1b898b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/ExtensionMetadata_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/extension/ExtensionMetadata_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_list.py index 942053a70a5b..19cc4912bda7 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/ExtensionMetadata_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/extension/ExtensionMetadata_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_get.py new file mode 100644 index 000000000000..239f8ad32db0 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_get.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python extension_metadata_v2_get.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, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.extension_metadata_v2.get( + location="EastUS", + publisher="microsoft.azure.monitor", + extension_type="azuremonitorlinuxagent", + version="1.33.0", + ) + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/extension/ExtensionMetadataV2_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_list.py new file mode 100644 index 000000000000..623d5884bd32 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_list.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python extension_metadata_v2_list.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, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.extension_metadata_v2.list( + location="EastUS", + publisher="microsoft.azure.monitor", + extension_type="azuremonitorlinuxagent", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/extension/ExtensionMetadataV2_List.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_publisher_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_publisher_list.py new file mode 100644 index 000000000000..82441f2251c3 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_publisher_list.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python extension_publisher_list.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, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.extension_publisher.list( + location="EastUS", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/extension/ExtensionPublisher_List.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_type_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_type_list.py new file mode 100644 index 000000000000..f3adcef46b20 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_type_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python extension_type_list.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, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.extension_type.list( + location="EastUS", + publisher="microsoft.azure.monitor", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/extension/ExtensionType_List.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_update.py index 2e116e40c0d8..44e33ca0c49f 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extension_Update.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/extension/Extension_Update.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extensions_upgrade.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extensions_upgrade.py index 3bfdf6eafa6b..fc987d63f183 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extensions_upgrade.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extensions_upgrade.py @@ -42,6 +42,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extensions_Upgrade.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/extension/Extensions_Upgrade.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_create_or_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_create_or_update.py index 01050e7ecdf1..2e954efd8cb9 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_create_or_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_create_or_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_CreateOrUpdate.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/gateway/Gateway_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_delete.py index b9aba890bfc0..b3f5227b22b0 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/gateway/Gateway_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_get.py index e23d9af1b067..b5e9d099469c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/gateway/Gateway_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_resource_group.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_resource_group.py index 9f8b81374b3a..08f7a1d41af0 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_resource_group.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_ListByResourceGroup.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/gateway/Gateway_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_subscription.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_subscription.py index ebcaf827647b..591c03b02d77 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_subscription.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_ListBySubscription.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/gateway/Gateway_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_update.py index 85883ef2c426..1e5b9d4a6160 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_Update.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/gateway/Gateway_Update.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_create_or_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_create_or_update.py index 2271854cf6de..4e217a1fb395 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_create_or_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_create_or_update.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_CreateOrUpdate.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/license/License_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_delete.py index c23ff9d47235..7803232d7337 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/license/License_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_get.py index eb3f760152e0..d0cf7402629a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/license/License_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_resource_group.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_resource_group.py index 61e08074c030..f2b6ce5c4ff1 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_resource_group.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_ListByResourceGroup.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/license/License_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_subscription.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_subscription.py index e5cbbf8aa13b..7d8d22e54072 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_subscription.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_ListBySubscription.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/license/License_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_update.py index 28536d5174b5..bcbed0ff13f3 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_Update.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/license/License_Update.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_validate_license.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_validate_license.py index cf266034217c..97ef51c2ea13 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_validate_license.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_validate_license.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_ValidateLicense.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/license/License_ValidateLicense.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_create_or_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_create_or_update.py index 0174079fca95..9a88022c70f4 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_create_or_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_create_or_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/licenseProfile/LicenseProfile_CreateOrUpdate.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/licenseProfile/LicenseProfile_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_delete.py index 42f24fd8ffd3..8a147e605ffe 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/licenseProfile/LicenseProfile_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/licenseProfile/LicenseProfile_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_get.py index 94ce4912e9dc..382f96185c63 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/licenseProfile/LicenseProfile_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/licenseProfile/LicenseProfile_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_list.py index 82a8c0db966c..b52bcb3d0361 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/licenseProfile/LicenseProfile_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/licenseProfile/LicenseProfile_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_update.py index 557aad56c015..90747aff425a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_update.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/licenseProfile/LicenseProfile_Update.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/licenseProfile/LicenseProfile_Update.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_assess_patches.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_assess_patches.py index f2e5a4a453a6..755b1ffa7f6c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_assess_patches.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_assess_patches.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machine_AssessPatches.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/machine/Machine_AssessPatches.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_install_patches.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_install_patches.py index 1ca17ab910f6..d669aca2d43a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_install_patches.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_install_patches.py @@ -39,12 +39,14 @@ def main(): "windowsParameters": { "classificationsToInclude": ["Critical", "Security"], "maxPatchPublishDate": "2021-08-19T02:36:43.0539904+00:00", + "patchNameMasksToExclude": ["*Windows*"], + "patchNameMasksToInclude": ["*SQL*"], }, }, ).result() print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machine_InstallPatches.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/machine/Machine_InstallPatches.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_delete.py index 3d34ab912051..9f342d9949b5 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_delete.py @@ -30,12 +30,12 @@ def main(): subscription_id="{subscriptionId}", ) - client.machines.delete( + client.machines.begin_delete( resource_group_name="myResourceGroup", machine_name="myMachine", - ) + ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/machine/Machines_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get.py index de1608402f70..cee490ca438c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/machine/Machines_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get_license_profile_instance_view.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get_license_profile_instance_view.py index 9b3a3fe4d92f..62a6f497f69c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get_license_profile_instance_view.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get_license_profile_instance_view.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_resource_group.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_resource_group.py index d1af98563981..ccb7b4a49601 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_resource_group.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_ListByResourceGroup.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/machine/Machines_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_subscription.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_subscription.py index 05eacfb9df1f..6a5c24fc6412 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_subscription.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_ListBySubscription.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/machine/Machines_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_profile_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_profile_get.py index d5b5db8e522d..6282700aa03b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_profile_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_profile_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/NetworkProfile_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/NetworkProfile_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_get.py index 7d50b3d8559e..05e6c457a78b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_list.py index a8579ac7ffce..96cbd51c0a66 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationList.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationList.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_reconcile.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_reconcile.py index f6bd02015ddc..3fef58b3c688 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_reconcile.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_reconcile.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationReconcile.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationReconcile.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/operations_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/operations_list.py index 2f990051cf3d..04e673fd9c07 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/operations_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/Operations_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_delete.py index 1d2546d7d3ea..ba0a51d2815e 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateEndpoint/PrivateEndpointConnection_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_get.py index 4a80485939b6..d514ba50384b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_list.py index b779f844ed28..29c63532bd4c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateEndpoint/PrivateEndpointConnection_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateEndpoint/PrivateEndpointConnection_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_update.py index 1190119faa25..c15f6dc35e28 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_update.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Update.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateEndpoint/PrivateEndpointConnection_Update.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_get.py index 54841a049b0b..72af0346819e 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_list_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_list_get.py index d957c0197e84..11d612901257 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_list_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_list_get.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_ListGet.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_ListGet.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_create.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_create.py index 6bb2e35146cb..bcc3fb1653e9 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_create.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_create.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_Create.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateLinkScope/PrivateLinkScopes_Create.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_delete.py index bf5f81104763..ccfa108eb137 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateLinkScope/PrivateLinkScopes_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get.py index 719aad497696..43282c93a679 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation.py index a090f3afb176..550764f1a0de 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidation.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidation.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation_for_machine.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation_for_machine.py index e9a71aaa84b4..7a3802dcd5f3 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation_for_machine.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation_for_machine.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidationForMachine.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidationForMachine.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list.py index db27887a2886..0fd3bfd45950 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateLinkScope/PrivateLinkScopes_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list_by_resource_group.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list_by_resource_group.py index 63709e50b928..2960b9dee2bc 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list_by_resource_group.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_ListByResourceGroup.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateLinkScope/PrivateLinkScopes_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_update.py index b11b45fb3f5e..fde804c2e911 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_Update.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/privateLinkScope/PrivateLinkScopes_Update.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_create_or_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_create_or_update.py index 317db02ced8a..3d983a58d83f 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_create_or_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_create_or_update.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/runCommand/RunCommands_CreateOrUpdate.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/runCommand/RunCommands_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_delete.py index c887986a16d6..1b34d449e415 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/runCommand/RunCommands_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/runCommand/RunCommands_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_get.py index f4c0669b62d3..7524c3389080 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/runCommand/RunCommands_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/runCommand/RunCommands_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_list.py index a3cd2cddaa83..205e4659cee0 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/runCommand/RunCommands_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/runCommand/RunCommands_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_get.py index 79d299adf60a..4c5c37a790de 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/settings/SettingsGet.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/settings/SettingsGet.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_patch.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_patch.py index 5e172a3affd7..53ff56d9c265 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_patch.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_patch.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/settings/SettingsPatch.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/settings/SettingsPatch.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_update.py index 08127c18a270..915556f7c917 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/settings/SettingsUpdate.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2025-02-19-preview/examples/settings/SettingsUpdate.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/conftest.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/conftest.py index c0b66de470e1..e7b636985ac6 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/conftest.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/conftest.py @@ -18,7 +18,7 @@ load_dotenv() -# aovid record sensitive identity information in recordings +# For security, please avoid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) def add_sanitizers(test_proxy): hybridcomputemanagement_subscription_id = os.environ.get( diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management.py index e686a9dca609..718a3ae618dd 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management.py @@ -25,7 +25,46 @@ def test_begin_upgrade_extensions(self, resource_group): resource_group_name=resource_group.name, machine_name="str", extension_upgrade_parameters={"extensionTargets": {"str": {"targetVersion": "str"}}}, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_setup_extensions(self, resource_group): + response = self.client.begin_setup_extensions( + resource_group_name=resource_group.name, + machine_name="str", + extensions={ + "extensions": [ + { + "autoUpgradeMinorVersion": bool, + "enableAutomaticUpgrade": bool, + "forceUpdateTag": "str", + "instanceView": { + "name": "str", + "status": { + "code": "str", + "displayStatus": "str", + "level": "str", + "message": "str", + "time": "2020-02-20 00:00:00", + }, + "type": "str", + "typeHandlerVersion": "str", + }, + "protectedSettings": {"str": {}}, + "provisioningState": "str", + "publisher": "str", + "settings": {"str": {}}, + "type": "str", + "typeHandlerVersion": "str", + } + ] + }, + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_async.py index d2de10ed7b79..03c91d2cd527 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_async.py @@ -27,7 +27,48 @@ async def test_begin_upgrade_extensions(self, resource_group): resource_group_name=resource_group.name, machine_name="str", extension_upgrade_parameters={"extensionTargets": {"str": {"targetVersion": "str"}}}, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_setup_extensions(self, resource_group): + response = await ( + await self.client.begin_setup_extensions( + resource_group_name=resource_group.name, + machine_name="str", + extensions={ + "extensions": [ + { + "autoUpgradeMinorVersion": bool, + "enableAutomaticUpgrade": bool, + "forceUpdateTag": "str", + "instanceView": { + "name": "str", + "status": { + "code": "str", + "displayStatus": "str", + "level": "str", + "message": "str", + "time": "2020-02-20 00:00:00", + }, + "type": "str", + "typeHandlerVersion": "str", + }, + "protectedSettings": {"str": {}}, + "provisioningState": "str", + "publisher": "str", + "settings": {"str": {}}, + "type": "str", + "typeHandlerVersion": "str", + } + ] + }, + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations.py index ff4bd905e032..72dd533d438a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations.py @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_extension_metadata_get(self, resource_group): response = self.client.extension_metadata.get( location="str", publisher="str", extension_type="str", version="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -34,12 +34,12 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_extension_metadata_list(self, resource_group): response = self.client.extension_metadata.list( location="str", publisher="str", extension_type="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations_async.py index d053db497e08..7778fc8e316d 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_extension_metadata_get(self, resource_group): response = await self.client.extension_metadata.get( location="str", publisher="str", extension_type="str", version="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -35,12 +35,12 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_extension_metadata_list(self, resource_group): response = self.client.extension_metadata.list( location="str", publisher="str", extension_type="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations.py new file mode 100644 index 000000000000..f5722529b172 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridComputeManagementExtensionMetadataV2Operations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridComputeManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_extension_metadata_v2_get(self, resource_group): + response = self.client.extension_metadata_v2.get( + location="str", + publisher="str", + extension_type="str", + version="str", + api_version="2025-02-19-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_extension_metadata_v2_list(self, resource_group): + response = self.client.extension_metadata_v2.list( + location="str", + publisher="str", + extension_type="str", + api_version="2025-02-19-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations_async.py new file mode 100644 index 000000000000..000671faee33 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations_async.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridcompute.aio import HybridComputeManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridComputeManagementExtensionMetadataV2OperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridComputeManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_extension_metadata_v2_get(self, resource_group): + response = await self.client.extension_metadata_v2.get( + location="str", + publisher="str", + extension_type="str", + version="str", + api_version="2025-02-19-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_extension_metadata_v2_list(self, resource_group): + response = self.client.extension_metadata_v2.list( + location="str", + publisher="str", + extension_type="str", + api_version="2025-02-19-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations.py new file mode 100644 index 000000000000..63ef16ce8b6d --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridComputeManagementExtensionPublisherOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridComputeManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_extension_publisher_list(self, resource_group): + response = self.client.extension_publisher.list( + location="str", + api_version="2025-02-19-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations_async.py new file mode 100644 index 000000000000..07495f94d56b --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations_async.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridcompute.aio import HybridComputeManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridComputeManagementExtensionPublisherOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridComputeManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_extension_publisher_list(self, resource_group): + response = self.client.extension_publisher.list( + location="str", + api_version="2025-02-19-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations.py new file mode 100644 index 000000000000..04cc18c6ec54 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridComputeManagementExtensionTypeOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridComputeManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_extension_type_list(self, resource_group): + response = self.client.extension_type.list( + location="str", + publisher="str", + api_version="2025-02-19-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations_async.py new file mode 100644 index 000000000000..2f9576ecfd39 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations_async.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridcompute.aio import HybridComputeManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridComputeManagementExtensionTypeOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridComputeManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_extension_type_list(self, resource_group): + response = self.client.extension_type.list( + location="str", + publisher="str", + api_version="2025-02-19-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations.py index 8416d29465f2..32102000454c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations.py @@ -20,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_gateways_begin_create_or_update(self, resource_group): response = self.client.gateways.begin_create_or_update( resource_group_name=resource_group.name, gateway_name="str", @@ -44,7 +44,7 @@ def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -52,12 +52,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_gateways_update(self, resource_group): response = self.client.gateways.update( resource_group_name=resource_group.name, gateway_name="str", parameters={"allowedFeatures": ["str"], "tags": {"str": "str"}}, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -65,11 +65,11 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_gateways_get(self, resource_group): response = self.client.gateways.get( resource_group_name=resource_group.name, gateway_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -77,11 +77,11 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_gateways_begin_delete(self, resource_group): response = self.client.gateways.begin_delete( resource_group_name=resource_group.name, gateway_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -89,10 +89,10 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_gateways_list_by_resource_group(self, resource_group): response = self.client.gateways.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -100,9 +100,9 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_gateways_list_by_subscription(self, resource_group): response = self.client.gateways.list_by_subscription( - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations_async.py index b2caed4c9fb0..23516f6f5b18 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations_async.py @@ -21,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_gateways_begin_create_or_update(self, resource_group): response = await ( await self.client.gateways.begin_create_or_update( resource_group_name=resource_group.name, @@ -46,7 +46,7 @@ async def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -55,12 +55,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_gateways_update(self, resource_group): response = await self.client.gateways.update( resource_group_name=resource_group.name, gateway_name="str", parameters={"allowedFeatures": ["str"], "tags": {"str": "str"}}, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -68,11 +68,11 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_gateways_get(self, resource_group): response = await self.client.gateways.get( resource_group_name=resource_group.name, gateway_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -80,12 +80,12 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_gateways_begin_delete(self, resource_group): response = await ( await self.client.gateways.begin_delete( resource_group_name=resource_group.name, gateway_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -94,10 +94,10 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_gateways_list_by_resource_group(self, resource_group): response = self.client.gateways.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -105,9 +105,9 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_gateways_list_by_subscription(self, resource_group): response = self.client.gateways.list_by_subscription( - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations.py index de1274db85cb..4ed6097b749d 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations.py @@ -20,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_license_profiles_begin_create_or_update(self, resource_group): response = self.client.license_profiles.begin_create_or_update( resource_group_name=resource_group.name, machine_name="str", @@ -77,7 +77,7 @@ def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", license_profile_name="default", ).result() # call '.result()' to poll until service return final result @@ -86,7 +86,7 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_license_profiles_begin_update(self, resource_group): response = self.client.license_profiles.begin_update( resource_group_name=resource_group.name, machine_name="str", @@ -98,7 +98,7 @@ def test_begin_update(self, resource_group): "subscriptionStatus": "str", "tags": {"str": "str"}, }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", license_profile_name="default", ).result() # call '.result()' to poll until service return final result @@ -107,11 +107,11 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_license_profiles_get(self, resource_group): response = self.client.license_profiles.get( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", license_profile_name="default", ) @@ -120,11 +120,11 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_license_profiles_begin_delete(self, resource_group): response = self.client.license_profiles.begin_delete( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", license_profile_name="default", ).result() # call '.result()' to poll until service return final result @@ -133,11 +133,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_license_profiles_list(self, resource_group): response = self.client.license_profiles.list( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations_async.py index 72b7df35e15c..7dbcaca6ad5a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations_async.py @@ -21,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_license_profiles_begin_create_or_update(self, resource_group): response = await ( await self.client.license_profiles.begin_create_or_update( resource_group_name=resource_group.name, @@ -79,7 +79,7 @@ async def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", license_profile_name="default", ) ).result() # call '.result()' to poll until service return final result @@ -89,7 +89,7 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_license_profiles_begin_update(self, resource_group): response = await ( await self.client.license_profiles.begin_update( resource_group_name=resource_group.name, @@ -102,7 +102,7 @@ async def test_begin_update(self, resource_group): "subscriptionStatus": "str", "tags": {"str": "str"}, }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", license_profile_name="default", ) ).result() # call '.result()' to poll until service return final result @@ -112,11 +112,11 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_license_profiles_get(self, resource_group): response = await self.client.license_profiles.get( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", license_profile_name="default", ) @@ -125,12 +125,12 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_license_profiles_begin_delete(self, resource_group): response = await ( await self.client.license_profiles.begin_delete( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", license_profile_name="default", ) ).result() # call '.result()' to poll until service return final result @@ -140,11 +140,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_license_profiles_list(self, resource_group): response = self.client.license_profiles.list( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations.py index 6b79075a0f9b..0981e488fe40 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations.py @@ -20,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_validate_license(self, resource_group): + def test_licenses_begin_validate_license(self, resource_group): response = self.client.licenses.begin_validate_license( parameters={ "location": "str", @@ -50,7 +50,7 @@ def test_begin_validate_license(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -58,7 +58,7 @@ def test_begin_validate_license(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_licenses_begin_create_or_update(self, resource_group): response = self.client.licenses.begin_create_or_update( resource_group_name=resource_group.name, license_name="str", @@ -90,7 +90,7 @@ def test_begin_create_or_update(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -98,7 +98,7 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_licenses_begin_update(self, resource_group): response = self.client.licenses.begin_update( resource_group_name=resource_group.name, license_name="str", @@ -111,7 +111,7 @@ def test_begin_update(self, resource_group): "target": "str", "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -119,11 +119,11 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_licenses_get(self, resource_group): response = self.client.licenses.get( resource_group_name=resource_group.name, license_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -131,11 +131,11 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_licenses_begin_delete(self, resource_group): response = self.client.licenses.begin_delete( resource_group_name=resource_group.name, license_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -143,10 +143,10 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_licenses_list_by_resource_group(self, resource_group): response = self.client.licenses.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -154,9 +154,9 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_licenses_list_by_subscription(self, resource_group): response = self.client.licenses.list_by_subscription( - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations_async.py index b2ccd0c03477..9a08fbecd50c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations_async.py @@ -21,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_validate_license(self, resource_group): + async def test_licenses_begin_validate_license(self, resource_group): response = await ( await self.client.licenses.begin_validate_license( parameters={ @@ -52,7 +52,7 @@ async def test_begin_validate_license(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -61,7 +61,7 @@ async def test_begin_validate_license(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_licenses_begin_create_or_update(self, resource_group): response = await ( await self.client.licenses.begin_create_or_update( resource_group_name=resource_group.name, @@ -94,7 +94,7 @@ async def test_begin_create_or_update(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -103,7 +103,7 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_licenses_begin_update(self, resource_group): response = await ( await self.client.licenses.begin_update( resource_group_name=resource_group.name, @@ -117,7 +117,7 @@ async def test_begin_update(self, resource_group): "target": "str", "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -126,11 +126,11 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_licenses_get(self, resource_group): response = await self.client.licenses.get( resource_group_name=resource_group.name, license_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -138,12 +138,12 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_licenses_begin_delete(self, resource_group): response = await ( await self.client.licenses.begin_delete( resource_group_name=resource_group.name, license_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -152,10 +152,10 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_licenses_list_by_resource_group(self, resource_group): response = self.client.licenses.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -163,9 +163,9 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_licenses_list_by_subscription(self, resource_group): response = self.client.licenses.list_by_subscription( - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations.py index 32cccae4275a..9975a0b1d642 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations.py @@ -20,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_machine_extensions_begin_create_or_update(self, resource_group): response = self.client.machine_extensions.begin_create_or_update( resource_group_name=resource_group.name, machine_name="str", @@ -63,7 +63,7 @@ def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -71,7 +71,7 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_machine_extensions_begin_update(self, resource_group): response = self.client.machine_extensions.begin_update( resource_group_name=resource_group.name, machine_name="str", @@ -87,7 +87,7 @@ def test_begin_update(self, resource_group): "type": "str", "typeHandlerVersion": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -95,12 +95,12 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_machine_extensions_begin_delete(self, resource_group): response = self.client.machine_extensions.begin_delete( resource_group_name=resource_group.name, machine_name="str", extension_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -108,12 +108,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_machine_extensions_get(self, resource_group): response = self.client.machine_extensions.get( resource_group_name=resource_group.name, machine_name="str", extension_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -121,11 +121,11 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_machine_extensions_list(self, resource_group): response = self.client.machine_extensions.list( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations_async.py index 244863912166..7096d87cde0a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations_async.py @@ -21,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_machine_extensions_begin_create_or_update(self, resource_group): response = await ( await self.client.machine_extensions.begin_create_or_update( resource_group_name=resource_group.name, @@ -65,7 +65,7 @@ async def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -74,7 +74,7 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_machine_extensions_begin_update(self, resource_group): response = await ( await self.client.machine_extensions.begin_update( resource_group_name=resource_group.name, @@ -91,7 +91,7 @@ async def test_begin_update(self, resource_group): "type": "str", "typeHandlerVersion": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -100,13 +100,13 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_machine_extensions_begin_delete(self, resource_group): response = await ( await self.client.machine_extensions.begin_delete( resource_group_name=resource_group.name, machine_name="str", extension_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -115,12 +115,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_machine_extensions_get(self, resource_group): response = await self.client.machine_extensions.get( resource_group_name=resource_group.name, machine_name="str", extension_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -128,11 +128,11 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_machine_extensions_list(self, resource_group): response = self.client.machine_extensions.list( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations.py index 04fc95951119..83b76097074d 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations.py @@ -20,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_machine_run_commands_begin_create_or_update(self, resource_group): response = self.client.machine_run_commands.begin_create_or_update( resource_group_name=resource_group.name, machine_name="str", @@ -75,7 +75,7 @@ def test_begin_create_or_update(self, resource_group): "timeoutInSeconds": 0, "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -83,12 +83,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_machine_run_commands_begin_delete(self, resource_group): response = self.client.machine_run_commands.begin_delete( resource_group_name=resource_group.name, machine_name="str", run_command_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -96,12 +96,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_machine_run_commands_get(self, resource_group): response = self.client.machine_run_commands.get( resource_group_name=resource_group.name, machine_name="str", run_command_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -109,11 +109,11 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_machine_run_commands_list(self, resource_group): response = self.client.machine_run_commands.list( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations_async.py index 22d37063c33c..a168f34476bc 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations_async.py @@ -21,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_machine_run_commands_begin_create_or_update(self, resource_group): response = await ( await self.client.machine_run_commands.begin_create_or_update( resource_group_name=resource_group.name, @@ -77,7 +77,7 @@ async def test_begin_create_or_update(self, resource_group): "timeoutInSeconds": 0, "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -86,13 +86,13 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_machine_run_commands_begin_delete(self, resource_group): response = await ( await self.client.machine_run_commands.begin_delete( resource_group_name=resource_group.name, machine_name="str", run_command_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -101,12 +101,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_machine_run_commands_get(self, resource_group): response = await self.client.machine_run_commands.get( resource_group_name=resource_group.name, machine_name="str", run_command_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -114,11 +114,11 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_machine_run_commands_list(self, resource_group): response = self.client.machine_run_commands.list( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations.py index d8e81dbdc656..2bc944951a43 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations.py @@ -20,23 +20,23 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): - response = self.client.machines.delete( + def test_machines_begin_delete(self, resource_group): + response = self.client.machines.begin_delete( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", - ) + api_version="2025-02-19-preview", + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_machines_get(self, resource_group): response = self.client.machines.get( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -44,11 +44,11 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_assess_patches(self, resource_group): + def test_machines_begin_assess_patches(self, resource_group): response = self.client.machines.begin_assess_patches( resource_group_name=resource_group.name, name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -56,7 +56,7 @@ def test_begin_assess_patches(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_install_patches(self, resource_group): + def test_machines_begin_install_patches(self, resource_group): response = self.client.machines.begin_install_patches( resource_group_name=resource_group.name, name="str", @@ -74,9 +74,11 @@ def test_begin_install_patches(self, resource_group): "kbNumbersToExclude": ["str"], "kbNumbersToInclude": ["str"], "maxPatchPublishDate": "2020-02-20 00:00:00", + "patchNameMasksToExclude": ["str"], + "patchNameMasksToInclude": ["str"], }, }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -84,10 +86,10 @@ def test_begin_install_patches(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_machines_list_by_resource_group(self, resource_group): response = self.client.machines.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -95,9 +97,9 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_machines_list_by_subscription(self, resource_group): response = self.client.machines.list_by_subscription( - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations_async.py index 61dbfea27aea..7bd803d3f2f1 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations_async.py @@ -21,23 +21,25 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): - response = await self.client.machines.delete( - resource_group_name=resource_group.name, - machine_name="str", - api_version="2024-07-31-preview", - ) + async def test_machines_begin_delete(self, resource_group): + response = await ( + await self.client.machines.begin_delete( + resource_group_name=resource_group.name, + machine_name="str", + api_version="2025-02-19-preview", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_machines_get(self, resource_group): response = await self.client.machines.get( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -45,12 +47,12 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_assess_patches(self, resource_group): + async def test_machines_begin_assess_patches(self, resource_group): response = await ( await self.client.machines.begin_assess_patches( resource_group_name=resource_group.name, name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -59,7 +61,7 @@ async def test_begin_assess_patches(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_install_patches(self, resource_group): + async def test_machines_begin_install_patches(self, resource_group): response = await ( await self.client.machines.begin_install_patches( resource_group_name=resource_group.name, @@ -78,9 +80,11 @@ async def test_begin_install_patches(self, resource_group): "kbNumbersToExclude": ["str"], "kbNumbersToInclude": ["str"], "maxPatchPublishDate": "2020-02-20 00:00:00", + "patchNameMasksToExclude": ["str"], + "patchNameMasksToInclude": ["str"], }, }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -89,10 +93,10 @@ async def test_begin_install_patches(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_machines_list_by_resource_group(self, resource_group): response = self.client.machines.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -100,9 +104,9 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_machines_list_by_subscription(self, resource_group): response = self.client.machines.list_by_subscription( - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations.py index deeac34e46f4..1102d5c0502f 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_network_profile_get(self, resource_group): response = self.client.network_profile.get( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations_async.py index 06bade8bb482..226a922214f7 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_network_profile_get(self, resource_group): response = await self.client.network_profile.get( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations.py index e385a60aa351..5671cb7c448e 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_by_private_link_scope(self, resource_group): + def test_network_security_perimeter_configurations_get_by_private_link_scope(self, resource_group): response = self.client.network_security_perimeter_configurations.get_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", perimeter_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -33,11 +33,11 @@ def test_get_by_private_link_scope(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_private_link_scope(self, resource_group): + def test_network_security_perimeter_configurations_list_by_private_link_scope(self, resource_group): response = self.client.network_security_perimeter_configurations.list_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -45,12 +45,12 @@ def test_list_by_private_link_scope(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_reconcile_for_private_link_scope(self, resource_group): + def test_network_security_perimeter_configurations_begin_reconcile_for_private_link_scope(self, resource_group): response = self.client.network_security_perimeter_configurations.begin_reconcile_for_private_link_scope( resource_group_name=resource_group.name, scope_name="str", perimeter_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations_async.py index abbbdc639626..380beaeea83f 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_by_private_link_scope(self, resource_group): + async def test_network_security_perimeter_configurations_get_by_private_link_scope(self, resource_group): response = await self.client.network_security_perimeter_configurations.get_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", perimeter_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -34,11 +34,11 @@ async def test_get_by_private_link_scope(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_private_link_scope(self, resource_group): + async def test_network_security_perimeter_configurations_list_by_private_link_scope(self, resource_group): response = self.client.network_security_perimeter_configurations.list_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -46,13 +46,15 @@ async def test_list_by_private_link_scope(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_reconcile_for_private_link_scope(self, resource_group): + async def test_network_security_perimeter_configurations_begin_reconcile_for_private_link_scope( + self, resource_group + ): response = await ( await self.client.network_security_perimeter_configurations.begin_reconcile_for_private_link_scope( resource_group_name=resource_group.name, scope_name="str", perimeter_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations.py index ec72a6414177..dd54a4d7907c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations_async.py index 53957883b4da..8d5e86e01388 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations.py index 4b61d829acf3..2f47ad667236 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_private_endpoint_connections_get(self, resource_group): response = self.client.private_endpoint_connections.get( resource_group_name=resource_group.name, scope_name="str", private_endpoint_connection_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_private_endpoint_connections_begin_create_or_update(self, resource_group): response = self.client.private_endpoint_connections.begin_create_or_update( resource_group_name=resource_group.name, scope_name="str", @@ -61,7 +61,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -69,12 +69,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_private_endpoint_connections_begin_delete(self, resource_group): response = self.client.private_endpoint_connections.begin_delete( resource_group_name=resource_group.name, scope_name="str", private_endpoint_connection_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -82,11 +82,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_private_link_scope(self, resource_group): + def test_private_endpoint_connections_list_by_private_link_scope(self, resource_group): response = self.client.private_endpoint_connections.list_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations_async.py index a8846711d645..b4f017eb8df4 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_private_endpoint_connections_get(self, resource_group): response = await self.client.private_endpoint_connections.get( resource_group_name=resource_group.name, scope_name="str", private_endpoint_connection_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_private_endpoint_connections_begin_create_or_update(self, resource_group): response = await ( await self.client.private_endpoint_connections.begin_create_or_update( resource_group_name=resource_group.name, @@ -63,7 +63,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -72,13 +72,13 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_private_endpoint_connections_begin_delete(self, resource_group): response = await ( await self.client.private_endpoint_connections.begin_delete( resource_group_name=resource_group.name, scope_name="str", private_endpoint_connection_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -87,11 +87,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_private_link_scope(self, resource_group): + async def test_private_endpoint_connections_list_by_private_link_scope(self, resource_group): response = self.client.private_endpoint_connections.list_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations.py index b0693cc933f5..376babc41a3d 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_private_link_scope(self, resource_group): + def test_private_link_resources_list_by_private_link_scope(self, resource_group): response = self.client.private_link_resources.list_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_by_private_link_scope(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_private_link_resources_get(self, resource_group): response = self.client.private_link_resources.get( resource_group_name=resource_group.name, scope_name="str", group_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations_async.py index 0e008df486b2..c3cf25a1f127 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_private_link_scope(self, resource_group): + async def test_private_link_resources_list_by_private_link_scope(self, resource_group): response = self.client.private_link_resources.list_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_by_private_link_scope(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_private_link_resources_get(self, resource_group): response = await self.client.private_link_resources.get( resource_group_name=resource_group.name, scope_name="str", group_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations.py index 7d11a6b79b58..d312d8a4d959 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_private_link_scopes_list(self, resource_group): response = self.client.private_link_scopes.list( - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,10 +30,10 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_private_link_scopes_list_by_resource_group(self, resource_group): response = self.client.private_link_scopes.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,11 +41,11 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_private_link_scopes_begin_delete(self, resource_group): response = self.client.private_link_scopes.begin_delete( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -53,11 +53,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_private_link_scopes_get(self, resource_group): response = self.client.private_link_scopes.get( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -65,7 +65,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_private_link_scopes_create_or_update(self, resource_group): response = self.client.private_link_scopes.create_or_update( resource_group_name=resource_group.name, scope_name="str", @@ -106,7 +106,7 @@ def test_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -114,12 +114,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update_tags(self, resource_group): + def test_private_link_scopes_update_tags(self, resource_group): response = self.client.private_link_scopes.update_tags( resource_group_name=resource_group.name, scope_name="str", private_link_scope_tags={"tags": {"str": "str"}}, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -127,11 +127,11 @@ def test_update_tags(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_validation_details(self, resource_group): + def test_private_link_scopes_get_validation_details(self, resource_group): response = self.client.private_link_scopes.get_validation_details( location="str", private_link_scope_id="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -139,11 +139,11 @@ def test_get_validation_details(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_validation_details_for_machine(self, resource_group): + def test_private_link_scopes_get_validation_details_for_machine(self, resource_group): response = self.client.private_link_scopes.get_validation_details_for_machine( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations_async.py index 02123dc60237..25ded0262ba0 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_private_link_scopes_list(self, resource_group): response = self.client.private_link_scopes.list( - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,10 +31,10 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_private_link_scopes_list_by_resource_group(self, resource_group): response = self.client.private_link_scopes.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,12 +42,12 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_private_link_scopes_begin_delete(self, resource_group): response = await ( await self.client.private_link_scopes.begin_delete( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) ).result() # call '.result()' to poll until service return final result @@ -56,11 +56,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_private_link_scopes_get(self, resource_group): response = await self.client.private_link_scopes.get( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -68,7 +68,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_private_link_scopes_create_or_update(self, resource_group): response = await self.client.private_link_scopes.create_or_update( resource_group_name=resource_group.name, scope_name="str", @@ -109,7 +109,7 @@ async def test_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -117,12 +117,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update_tags(self, resource_group): + async def test_private_link_scopes_update_tags(self, resource_group): response = await self.client.private_link_scopes.update_tags( resource_group_name=resource_group.name, scope_name="str", private_link_scope_tags={"tags": {"str": "str"}}, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -130,11 +130,11 @@ async def test_update_tags(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_validation_details(self, resource_group): + async def test_private_link_scopes_get_validation_details(self, resource_group): response = await self.client.private_link_scopes.get_validation_details( location="str", private_link_scope_id="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -142,11 +142,11 @@ async def test_get_validation_details(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_validation_details_for_machine(self, resource_group): + async def test_private_link_scopes_get_validation_details_for_machine(self, resource_group): response = await self.client.private_link_scopes.get_validation_details_for_machine( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations.py index 3d3170147292..142e1bef9ec2 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations.py @@ -20,14 +20,14 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_settings_get(self, resource_group): response = self.client.settings.get( resource_group_name=resource_group.name, base_provider="str", base_resource_type="str", base_resource_name="str", settings_resource_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -35,7 +35,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_settings_update(self, resource_group): response = self.client.settings.update( resource_group_name=resource_group.name, base_provider="str", @@ -57,7 +57,7 @@ def test_update(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -65,7 +65,7 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_patch(self, resource_group): + def test_settings_patch(self, resource_group): response = self.client.settings.patch( resource_group_name=resource_group.name, base_provider="str", @@ -87,7 +87,7 @@ def test_patch(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations_async.py index 96e9cf34419f..e63e1de9f6b2 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations_async.py @@ -21,14 +21,14 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_settings_get(self, resource_group): response = await self.client.settings.get( resource_group_name=resource_group.name, base_provider="str", base_resource_type="str", base_resource_name="str", settings_resource_name="str", - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -36,7 +36,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_settings_update(self, resource_group): response = await self.client.settings.update( resource_group_name=resource_group.name, base_provider="str", @@ -58,7 +58,7 @@ async def test_update(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself @@ -66,7 +66,7 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_patch(self, resource_group): + async def test_settings_patch(self, resource_group): response = await self.client.settings.patch( resource_group_name=resource_group.name, base_provider="str", @@ -88,7 +88,7 @@ async def test_patch(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-07-31-preview", + api_version="2025-02-19-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/setup.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/setup.py index 4b1741fff1fc..0d6ffb140595 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/setup.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/setup.py @@ -22,11 +22,9 @@ # Version extraction inspired from 'requests' with open( - ( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py") - ), + os.path.join(package_folder_path, "version.py") + if os.path.exists(os.path.join(package_folder_path, "version.py")) + else os.path.join(package_folder_path, "_version.py"), "r", ) as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)