diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/CHANGELOG.md b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/CHANGELOG.md index 1cd215bfff61..4611faaaf3b3 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/CHANGELOG.md +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/CHANGELOG.md @@ -1,5 +1,16 @@ # Release History +## 2.0.0b1 (2026-05-19) + +### Features Added + + - Client `WorkloadsSapVirtualInstanceMgmtClient` added parameter `cloud_setting` in method `__init__` + - Enum `SAPProductType` added member `S4_HANA` + +### Breaking Changes + + - Deleted or renamed enum value `SAPProductType.S4HANA` + ## 1.0.0 (2025-04-30) ### Features Added diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/MANIFEST.in b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/MANIFEST.in index 5bc62aeacfde..1b796ab1f009 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/MANIFEST.in +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/MANIFEST.in @@ -1,8 +1,7 @@ -include _meta.json -recursive-include tests *.py *.json -recursive-include samples *.py *.md include *.md -include azure/__init__.py -include azure/mgmt/__init__.py include LICENSE include azure/mgmt/workloadssapvirtualinstance/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/README.md b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/README.md index aee3cb4a58a1..3efe23122cd7 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/README.md +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Workloadssapvirtualinstance Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.8+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/_meta.json b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/_meta.json deleted file mode 100644 index 3e99daca1784..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/_meta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "commit": "0d182673b42de227bc01c0e4f04932b6c074f5ce", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "typespec_src": "specification/workloads/Workloads.SAPVirtualInstance.Management", - "@azure-tools/typespec-python": "0.42.2" -} \ No newline at end of file diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/_metadata.json b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/_metadata.json new file mode 100644 index 000000000000..d5bf82d73ffd --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/_metadata.json @@ -0,0 +1,10 @@ +{ + "apiVersion": "2024-09-01", + "apiVersions": { + "Microsoft.Workloads": "2024-09-01" + }, + "commit": "b373ded4a6c77a9f541ca8f020fd2072db632751", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/workloads/Workloads.SAPVirtualInstance.Management", + "emitterVersion": "0.62.1" +} \ No newline at end of file diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/apiview-properties.json b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/apiview-properties.json index 10f3abb6b335..59c511b22737 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/apiview-properties.json +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/apiview-properties.json @@ -124,39 +124,74 @@ "azure.mgmt.workloadssapvirtualinstance.models.EnqueueReplicationServerType": "Microsoft.Workloads.EnqueueReplicationServerType", "azure.mgmt.workloadssapvirtualinstance.models.CentralServerVirtualMachineType": "Microsoft.Workloads.CentralServerVirtualMachineType", "azure.mgmt.workloadssapvirtualinstance.models.ApplicationServerVirtualMachineType": "Microsoft.Workloads.ApplicationServerVirtualMachineType", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.operations.list": "Azure.ResourceManager.Operations.list", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_virtual_instances.get": "Microsoft.Workloads.SAPVirtualInstances.get", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_virtual_instances.begin_create": "Microsoft.Workloads.SAPVirtualInstances.create", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_virtual_instances.begin_update": "Microsoft.Workloads.SAPVirtualInstances.update", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_virtual_instances.begin_delete": "Microsoft.Workloads.SAPVirtualInstances.delete", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_virtual_instances.list_by_resource_group": "Microsoft.Workloads.SAPVirtualInstances.listByResourceGroup", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_virtual_instances.list_by_subscription": "Microsoft.Workloads.SAPVirtualInstances.listBySubscription", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_virtual_instances.begin_start": "Microsoft.Workloads.SAPVirtualInstances.start", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_virtual_instances.begin_stop": "Microsoft.Workloads.SAPVirtualInstances.stop", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_virtual_instances.get_sizing_recommendations": "Microsoft.Workloads.SAPVirtualInstances.getSizingRecommendations", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_virtual_instances.get_sap_supported_sku": "Microsoft.Workloads.SAPVirtualInstances.getSapSupportedSku", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_virtual_instances.get_disk_configurations": "Microsoft.Workloads.SAPVirtualInstances.getDiskConfigurations", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_virtual_instances.get_availability_zone_details": "Microsoft.Workloads.SAPVirtualInstances.getAvailabilityZoneDetails", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_central_server_instances.get": "Microsoft.Workloads.SAPCentralServerInstances.get", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_central_server_instances.begin_create": "Microsoft.Workloads.SAPCentralServerInstances.create", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_central_server_instances.update": "Microsoft.Workloads.SAPCentralServerInstances.update", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_central_server_instances.begin_delete": "Microsoft.Workloads.SAPCentralServerInstances.delete", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_central_server_instances.list": "Microsoft.Workloads.SAPCentralServerInstances.list", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_central_server_instances.begin_start": "Microsoft.Workloads.SAPCentralServerInstances.start", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_central_server_instances.begin_stop": "Microsoft.Workloads.SAPCentralServerInstances.stop", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_database_instances.get": "Microsoft.Workloads.SAPDatabaseInstances.get", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_database_instances.begin_create": "Microsoft.Workloads.SAPDatabaseInstances.create", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_database_instances.update": "Microsoft.Workloads.SAPDatabaseInstances.update", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_database_instances.begin_delete": "Microsoft.Workloads.SAPDatabaseInstances.delete", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_database_instances.list": "Microsoft.Workloads.SAPDatabaseInstances.list", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_database_instances.begin_start": "Microsoft.Workloads.SAPDatabaseInstances.start", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_database_instances.begin_stop": "Microsoft.Workloads.SAPDatabaseInstances.stop", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_application_server_instances.get": "Microsoft.Workloads.SAPApplicationServerInstances.get", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_application_server_instances.begin_create": "Microsoft.Workloads.SAPApplicationServerInstances.create", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_application_server_instances.update": "Microsoft.Workloads.SAPApplicationServerInstances.update", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_application_server_instances.begin_delete": "Microsoft.Workloads.SAPApplicationServerInstances.delete", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_application_server_instances.list": "Microsoft.Workloads.SAPApplicationServerInstances.list", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_application_server_instances.begin_start": "Microsoft.Workloads.SAPApplicationServerInstances.start", - "azure.mgmt.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceMgmtClient.sap_application_server_instances.begin_stop": "Microsoft.Workloads.SAPApplicationServerInstances.stop" - } + "azure.mgmt.workloadssapvirtualinstance.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations.get": "Microsoft.Workloads.SAPVirtualInstances.get", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPVirtualInstancesOperations.get": "Microsoft.Workloads.SAPVirtualInstances.get", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations.begin_create": "Microsoft.Workloads.SAPVirtualInstances.create", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPVirtualInstancesOperations.begin_create": "Microsoft.Workloads.SAPVirtualInstances.create", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations.begin_update": "Microsoft.Workloads.SAPVirtualInstances.update", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPVirtualInstancesOperations.begin_update": "Microsoft.Workloads.SAPVirtualInstances.update", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations.begin_delete": "Microsoft.Workloads.SAPVirtualInstances.delete", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPVirtualInstancesOperations.begin_delete": "Microsoft.Workloads.SAPVirtualInstances.delete", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations.list_by_resource_group": "Microsoft.Workloads.SAPVirtualInstances.listByResourceGroup", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPVirtualInstancesOperations.list_by_resource_group": "Microsoft.Workloads.SAPVirtualInstances.listByResourceGroup", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations.list_by_subscription": "Microsoft.Workloads.SAPVirtualInstances.listBySubscription", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPVirtualInstancesOperations.list_by_subscription": "Microsoft.Workloads.SAPVirtualInstances.listBySubscription", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations.begin_start": "Microsoft.Workloads.SAPVirtualInstances.start", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPVirtualInstancesOperations.begin_start": "Microsoft.Workloads.SAPVirtualInstances.start", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations.begin_stop": "Microsoft.Workloads.SAPVirtualInstances.stop", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPVirtualInstancesOperations.begin_stop": "Microsoft.Workloads.SAPVirtualInstances.stop", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations.get_sizing_recommendations": "Microsoft.Workloads.SAPVirtualInstances.getSizingRecommendations", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPVirtualInstancesOperations.get_sizing_recommendations": "Microsoft.Workloads.SAPVirtualInstances.getSizingRecommendations", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations.get_sap_supported_sku": "Microsoft.Workloads.SAPVirtualInstances.getSapSupportedSku", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPVirtualInstancesOperations.get_sap_supported_sku": "Microsoft.Workloads.SAPVirtualInstances.getSapSupportedSku", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations.get_disk_configurations": "Microsoft.Workloads.SAPVirtualInstances.getDiskConfigurations", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPVirtualInstancesOperations.get_disk_configurations": "Microsoft.Workloads.SAPVirtualInstances.getDiskConfigurations", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations.get_availability_zone_details": "Microsoft.Workloads.SAPVirtualInstances.getAvailabilityZoneDetails", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPVirtualInstancesOperations.get_availability_zone_details": "Microsoft.Workloads.SAPVirtualInstances.getAvailabilityZoneDetails", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPCentralServerInstancesOperations.get": "Microsoft.Workloads.SAPCentralServerInstances.get", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPCentralServerInstancesOperations.get": "Microsoft.Workloads.SAPCentralServerInstances.get", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPCentralServerInstancesOperations.begin_create": "Microsoft.Workloads.SAPCentralServerInstances.create", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPCentralServerInstancesOperations.begin_create": "Microsoft.Workloads.SAPCentralServerInstances.create", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPCentralServerInstancesOperations.update": "Microsoft.Workloads.SAPCentralServerInstances.update", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPCentralServerInstancesOperations.update": "Microsoft.Workloads.SAPCentralServerInstances.update", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPCentralServerInstancesOperations.begin_delete": "Microsoft.Workloads.SAPCentralServerInstances.delete", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPCentralServerInstancesOperations.begin_delete": "Microsoft.Workloads.SAPCentralServerInstances.delete", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPCentralServerInstancesOperations.list": "Microsoft.Workloads.SAPCentralServerInstances.list", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPCentralServerInstancesOperations.list": "Microsoft.Workloads.SAPCentralServerInstances.list", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPCentralServerInstancesOperations.begin_start": "Microsoft.Workloads.SAPCentralServerInstances.start", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPCentralServerInstancesOperations.begin_start": "Microsoft.Workloads.SAPCentralServerInstances.start", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPCentralServerInstancesOperations.begin_stop": "Microsoft.Workloads.SAPCentralServerInstances.stop", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPCentralServerInstancesOperations.begin_stop": "Microsoft.Workloads.SAPCentralServerInstances.stop", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPDatabaseInstancesOperations.get": "Microsoft.Workloads.SAPDatabaseInstances.get", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPDatabaseInstancesOperations.get": "Microsoft.Workloads.SAPDatabaseInstances.get", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPDatabaseInstancesOperations.begin_create": "Microsoft.Workloads.SAPDatabaseInstances.create", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPDatabaseInstancesOperations.begin_create": "Microsoft.Workloads.SAPDatabaseInstances.create", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPDatabaseInstancesOperations.update": "Microsoft.Workloads.SAPDatabaseInstances.update", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPDatabaseInstancesOperations.update": "Microsoft.Workloads.SAPDatabaseInstances.update", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPDatabaseInstancesOperations.begin_delete": "Microsoft.Workloads.SAPDatabaseInstances.delete", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPDatabaseInstancesOperations.begin_delete": "Microsoft.Workloads.SAPDatabaseInstances.delete", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPDatabaseInstancesOperations.list": "Microsoft.Workloads.SAPDatabaseInstances.list", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPDatabaseInstancesOperations.list": "Microsoft.Workloads.SAPDatabaseInstances.list", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPDatabaseInstancesOperations.begin_start": "Microsoft.Workloads.SAPDatabaseInstances.start", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPDatabaseInstancesOperations.begin_start": "Microsoft.Workloads.SAPDatabaseInstances.start", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPDatabaseInstancesOperations.begin_stop": "Microsoft.Workloads.SAPDatabaseInstances.stop", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPDatabaseInstancesOperations.begin_stop": "Microsoft.Workloads.SAPDatabaseInstances.stop", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPApplicationServerInstancesOperations.get": "Microsoft.Workloads.SAPApplicationServerInstances.get", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPApplicationServerInstancesOperations.get": "Microsoft.Workloads.SAPApplicationServerInstances.get", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPApplicationServerInstancesOperations.begin_create": "Microsoft.Workloads.SAPApplicationServerInstances.create", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPApplicationServerInstancesOperations.begin_create": "Microsoft.Workloads.SAPApplicationServerInstances.create", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPApplicationServerInstancesOperations.update": "Microsoft.Workloads.SAPApplicationServerInstances.update", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPApplicationServerInstancesOperations.update": "Microsoft.Workloads.SAPApplicationServerInstances.update", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPApplicationServerInstancesOperations.begin_delete": "Microsoft.Workloads.SAPApplicationServerInstances.delete", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPApplicationServerInstancesOperations.begin_delete": "Microsoft.Workloads.SAPApplicationServerInstances.delete", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPApplicationServerInstancesOperations.list": "Microsoft.Workloads.SAPApplicationServerInstances.list", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPApplicationServerInstancesOperations.list": "Microsoft.Workloads.SAPApplicationServerInstances.list", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPApplicationServerInstancesOperations.begin_start": "Microsoft.Workloads.SAPApplicationServerInstances.start", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPApplicationServerInstancesOperations.begin_start": "Microsoft.Workloads.SAPApplicationServerInstances.start", + "azure.mgmt.workloadssapvirtualinstance.operations.SAPApplicationServerInstancesOperations.begin_stop": "Microsoft.Workloads.SAPApplicationServerInstances.stop", + "azure.mgmt.workloadssapvirtualinstance.aio.operations.SAPApplicationServerInstancesOperations.begin_stop": "Microsoft.Workloads.SAPApplicationServerInstances.stop" + }, + "CrossLanguageVersion": "a17d0358684a" } \ No newline at end of file diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/__init__.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/__init__.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/__init__.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/__init__.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_client.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_client.py index e9f9af7e6dd4..e6dd7f5a9431 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_client.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_client.py @@ -7,16 +7,18 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING -from typing_extensions import Self +import sys +from typing import Any, Optional, TYPE_CHECKING, cast from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from ._configuration import WorkloadsSapVirtualInstanceMgmtClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer from .operations import ( Operations, SAPApplicationServerInstancesOperations, @@ -25,7 +27,13 @@ SAPVirtualInstancesOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -50,9 +58,13 @@ class WorkloadsSapVirtualInstanceMgmtClient: :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-09-01". + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2024-09-01" + and None. Default value is None. If not set, the operation's default API version will be used. 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 @@ -63,13 +75,26 @@ def __init__( self, credential: "TokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = WorkloadsSapVirtualInstanceMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -88,7 +113,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) self._serialize = Serializer() self._deserialize = Deserializer() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_configuration.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_configuration.py index 27c8ed130786..4c6ac978cb56 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_configuration.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_configuration.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -14,6 +14,7 @@ from ._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -29,7 +30,11 @@ class WorkloadsSapVirtualInstanceMgmtClientConfiguration: # pylint: disable=too :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-09-01". + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2024-09-01" + and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -39,6 +44,7 @@ def __init__( credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: api_version: str = kwargs.pop("api_version", "2024-09-01") @@ -51,6 +57,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-workloadssapvirtualinstance/{}".format(VERSION)) diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_patch.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_patch.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_utils/__init__.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_model_base.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_utils/model_base.py similarity index 70% rename from sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_model_base.py rename to sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_utils/model_base.py index 065b17f67c46..4102784f9a85 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_model_base.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_utils/model_base.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -22,17 +22,19 @@ from datetime import datetime, date, time, timedelta, timezone from json import JSONEncoder import xml.etree.ElementTree as ET -from typing_extensions import Self +from collections.abc import MutableMapping import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping +from azure.core.rest import HttpResponse + +if sys.version_info >= (3, 11): + from typing import Self else: - from typing import MutableMapping + from typing_extensions import Self _LOGGER = logging.getLogger(__name__) @@ -40,6 +42,7 @@ TZ_UTC = timezone.utc _T = typing.TypeVar("_T") +_NONE_TYPE = type(None) def _timedelta_as_isostr(td: timedelta) -> str: @@ -174,6 +177,21 @@ def default(self, o): # pylint: disable=too-many-return-statements r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" ) +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: """Deserialize ISO-8601 formatted string into Datetime object. @@ -205,7 +223,7 @@ def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: test_utc = date_obj.utctimetuple() if test_utc.tm_year > 9999 or test_utc.tm_year < 1: raise OverflowError("Hit max or min date") - return date_obj + return date_obj # type: ignore[no-any-return] def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: @@ -259,7 +277,7 @@ def _deserialize_time(attr: typing.Union[str, time]) -> time: """ if isinstance(attr, time): return attr - return isodate.parse_time(attr) + return isodate.parse_time(attr) # type: ignore[no-any-return] def _deserialize_bytes(attr): @@ -318,6 +336,8 @@ def _deserialize_int_as_str(attr): def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore @@ -348,17 +368,47 @@ def _get_model(module_name: str, model_name: str): _UNSET = object() -class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object - def __init__(self, data: typing.Dict[str, typing.Any]) -> None: +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: self._data = data def __contains__(self, key: typing.Any) -> bool: return key in self._data def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized return self._data.__getitem__(key) def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass self._data.__setitem__(key, value) def __delitem__(self, key: str) -> None: @@ -408,13 +458,13 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: return default @typing.overload - def pop(self, key: str) -> typing.Any: ... + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ @typing.overload - def pop(self, key: str, default: _T) -> _T: ... + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs @typing.overload - def pop(self, key: str, default: typing.Any) -> typing.Any: ... + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ @@ -429,7 +479,7 @@ def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.pop(key) return self._data.pop(key, default) - def popitem(self) -> typing.Tuple[str, typing.Any]: + def popitem(self) -> tuple[str, typing.Any]: """ Removes and returns some (key, value) pair :returns: The (key, value) pair. @@ -444,7 +494,7 @@ def clear(self) -> None: """ self._data.clear() - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ Updates D from mapping/iterable E and F. :param any args: Either a mapping object or an iterable of key-value pairs. @@ -455,7 +505,7 @@ def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: def setdefault(self, key: str, default: None = None) -> None: ... @typing.overload - def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ @@ -470,6 +520,8 @@ def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.setdefault(key, default) def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data try: other_model = self.__class__(other) except Exception: @@ -486,6 +538,8 @@ def _is_model(obj: typing.Any) -> bool: def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) return [_serialize(x, format) for x in o] if isinstance(o, dict): return {k: _serialize(v, format) for k, v in o.items()} @@ -517,9 +571,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m return o -def _get_rest_field( - attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str -) -> typing.Optional["_RestField"]: +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: try: return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) except StopIteration: @@ -542,65 +594,16 @@ class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated # could not see _attr_to_rest_field directly because subclass inherits it from parent class - _calculated: typing.Set[str] = set() + _calculated: set[str] = set() def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } - if args: # pylint: disable=too-many-nested-blocks + dict_to_pass: dict[str, typing.Any] = {} + if args: if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) + dict_to_pass.update(self._init_from_xml(args[0])) else: dict_to_pass.update( {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} @@ -617,8 +620,79 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) + def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + model_meta = getattr(self, "_xml", {}) + existed_attr_keys: list[str] = [] + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + def copy(self) -> "Model": return Model(self.__dict__) @@ -627,7 +701,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order - attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") } annotations = { @@ -642,10 +716,10 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) if not rf._rest_name_input: rf._rest_name_input = attr - cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") - return super().__new__(cls) # pylint: disable=no-value-for-parameter + return super().__new__(cls) def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: @@ -671,7 +745,7 @@ def _deserialize(cls, data, exist_discriminators): model_meta = getattr(cls, "_xml", {}) prop_meta = getattr(discriminator, "_xml", {}) xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) if xml_ns: xml_name = "{" + xml_ns + "}" + xml_name @@ -681,10 +755,10 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member return mapped_cls._deserialize(data, exist_discriminators) - def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. @@ -744,7 +818,7 @@ def _deserialize_with_union(deserializers, obj): def _deserialize_dict( value_deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], - obj: typing.Dict[typing.Any, typing.Any], + obj: dict[typing.Any, typing.Any], ): if obj is None: return obj @@ -754,7 +828,7 @@ def _deserialize_dict( def _deserialize_multiple_sequence( - entry_deserializers: typing.List[typing.Optional[typing.Callable]], + entry_deserializers: list[typing.Optional[typing.Callable]], module: typing.Optional[str], obj, ): @@ -763,6 +837,14 @@ def _deserialize_multiple_sequence( return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + def _deserialize_sequence( deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], @@ -772,17 +854,30 @@ def _deserialize_sequence( return obj if isinstance(obj, ET.Element): obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) -def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: return sorted( types, key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), ) -def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -822,16 +917,18 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur # is it optional? try: - if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True if len(annotation.__args__) <= 2: # pyright: ignore if_obj_deserializer = _get_deserialize_callable_from_annotation( - next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore ) return functools.partial(_deserialize_with_optional, if_obj_deserializer) # the type is Optional[Union[...]], we need to remove the None type from the Union annotation_copy = copy.copy(annotation) - annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) except AttributeError: pass @@ -847,7 +944,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur return functools.partial(_deserialize_with_union, deserializers) try: - if annotation._name == "Dict": # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": value_deserializer = _get_deserialize_callable_from_annotation( annotation.__args__[1], module, rf # pyright: ignore ) @@ -860,7 +960,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur except (AttributeError, IndexError): pass try: - if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: if len(annotation.__args__) > 1: # pyright: ignore entry_deserializers = [ _get_deserialize_callable_from_annotation(dt, module, rf) @@ -909,16 +1012,20 @@ def _deserialize_with_callable( return float(value.text) if value.text else None if deserializer is bool: return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None if deserializer is None: return value if deserializer in [int, float, bool]: return deserializer(value) if isinstance(deserializer, CaseInsensitiveEnumMeta): try: - return deserializer(value) + return deserializer(value.text if isinstance(value, ET.Element) else value) except ValueError: # for unknown value, return raw value - return value + return value.text if isinstance(value, ET.Element) else value if isinstance(deserializer, type) and issubclass(deserializer, Model): return deserializer._deserialize(value, []) return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) @@ -944,14 +1051,14 @@ def _deserialize( def _failsafe_deserialize( deserializer: typing.Any, - value: typing.Any, + response: HttpResponse, module: typing.Optional[str] = None, rf: typing.Optional["_RestField"] = None, format: typing.Optional[str] = None, ) -> typing.Any: try: - return _deserialize(deserializer, value, module, rf, format) - except DeserializationError: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -960,17 +1067,18 @@ def _failsafe_deserialize( def _failsafe_deserialize_xml( deserializer: typing.Any, - value: typing.Any, + response: HttpResponse, ) -> typing.Any: try: - return _deserialize_xml(deserializer, value) - except DeserializationError: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) return None +# pylint: disable=too-many-instance-attributes class _RestField: def __init__( self, @@ -978,11 +1086,11 @@ def __init__( name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin is_discriminator: bool = False, - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ): self._type = type self._rest_name_input = name @@ -990,6 +1098,7 @@ def __init__( self._is_discriminator = is_discriminator self._visibility = visibility self._is_model = False + self._is_optional = False self._default = default self._format = format self._is_multipart_file_input = is_multipart_file_input @@ -997,7 +1106,11 @@ def __init__( @property def _class_type(self) -> typing.Any: - return getattr(self._type, "args", [None])[0] + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result @property def _rest_name(self) -> str: @@ -1008,14 +1121,40 @@ def _rest_name(self) -> str: def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class - item = obj.get(self._rest_name) + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: return item - return _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + if value is None: # we want to wipe out entries if users set attr to None try: @@ -1040,11 +1179,11 @@ def rest_field( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField( name=name, @@ -1061,8 +1200,8 @@ def rest_discriminator( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) @@ -1078,21 +1217,77 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + def _get_element( o: typing.Any, exclude_readonly: bool = False, - parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, typing.List[ET.Element]]: +) -> typing.Union[ET.Element, list[ET.Element]]: if _is_model(o): model_meta = getattr(o, "_xml", {}) # if prop is a model, then use the prop element directly, else generate a wrapper of model if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), + element_name, model_meta.get("prefix"), - model_meta.get("ns"), + _model_ns, ) readonly_props = [] @@ -1114,7 +1309,9 @@ def _get_element( # additional properties will not have rest field, use the wire name as xml name prop_meta = {"name": k} - # if no ns for prop, use model's + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. if prop_meta.get("ns") is None and model_meta.get("ns"): prop_meta["ns"] = model_meta.get("ns") prop_meta["prefix"] = model_meta.get("prefix") @@ -1126,12 +1323,7 @@ def _get_element( # text could only set on primitive type wrapped_element.text = _get_primitive_type_value(v) elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) + _set_xml_attribute(wrapped_element, k, v, prop_meta) else: # other wrapped prop element wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) @@ -1140,6 +1332,7 @@ def _get_element( return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore if isinstance(o, dict): result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None for k, v in o.items(): result.append( _get_wrapped_element( @@ -1147,7 +1340,7 @@ def _get_element( exclude_readonly, { "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, + "ns": _dict_ns, "prefix": parent_meta.get("prefix") if parent_meta else None, }, ) @@ -1156,13 +1349,16 @@ def _get_element( # primitive case need to create element based on parent_meta if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) return _get_wrapped_element( o, exclude_readonly, { "name": parent_meta.get("itemsName", parent_meta.get("name")), "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + "ns": _items_ns, }, ) @@ -1172,10 +1368,11 @@ def _get_element( def _get_wrapped_element( v: typing.Any, exclude_readonly: bool, - meta: typing.Optional[typing.Dict[str, typing.Any]], + meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns ) if isinstance(v, (dict, list)): wrapped_element.extend(_get_element(v, exclude_readonly, meta)) @@ -1183,7 +1380,7 @@ def _get_wrapped_element( _get_element(v, exclude_readonly, meta, wrapped_element) else: wrapped_element.text = _get_primitive_type_value(v) - return wrapped_element + return wrapped_element # type: ignore[no-any-return] def _get_primitive_type_value(v) -> str: @@ -1196,9 +1393,29 @@ def _get_primitive_type_value(v) -> str: return str(v) -def _create_xml_element(tag, prefix=None, ns=None): - if prefix and ns: +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) @@ -1215,7 +1432,7 @@ def _deserialize_xml( def _convert_element(e: ET.Element): # dict case if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: - dict_result: typing.Dict[str, typing.Any] = {} + dict_result: dict[str, typing.Any] = {} for child in e: if dict_result.get(child.tag) is not None: if isinstance(dict_result[child.tag], list): @@ -1228,7 +1445,7 @@ def _convert_element(e: ET.Element): return dict_result # array case if len(e) > 0: - array_result: typing.List[typing.Any] = [] + array_result: list[typing.Any] = [] for child in e: array_result.append(_convert_element(child)) return array_result diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_serialization.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_utils/serialization.py similarity index 98% rename from sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_serialization.py rename to sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_utils/serialization.py index eb86ea23c965..954bf7ebffa7 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_serialization.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_utils/serialization.py @@ -21,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -31,7 +30,6 @@ Mapping, Callable, MutableMapping, - List, ) try: @@ -41,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -229,12 +231,12 @@ class Model: serialization and deserialization. """ - _subtype_map: Dict[str, Dict[str, Any]] = {} - _attribute_map: Dict[str, Dict[str, Any]] = {} - _validation: Dict[str, Dict[str, Any]] = {} + _subtype_map: dict[str, dict[str, Any]] = {} + _attribute_map: dict[str, dict[str, Any]] = {} + _validation: dict[str, dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: - self.additional_properties: Optional[Dict[str, Any]] = {} + self.additional_properties: Optional[dict[str, Any]] = {} 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__) @@ -311,7 +313,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -380,7 +382,7 @@ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: def from_dict( cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, ) -> Self: """Parse a dict using given key extractor return a model. @@ -414,7 +416,7 @@ 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)) # pylint: disable=protected-access + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access return result @classmethod @@ -528,7 +530,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -579,7 +581,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) + serialized |= target_obj.additional_properties continue try: @@ -789,7 +791,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -823,13 +825,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ 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 # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1184,7 +1193,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen while "." in key: # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1386,7 +1395,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1759,7 +1768,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :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. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1785,7 +1794,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_version.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_version.py index 0ec13ea52bbf..0e00a6283246 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_version.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "2.0.0b1" diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/_client.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/_client.py index 9791300c38d2..997665de5e24 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/_client.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/_client.py @@ -7,15 +7,17 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING -from typing_extensions import Self +import sys +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints -from .._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import WorkloadsSapVirtualInstanceMgmtClientConfiguration from .operations import ( Operations, @@ -25,7 +27,13 @@ SAPVirtualInstancesOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -50,9 +58,13 @@ class WorkloadsSapVirtualInstanceMgmtClient: :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-09-01". + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2024-09-01" + and None. Default value is None. If not set, the operation's default API version will be used. 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 @@ -63,13 +75,26 @@ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = WorkloadsSapVirtualInstanceMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -88,7 +113,9 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, _endpoint), policies=_policies, **kwargs + ) self._serialize = Serializer() self._deserialize = Deserializer() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/_configuration.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/_configuration.py index a667f693e1ca..18e54efb9a13 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/_configuration.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/_configuration.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -14,6 +14,7 @@ from .._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -29,7 +30,11 @@ class WorkloadsSapVirtualInstanceMgmtClientConfiguration: # pylint: disable=too :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-09-01". + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2024-09-01" + and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -39,6 +44,7 @@ def __init__( credential: "AsyncTokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: api_version: str = kwargs.pop("api_version", "2024-09-01") @@ -51,6 +57,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-workloadssapvirtualinstance/{}".format(VERSION)) diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/_patch.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/_patch.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/operations/_operations.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/operations/_operations.py index d9cd0e287abd..d0197def794f 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/operations/_operations.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/operations/_operations.py @@ -6,10 +6,10 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -34,8 +34,8 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from ..._serialization import Deserializer, Serializer +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import ( build_operations_list_request, build_sap_application_server_instances_create_request, @@ -74,13 +74,10 @@ ) from .._configuration import WorkloadsSapVirtualInstanceMgmtClientConfiguration -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]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] +List = list class Operations: @@ -103,7 +100,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation @@ -150,7 +147,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -163,7 +163,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -179,7 +182,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -248,6 +254,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -262,11 +269,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPVirtualInstance, response.json()) @@ -318,6 +328,7 @@ async def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -331,7 +342,10 @@ async def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -341,7 +355,7 @@ async def _create_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -559,6 +573,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -572,7 +587,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -580,7 +598,7 @@ async def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -789,6 +807,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -802,7 +821,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -810,7 +832,7 @@ async def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -881,7 +903,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SAPVirtualInstance"]: + ) -> AsyncItemPaged["_models.SAPVirtualInstance"]: """Gets all Virtual Instances for SAP solutions resources in a Resource Group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -933,7 +955,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -946,7 +971,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SAPVirtualInstance], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SAPVirtualInstance], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -962,7 +990,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -970,7 +1001,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SAPVirtualInstance"]: + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.SAPVirtualInstance"]: """Gets all Virtual Instances for SAP solutions resources in a Subscription. :return: An iterator like instance of SAPVirtualInstance @@ -1018,7 +1049,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1031,7 +1065,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SAPVirtualInstance], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SAPVirtualInstance], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1047,7 +1084,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1073,9 +1113,10 @@ async def _start_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -1100,6 +1141,7 @@ async def _start_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1113,7 +1155,10 @@ async def _start_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1121,7 +1166,7 @@ async def _start_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1254,6 +1299,7 @@ async def begin_start( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1273,14 +1319,10 @@ async def begin_start( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -1325,9 +1367,10 @@ async def _stop_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -1352,6 +1395,7 @@ async def _stop_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1365,7 +1409,10 @@ async def _stop_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1373,7 +1420,7 @@ async def _stop_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1506,6 +1553,7 @@ async def begin_stop( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1525,14 +1573,10 @@ async def begin_stop( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -1672,6 +1716,7 @@ async def get_sizing_recommendations( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1686,11 +1731,14 @@ async def get_sizing_recommendations( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPSizingRecommendationResult, response.json()) @@ -1813,6 +1861,7 @@ async def get_sap_supported_sku( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1827,11 +1876,14 @@ async def get_sap_supported_sku( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPSupportedResourceSkusResult, response.json()) @@ -1954,6 +2006,7 @@ async def get_disk_configurations( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1968,11 +2021,14 @@ async def get_disk_configurations( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPDiskConfigurationsResult, response.json()) @@ -2095,6 +2151,7 @@ async def get_availability_zone_details( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2109,11 +2166,14 @@ async def get_availability_zone_details( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPAvailabilityZoneDetailsResult, response.json()) @@ -2189,6 +2249,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2203,11 +2264,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPCentralServerInstance, response.json()) @@ -2261,6 +2325,7 @@ async def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2274,7 +2339,10 @@ async def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2284,7 +2352,7 @@ async def _create_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2651,6 +2719,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2665,11 +2734,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPCentralServerInstance, response.json()) @@ -2708,6 +2780,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2721,7 +2794,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2729,7 +2805,7 @@ async def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2806,7 +2882,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list( self, resource_group_name: str, sap_virtual_instance_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SAPCentralServerInstance"]: + ) -> AsyncItemPaged["_models.SAPCentralServerInstance"]: """Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. @@ -2863,7 +2939,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2876,7 +2955,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SAPCentralServerInstance], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SAPCentralServerInstance], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2892,7 +2974,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2919,9 +3004,10 @@ async def _start_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -2947,6 +3033,7 @@ async def _start_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2960,7 +3047,10 @@ async def _start_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2968,7 +3058,7 @@ async def _start_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3110,6 +3200,7 @@ async def begin_start( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3130,14 +3221,10 @@ async def begin_start( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -3183,9 +3270,10 @@ async def _stop_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -3211,6 +3299,7 @@ async def _stop_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3224,7 +3313,10 @@ async def _stop_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3232,7 +3324,7 @@ async def _stop_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3374,6 +3466,7 @@ async def begin_stop( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3394,14 +3487,10 @@ async def begin_stop( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -3493,6 +3582,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3507,11 +3597,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPDatabaseInstance, response.json()) @@ -3565,6 +3658,7 @@ async def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3578,7 +3672,10 @@ async def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3588,7 +3685,7 @@ async def _create_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3951,6 +4048,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3965,11 +4063,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPDatabaseInstance, response.json()) @@ -4008,6 +4109,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4021,7 +4123,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4029,7 +4134,7 @@ async def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4105,7 +4210,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list( self, resource_group_name: str, sap_virtual_instance_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SAPDatabaseInstance"]: + ) -> AsyncItemPaged["_models.SAPDatabaseInstance"]: """Lists the Database resources associated with a Virtual Instance for SAP solutions resource. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -4161,7 +4266,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4174,7 +4282,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SAPDatabaseInstance], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SAPDatabaseInstance], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4190,7 +4301,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4217,9 +4331,10 @@ async def _start_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -4245,6 +4360,7 @@ async def _start_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4258,7 +4374,10 @@ async def _start_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4266,7 +4385,7 @@ async def _start_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4408,6 +4527,7 @@ async def begin_start( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4428,14 +4548,10 @@ async def begin_start( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -4481,9 +4597,10 @@ async def _stop_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -4509,6 +4626,7 @@ async def _stop_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4522,7 +4640,10 @@ async def _stop_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4530,7 +4651,7 @@ async def _stop_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4672,6 +4793,7 @@ async def begin_stop( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4692,14 +4814,10 @@ async def begin_stop( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -4793,6 +4911,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4807,11 +4926,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPApplicationServerInstance, response.json()) @@ -4865,6 +4987,7 @@ async def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4878,7 +5001,10 @@ async def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4888,7 +5014,7 @@ async def _create_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5251,6 +5377,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5265,11 +5392,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPApplicationServerInstance, response.json()) @@ -5308,6 +5438,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5321,7 +5452,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5329,7 +5463,7 @@ async def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5404,7 +5538,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list( self, resource_group_name: str, sap_virtual_instance_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SAPApplicationServerInstance"]: + ) -> AsyncItemPaged["_models.SAPApplicationServerInstance"]: """Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. @@ -5461,7 +5595,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5474,7 +5611,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SAPApplicationServerInstance], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SAPApplicationServerInstance], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -5490,7 +5630,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -5517,9 +5660,10 @@ async def _start_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -5545,6 +5689,7 @@ async def _start_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5558,7 +5703,10 @@ async def _start_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5566,7 +5714,7 @@ async def _start_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5708,6 +5856,7 @@ async def begin_start( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5728,14 +5877,10 @@ async def begin_start( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -5781,9 +5926,10 @@ async def _stop_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -5809,6 +5955,7 @@ async def _stop_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5822,7 +5969,10 @@ async def _stop_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5830,7 +5980,7 @@ async def _stop_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5972,6 +6122,7 @@ async def begin_stop( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5992,14 +6143,10 @@ async def begin_stop( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/operations/_patch.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/operations/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/operations/_patch.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/aio/operations/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/models/_enums.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/models/_enums.py index 638dcfd55333..68e970734b6d 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/models/_enums.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/models/_enums.py @@ -154,7 +154,7 @@ class SAPDatabaseScaleMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The database scale method.""" SCALE_UP = "ScaleUp" - """ScaleUp Hana Database deployment type""" + """ScaleUp Hana Database deployment type.""" class SAPDatabaseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -211,7 +211,7 @@ class SAPProductType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ECC = "ECC" """SAP Product ECC.""" - S4HANA = "S4HANA" + S4_HANA = "S4HANA" """SAP Product S4HANA.""" OTHER = "Other" """SAP Products other than the ones listed.""" diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/models/_models.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/models/_models.py index 99f1ed135fe4..1f34f2526b89 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/models/_models.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/models/_models.py @@ -9,10 +9,9 @@ # pylint: disable=useless-super-delegation import datetime -from typing import Any, Dict, List, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload +from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload -from .. import _model_base -from .._model_base import rest_discriminator, rest_field +from .._utils.model_base import Model as _Model, rest_discriminator, rest_field from ._enums import ( FileShareConfigurationType, NamingPatternType, @@ -26,7 +25,7 @@ from .. import models as _models -class ApplicationServerConfiguration(_model_base.Model): +class ApplicationServerConfiguration(_Model): """Gets or sets the application server configuration. :ivar subnet_id: The subnet id. Required. @@ -67,7 +66,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ApplicationServerFullResourceNames(_model_base.Model): +class ApplicationServerFullResourceNames(_Model): """The full resource names object for application layer resources. The number of entries in this list should be equal to the number VMs to be created for application layer. @@ -79,7 +78,7 @@ class ApplicationServerFullResourceNames(_model_base.Model): :vartype availability_set_name: str """ - virtual_machines: Optional[List["_models.VirtualMachineResourceNames"]] = rest_field( + virtual_machines: Optional[list["_models.VirtualMachineResourceNames"]] = rest_field( name="virtualMachines", visibility=["read", "create", "update", "delete", "query"] ) """The list of virtual machine naming details.""" @@ -93,7 +92,7 @@ class ApplicationServerFullResourceNames(_model_base.Model): def __init__( self, *, - virtual_machines: Optional[List["_models.VirtualMachineResourceNames"]] = None, + virtual_machines: Optional[list["_models.VirtualMachineResourceNames"]] = None, availability_set_name: Optional[str] = None, ) -> None: ... @@ -108,7 +107,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ApplicationServerVmDetails(_model_base.Model): +class ApplicationServerVmDetails(_Model): """The Application Server VM Details. :ivar type: Defines the type of application server VM. Known values are: "Active", "Standby", @@ -128,14 +127,14 @@ class ApplicationServerVmDetails(_model_base.Model): \"Unknown\".""" virtual_machine_id: Optional[str] = rest_field(name="virtualMachineId", visibility=["read"]) """The virtual machine id.""" - storage_details: Optional[List["_models.StorageInformation"]] = rest_field( + storage_details: Optional[list["_models.StorageInformation"]] = rest_field( name="storageDetails", visibility=["read"] ) """Storage details of all the Storage Accounts attached to the App Virtual Machine. For e.g. NFS on AFS Shared Storage.""" -class CentralServerConfiguration(_model_base.Model): +class CentralServerConfiguration(_Model): """Gets or sets the central server configuration. :ivar subnet_id: The subnet id. Required. @@ -176,7 +175,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CentralServerFullResourceNames(_model_base.Model): +class CentralServerFullResourceNames(_Model): """The full resource names object for central server layer resources. :ivar virtual_machines: The list of names for all ASCS virtual machines to be deployed. The @@ -192,7 +191,7 @@ class CentralServerFullResourceNames(_model_base.Model): ~azure.mgmt.workloadssapvirtualinstance.models.LoadBalancerResourceNames """ - virtual_machines: Optional[List["_models.VirtualMachineResourceNames"]] = rest_field( + virtual_machines: Optional[list["_models.VirtualMachineResourceNames"]] = rest_field( name="virtualMachines", visibility=["read", "create", "update", "delete", "query"] ) """The list of names for all ASCS virtual machines to be deployed. The number of entries in this @@ -212,7 +211,7 @@ class CentralServerFullResourceNames(_model_base.Model): def __init__( self, *, - virtual_machines: Optional[List["_models.VirtualMachineResourceNames"]] = None, + virtual_machines: Optional[list["_models.VirtualMachineResourceNames"]] = None, availability_set_name: Optional[str] = None, load_balancer: Optional["_models.LoadBalancerResourceNames"] = None, ) -> None: ... @@ -228,7 +227,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CentralServerVmDetails(_model_base.Model): +class CentralServerVmDetails(_Model): """The SAP Central Services Instance VM details. :ivar type: Defines the type of central server VM. Known values are: "Primary", "Secondary", @@ -248,14 +247,14 @@ class CentralServerVmDetails(_model_base.Model): \"Unknown\", \"ASCS\", \"ERSInactive\", \"ERS\", and \"Standby\".""" virtual_machine_id: Optional[str] = rest_field(name="virtualMachineId", visibility=["read"]) """The virtual machine id.""" - storage_details: Optional[List["_models.StorageInformation"]] = rest_field( + storage_details: Optional[list["_models.StorageInformation"]] = rest_field( name="storageDetails", visibility=["read"] ) """Storage details of all the Storage Accounts attached to the ASCS Virtual Machine. For e.g. NFS on AFS Shared Storage.""" -class FileShareConfiguration(_model_base.Model): +class FileShareConfiguration(_Model): """File Share configuration details, populated with information on storage configuration mounted on the VIS. The createAndMount option is selected in case of missing input. @@ -268,7 +267,7 @@ class FileShareConfiguration(_model_base.Model): ~azure.mgmt.workloadssapvirtualinstance.models.FileShareConfigurationType """ - __mapping__: Dict[str, _model_base.Model] = {} + __mapping__: dict[str, _Model] = {} configuration_type: str = rest_discriminator( name="configurationType", visibility=["read", "create", "update", "delete", "query"] ) @@ -339,10 +338,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, configuration_type=FileShareConfigurationType.CREATE_AND_MOUNT, **kwargs) + super().__init__(*args, **kwargs) + self.configuration_type = FileShareConfigurationType.CREATE_AND_MOUNT # type: ignore -class DatabaseConfiguration(_model_base.Model): +class DatabaseConfiguration(_Model): """Gets or sets the database configuration. :ivar database_type: The database type. Known values are: "HANA" and "DB2". @@ -397,7 +397,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DatabaseServerFullResourceNames(_model_base.Model): +class DatabaseServerFullResourceNames(_Model): """The full resource names object for database layer resources. The number of entries in this list should be equal to the number VMs to be created for database layer. @@ -412,7 +412,7 @@ class DatabaseServerFullResourceNames(_model_base.Model): ~azure.mgmt.workloadssapvirtualinstance.models.LoadBalancerResourceNames """ - virtual_machines: Optional[List["_models.VirtualMachineResourceNames"]] = rest_field( + virtual_machines: Optional[list["_models.VirtualMachineResourceNames"]] = rest_field( name="virtualMachines", visibility=["read", "create", "update", "delete", "query"] ) """The list of virtual machine naming details.""" @@ -430,7 +430,7 @@ class DatabaseServerFullResourceNames(_model_base.Model): def __init__( self, *, - virtual_machines: Optional[List["_models.VirtualMachineResourceNames"]] = None, + virtual_machines: Optional[list["_models.VirtualMachineResourceNames"]] = None, availability_set_name: Optional[str] = None, load_balancer: Optional["_models.LoadBalancerResourceNames"] = None, ) -> None: ... @@ -446,7 +446,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DatabaseVmDetails(_model_base.Model): +class DatabaseVmDetails(_Model): """Database VM details. :ivar virtual_machine_id: The virtual machine id. @@ -465,14 +465,14 @@ class DatabaseVmDetails(_model_base.Model): status: Optional[Union[str, "_models.SAPVirtualInstanceStatus"]] = rest_field(visibility=["read"]) """Defines the SAP Instance status. Known values are: \"Starting\", \"Running\", \"Stopping\", \"Offline\", \"PartiallyRunning\", \"Unavailable\", and \"SoftShutdown\".""" - storage_details: Optional[List["_models.StorageInformation"]] = rest_field( + storage_details: Optional[list["_models.StorageInformation"]] = rest_field( name="storageDetails", visibility=["read"] ) """Storage details of all the Storage Accounts attached to the Database Virtual Machine. For e.g. NFS on AFS Shared Storage.""" -class DeployerVmPackages(_model_base.Model): +class DeployerVmPackages(_Model): """Defines the url and storage account ID where deployer VM packages are uploaded. :ivar url: The URL to the deployer VM packages file. @@ -507,7 +507,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPConfiguration(_model_base.Model): +class SAPConfiguration(_Model): """The SAP Configuration. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -519,7 +519,7 @@ class SAPConfiguration(_model_base.Model): ~azure.mgmt.workloadssapvirtualinstance.models.SAPConfigurationType """ - __mapping__: Dict[str, _model_base.Model] = {} + __mapping__: dict[str, _Model] = {} configuration_type: str = rest_discriminator( name="configurationType", visibility=["read", "create", "update", "delete", "query"] ) @@ -593,7 +593,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, configuration_type=SAPConfigurationType.DEPLOYMENT, **kwargs) + super().__init__(*args, **kwargs) + self.configuration_type = SAPConfigurationType.DEPLOYMENT # type: ignore class DeploymentWithOSConfiguration(SAPConfiguration, discriminator="DeploymentWithOSConfig"): @@ -654,7 +655,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, configuration_type=SAPConfigurationType.DEPLOYMENT_WITH_OS_CONFIG, **kwargs) + super().__init__(*args, **kwargs) + self.configuration_type = SAPConfigurationType.DEPLOYMENT_WITH_OS_CONFIG # type: ignore class DiscoveryConfiguration(SAPConfiguration, discriminator="Discovery"): @@ -708,10 +710,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, configuration_type=SAPConfigurationType.DISCOVERY, **kwargs) + super().__init__(*args, **kwargs) + self.configuration_type = SAPConfigurationType.DISCOVERY # type: ignore -class DiskConfiguration(_model_base.Model): +class DiskConfiguration(_Model): """The Disk Configuration Details. :ivar disk_volume_configurations: The disk configuration for the db volume. For HANA, Required @@ -721,7 +724,7 @@ class DiskConfiguration(_model_base.Model): ~azure.mgmt.workloadssapvirtualinstance.models.DiskVolumeConfiguration] """ - disk_volume_configurations: Optional[Dict[str, "_models.DiskVolumeConfiguration"]] = rest_field( + disk_volume_configurations: Optional[dict[str, "_models.DiskVolumeConfiguration"]] = rest_field( name="diskVolumeConfigurations", visibility=["read", "create", "update", "delete", "query"] ) """The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', @@ -731,7 +734,7 @@ class DiskConfiguration(_model_base.Model): def __init__( self, *, - disk_volume_configurations: Optional[Dict[str, "_models.DiskVolumeConfiguration"]] = None, + disk_volume_configurations: Optional[dict[str, "_models.DiskVolumeConfiguration"]] = None, ) -> None: ... @overload @@ -745,7 +748,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DiskDetails(_model_base.Model): +class DiskDetails(_Model): """The supported disk size details for a disk type. :ivar sku: The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, @@ -812,7 +815,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DiskSku(_model_base.Model): +class DiskSku(_Model): """The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. :ivar name: Defines the disk sku name. Known values are: "Standard_LRS", "Premium_LRS", @@ -845,7 +848,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DiskVolumeConfiguration(_model_base.Model): +class DiskVolumeConfiguration(_Model): """The disk configuration required for the selected volume. :ivar count: The total number of disks required for the concerned volume. @@ -883,7 +886,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EnqueueReplicationServerProperties(_model_base.Model): +class EnqueueReplicationServerProperties(_Model): """Defines the SAP Enqueue Replication Server (ERS) properties. :ivar ers_version: Defines the type of Enqueue Replication Server. Known values are: @@ -925,7 +928,7 @@ class EnqueueReplicationServerProperties(_model_base.Model): and \"Degraded\".""" -class EnqueueServerProperties(_model_base.Model): +class EnqueueServerProperties(_Model): """Defines the SAP Enqueue Server properties. :ivar hostname: Enqueue Server SAP Hostname. @@ -950,7 +953,7 @@ class EnqueueServerProperties(_model_base.Model): and \"Degraded\".""" -class ErrorAdditionalInfo(_model_base.Model): +class ErrorAdditionalInfo(_Model): """The resource management error additional info. :ivar type: The additional info type. @@ -965,7 +968,7 @@ class ErrorAdditionalInfo(_model_base.Model): """The additional info.""" -class ErrorDefinition(_model_base.Model): +class ErrorDefinition(_Model): """Error definition. :ivar code: Service specific error code which serves as the substatus for the HTTP error code. @@ -980,11 +983,11 @@ class ErrorDefinition(_model_base.Model): """Service specific error code which serves as the substatus for the HTTP error code.""" message: Optional[str] = rest_field(visibility=["read"]) """Description of the error.""" - details: Optional[List["_models.ErrorDefinition"]] = rest_field(visibility=["read"]) + details: Optional[list["_models.ErrorDefinition"]] = rest_field(visibility=["read"]) """Internal error details.""" -class ErrorDetail(_model_base.Model): +class ErrorDetail(_Model): """The error detail. :ivar code: The error code. @@ -1006,17 +1009,16 @@ class ErrorDetail(_model_base.Model): """The error message.""" target: Optional[str] = rest_field(visibility=["read"]) """The error target.""" - details: Optional[List["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) """The error details.""" - additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = rest_field( + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( name="additionalInfo", visibility=["read"] ) """The error additional info.""" -class ErrorResponse(_model_base.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. +class ErrorResponse(_Model): + """Error response. :ivar error: The error object. :vartype error: ~azure.mgmt.workloadssapvirtualinstance.models.ErrorDetail @@ -1043,7 +1045,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SoftwareConfiguration(_model_base.Model): +class SoftwareConfiguration(_Model): """The SAP Software configuration Input. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1056,7 +1058,7 @@ class SoftwareConfiguration(_model_base.Model): ~azure.mgmt.workloadssapvirtualinstance.models.SAPSoftwareInstallationType """ - __mapping__: Dict[str, _model_base.Model] = {} + __mapping__: dict[str, _Model] = {} software_installation_type: str = rest_discriminator( name="softwareInstallationType", visibility=["read", "create", "update", "delete", "query"] ) @@ -1118,10 +1120,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, software_installation_type=SAPSoftwareInstallationType.EXTERNAL, **kwargs) + super().__init__(*args, **kwargs) + self.software_installation_type = SAPSoftwareInstallationType.EXTERNAL # type: ignore -class GatewayServerProperties(_model_base.Model): +class GatewayServerProperties(_Model): """Defines the SAP Gateway Server properties. :ivar port: Gateway Port. @@ -1138,7 +1141,7 @@ class GatewayServerProperties(_model_base.Model): and \"Degraded\".""" -class HighAvailabilityConfiguration(_model_base.Model): +class HighAvailabilityConfiguration(_Model): """Gets or sets the high availability configuration. :ivar high_availability_type: The high availability type. Required. Known values are: @@ -1171,7 +1174,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HighAvailabilitySoftwareConfiguration(_model_base.Model): +class HighAvailabilitySoftwareConfiguration(_Model): """Gets or sets the HA software configuration. :ivar fencing_client_id: The fencing client id. Required. @@ -1210,7 +1213,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImageReference(_model_base.Model): +class ImageReference(_Model): """Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other @@ -1276,7 +1279,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InfrastructureConfiguration(_model_base.Model): +class InfrastructureConfiguration(_Model): """Deploy SAP Infrastructure Details. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1291,7 +1294,7 @@ class InfrastructureConfiguration(_model_base.Model): ~azure.mgmt.workloadssapvirtualinstance.models.SAPDeploymentType """ - __mapping__: Dict[str, _model_base.Model] = {} + __mapping__: dict[str, _Model] = {} app_resource_group: str = rest_field( name="appResourceGroup", visibility=["read", "create", "update", "delete", "query"] ) @@ -1321,7 +1324,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OSConfiguration(_model_base.Model): +class OSConfiguration(_Model): """Defines the OS configuration. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1331,7 +1334,7 @@ class OSConfiguration(_model_base.Model): :vartype os_type: str or ~azure.mgmt.workloadssapvirtualinstance.models.OSType """ - __mapping__: Dict[str, _model_base.Model] = {} + __mapping__: dict[str, _Model] = {} os_type: str = rest_discriminator(name="osType", visibility=["read", "create", "update", "delete", "query"]) """The OS Type. Required. Known values are: \"Linux\" and \"Windows\".""" @@ -1401,10 +1404,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, os_type=OSType.LINUX, **kwargs) + super().__init__(*args, **kwargs) + self.os_type = OSType.LINUX # type: ignore -class LoadBalancerDetails(_model_base.Model): +class LoadBalancerDetails(_Model): """The Load Balancer details such as Load Balancer ID. :ivar id: Fully qualified resource ID for the load balancer. @@ -1415,7 +1419,7 @@ class LoadBalancerDetails(_model_base.Model): """Fully qualified resource ID for the load balancer.""" -class LoadBalancerResourceNames(_model_base.Model): +class LoadBalancerResourceNames(_Model): """The resource names object for load balancer and related resources. :ivar load_balancer_name: The full resource name for load balancer. If this value is not @@ -1437,17 +1441,17 @@ class LoadBalancerResourceNames(_model_base.Model): ) """The full resource name for load balancer. If this value is not provided, load balancer will be name as {ASCS/DB}-loadBalancer.""" - frontend_ip_configuration_names: Optional[List[str]] = rest_field( + frontend_ip_configuration_names: Optional[list[str]] = rest_field( name="frontendIpConfigurationNames", visibility=["read", "create", "update", "delete", "query"] ) """The list of frontend IP configuration names. If provided as input, size of this list should be 2 for cs layer and should be 1 for database layer.""" - backend_pool_names: Optional[List[str]] = rest_field( + backend_pool_names: Optional[list[str]] = rest_field( name="backendPoolNames", visibility=["read", "create", "update", "delete", "query"] ) """The list of backend pool names. Currently, ACSS deploys only one backend pool and hence, size of this list should be 1.""" - health_probe_names: Optional[List[str]] = rest_field( + health_probe_names: Optional[list[str]] = rest_field( name="healthProbeNames", visibility=["read", "create", "update", "delete", "query"] ) """The list of health probe names. If provided as input, size of this list should be 2 for cs @@ -1458,9 +1462,9 @@ def __init__( self, *, load_balancer_name: Optional[str] = None, - frontend_ip_configuration_names: Optional[List[str]] = None, - backend_pool_names: Optional[List[str]] = None, - health_probe_names: Optional[List[str]] = None, + frontend_ip_configuration_names: Optional[list[str]] = None, + backend_pool_names: Optional[list[str]] = None, + health_probe_names: Optional[list[str]] = None, ) -> None: ... @overload @@ -1474,7 +1478,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedRGConfiguration(_model_base.Model): +class ManagedRGConfiguration(_Model): """Managed resource group configuration. :ivar name: Managed resource group name. @@ -1502,7 +1506,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MessageServerProperties(_model_base.Model): +class MessageServerProperties(_Model): """Defines the SAP message server properties. :ivar ms_port: message server port. @@ -1578,10 +1582,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, configuration_type=FileShareConfigurationType.MOUNT, **kwargs) + super().__init__(*args, **kwargs) + self.configuration_type = FileShareConfigurationType.MOUNT # type: ignore -class NetworkConfiguration(_model_base.Model): +class NetworkConfiguration(_Model): """Defines the network configuration type for SAP system infrastructure that is being deployed. :ivar is_secondary_ip_enabled: Specifies whether a secondary IP address should be added to the @@ -1613,7 +1618,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NetworkInterfaceResourceNames(_model_base.Model): +class NetworkInterfaceResourceNames(_Model): """The resource names object for network interface and related resources. :ivar network_interface_name: The full name for network interface. If name is not provided, @@ -1653,8 +1658,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Operation(_model_base.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. +class Operation(_Model): + """REST API Operation. :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". @@ -1710,8 +1715,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OperationDisplay(_model_base.Model): - """Localized display information for and operation. +class OperationDisplay(_Model): + """Localized display information for an operation. :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". @@ -1741,7 +1746,7 @@ class OperationDisplay(_model_base.Model): views.""" -class OperationStatusResult(_model_base.Model): +class OperationStatusResult(_Model): """The current status of an async operation. :ivar id: Fully qualified ID for the async operation. @@ -1783,7 +1788,7 @@ class OperationStatusResult(_model_base.Model): name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" ) """The end time of the operation.""" - operations: Optional[List["_models.OperationStatusResult"]] = rest_field( + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The operations list.""" @@ -1802,7 +1807,7 @@ def __init__( percent_complete: Optional[float] = None, start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, - operations: Optional[List["_models.OperationStatusResult"]] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, error: Optional["_models.ErrorDetail"] = None, ) -> None: ... @@ -1817,7 +1822,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OSProfile(_model_base.Model): +class OSProfile(_Model): """Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is provisioned. @@ -1900,7 +1905,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OsSapConfiguration(_model_base.Model): +class OsSapConfiguration(_Model): """Defines the OS and SAP Configurations for Deployment. :ivar deployer_vm_packages: The url and storage account ID where deployer VM packages are @@ -1937,8 +1942,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Resource(_model_base.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. +class Resource(_Model): + """Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -1966,8 +1971,7 @@ class Resource(_model_base.Model): class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. + """Tracked Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -1986,7 +1990,7 @@ class TrackedResource(Resource): :vartype location: str """ - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" location: str = rest_field(visibility=["read", "create"]) """The geo-location where the resource lives. Required.""" @@ -1996,7 +2000,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -2043,7 +2047,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.SAPApplicationServerProperties"] = None, ) -> None: ... @@ -2058,7 +2062,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPApplicationServerProperties(_model_base.Model): +class SAPApplicationServerProperties(_Model): """Defines the SAP Application Server instance properties. :ivar instance_no: Application server Instance Number. @@ -2127,7 +2131,7 @@ class SAPApplicationServerProperties(_model_base.Model): ) """The Load Balancer details such as LoadBalancer ID attached to Application Server Virtual Machines.""" - vm_details: Optional[List["_models.ApplicationServerVmDetails"]] = rest_field(name="vmDetails", visibility=["read"]) + vm_details: Optional[list["_models.ApplicationServerVmDetails"]] = rest_field(name="vmDetails", visibility=["read"]) """The list of virtual machines.""" status: Optional[Union[str, "_models.SAPVirtualInstanceStatus"]] = rest_field(visibility=["read"]) """Defines the SAP Instance status. Known values are: \"Starting\", \"Running\", \"Stopping\", @@ -2144,7 +2148,7 @@ class SAPApplicationServerProperties(_model_base.Model): """Defines the Application Instance errors.""" -class SAPAvailabilityZoneDetailsRequest(_model_base.Model): +class SAPAvailabilityZoneDetailsRequest(_Model): """The SAP request to get list of availability zones. :ivar app_location: The geo-location where the SAP resources will be created. Required. @@ -2188,7 +2192,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPAvailabilityZoneDetailsResult(_model_base.Model): +class SAPAvailabilityZoneDetailsResult(_Model): """The list of supported availability zone pairs which are part of SAP HA deployment. :ivar availability_zone_pairs: Gets the list of availability zone pairs. @@ -2196,7 +2200,7 @@ class SAPAvailabilityZoneDetailsResult(_model_base.Model): list[~azure.mgmt.workloadssapvirtualinstance.models.SAPAvailabilityZonePair] """ - availability_zone_pairs: Optional[List["_models.SAPAvailabilityZonePair"]] = rest_field( + availability_zone_pairs: Optional[list["_models.SAPAvailabilityZonePair"]] = rest_field( name="availabilityZonePairs", visibility=["read", "create", "update", "delete", "query"] ) """Gets the list of availability zone pairs.""" @@ -2205,7 +2209,7 @@ class SAPAvailabilityZoneDetailsResult(_model_base.Model): def __init__( self, *, - availability_zone_pairs: Optional[List["_models.SAPAvailabilityZonePair"]] = None, + availability_zone_pairs: Optional[list["_models.SAPAvailabilityZonePair"]] = None, ) -> None: ... @overload @@ -2219,7 +2223,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPAvailabilityZonePair(_model_base.Model): +class SAPAvailabilityZonePair(_Model): """The SAP Availability Zone Pair. :ivar zone_a: The zone A. @@ -2284,7 +2288,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.SAPCentralServerProperties"] = None, ) -> None: ... @@ -2299,7 +2303,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPCentralServerProperties(_model_base.Model): +class SAPCentralServerProperties(_Model): """Defines the SAP Central Services Instance properties. :ivar instance_no: The central services instance number. @@ -2372,7 +2376,7 @@ class SAPCentralServerProperties(_model_base.Model): name="loadBalancerDetails", visibility=["read"] ) """The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual Machines.""" - vm_details: Optional[List["_models.CentralServerVmDetails"]] = rest_field(name="vmDetails", visibility=["read"]) + vm_details: Optional[list["_models.CentralServerVmDetails"]] = rest_field(name="vmDetails", visibility=["read"]) """The list of virtual machines corresponding to the Central Services instance.""" status: Optional[Union[str, "_models.SAPVirtualInstanceStatus"]] = rest_field(visibility=["read"]) """Defines the SAP Instance status. Known values are: \"Starting\", \"Running\", \"Stopping\", @@ -2441,7 +2445,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.SAPDatabaseProperties"] = None, ) -> None: ... @@ -2456,7 +2460,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPDatabaseProperties(_model_base.Model): +class SAPDatabaseProperties(_Model): """Defines the Database properties. :ivar subnet: Database subnet. @@ -2497,7 +2501,7 @@ class SAPDatabaseProperties(_model_base.Model): name="loadBalancerDetails", visibility=["read"] ) """The Load Balancer details such as LoadBalancer ID attached to Database Virtual Machines.""" - vm_details: Optional[List["_models.DatabaseVmDetails"]] = rest_field(name="vmDetails", visibility=["read"]) + vm_details: Optional[list["_models.DatabaseVmDetails"]] = rest_field(name="vmDetails", visibility=["read"]) """The list of virtual machines corresponding to the Database resource.""" status: Optional[Union[str, "_models.SAPVirtualInstanceStatus"]] = rest_field(visibility=["read"]) """Defines the SAP Instance status. Known values are: \"Starting\", \"Running\", \"Stopping\", @@ -2511,7 +2515,7 @@ class SAPDatabaseProperties(_model_base.Model): """Defines the errors related to Database resource.""" -class SAPDiskConfiguration(_model_base.Model): +class SAPDiskConfiguration(_Model): """The SAP Disk Configuration contains 'recommended disk' details and list of supported disks detail for a volume type. @@ -2527,7 +2531,7 @@ class SAPDiskConfiguration(_model_base.Model): name="recommendedConfiguration", visibility=["read", "create", "update", "delete", "query"] ) """The recommended disk details for a given VM Sku.""" - supported_configurations: Optional[List["_models.DiskDetails"]] = rest_field( + supported_configurations: Optional[list["_models.DiskDetails"]] = rest_field( name="supportedConfigurations", visibility=["read", "create", "update", "delete", "query"] ) """The list of supported disks for a given VM Sku.""" @@ -2537,7 +2541,7 @@ def __init__( self, *, recommended_configuration: Optional["_models.DiskVolumeConfiguration"] = None, - supported_configurations: Optional[List["_models.DiskDetails"]] = None, + supported_configurations: Optional[list["_models.DiskDetails"]] = None, ) -> None: ... @overload @@ -2551,7 +2555,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPDiskConfigurationsRequest(_model_base.Model): +class SAPDiskConfigurationsRequest(_Model): """The SAP request to get list of disk configurations. :ivar app_location: The geo-location where the SAP resources will be created. Required. @@ -2619,7 +2623,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPDiskConfigurationsResult(_model_base.Model): +class SAPDiskConfigurationsResult(_Model): """The list of disk configuration for vmSku which are part of SAP deployment. :ivar volume_configurations: The disk configuration for the db volume. For HANA, Required @@ -2629,7 +2633,7 @@ class SAPDiskConfigurationsResult(_model_base.Model): ~azure.mgmt.workloadssapvirtualinstance.models.SAPDiskConfiguration] """ - volume_configurations: Optional[Dict[str, "_models.SAPDiskConfiguration"]] = rest_field( + volume_configurations: Optional[dict[str, "_models.SAPDiskConfiguration"]] = rest_field( name="volumeConfigurations", visibility=["read", "create", "update", "delete", "query"] ) """The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', @@ -2639,7 +2643,7 @@ class SAPDiskConfigurationsResult(_model_base.Model): def __init__( self, *, - volume_configurations: Optional[Dict[str, "_models.SAPDiskConfiguration"]] = None, + volume_configurations: Optional[dict[str, "_models.SAPDiskConfiguration"]] = None, ) -> None: ... @overload @@ -2709,12 +2713,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__( - *args, software_installation_type=SAPSoftwareInstallationType.SAP_INSTALL_WITHOUT_OS_CONFIG, **kwargs - ) + super().__init__(*args, **kwargs) + self.software_installation_type = SAPSoftwareInstallationType.SAP_INSTALL_WITHOUT_OS_CONFIG # type: ignore -class SAPSizingRecommendationRequest(_model_base.Model): +class SAPSizingRecommendationRequest(_Model): """The SAP Sizing Recommendation request. :ivar app_location: The geo-location where the resource is to be created. Required. @@ -2803,7 +2806,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPSizingRecommendationResult(_model_base.Model): +class SAPSizingRecommendationResult(_Model): """The SAP sizing recommendation result. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -2815,7 +2818,7 @@ class SAPSizingRecommendationResult(_model_base.Model): ~azure.mgmt.workloadssapvirtualinstance.models.SAPDeploymentType """ - __mapping__: Dict[str, _model_base.Model] = {} + __mapping__: dict[str, _Model] = {} deployment_type: str = rest_discriminator( name="deploymentType", visibility=["read", "create", "update", "delete", "query"] ) @@ -2840,14 +2843,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPSupportedResourceSkusResult(_model_base.Model): +class SAPSupportedResourceSkusResult(_Model): """The list of supported SKUs for different resources which are part of SAP deployment. :ivar supported_skus: Gets the list of SAP supported SKUs. :vartype supported_skus: list[~azure.mgmt.workloadssapvirtualinstance.models.SAPSupportedSku] """ - supported_skus: Optional[List["_models.SAPSupportedSku"]] = rest_field( + supported_skus: Optional[list["_models.SAPSupportedSku"]] = rest_field( name="supportedSkus", visibility=["read", "create", "update", "delete", "query"] ) """Gets the list of SAP supported SKUs.""" @@ -2856,7 +2859,7 @@ class SAPSupportedResourceSkusResult(_model_base.Model): def __init__( self, *, - supported_skus: Optional[List["_models.SAPSupportedSku"]] = None, + supported_skus: Optional[list["_models.SAPSupportedSku"]] = None, ) -> None: ... @overload @@ -2870,7 +2873,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPSupportedSku(_model_base.Model): +class SAPSupportedSku(_Model): """The SAP supported SKU. :ivar vm_sku: The VM Sku. @@ -2913,7 +2916,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPSupportedSkusRequest(_model_base.Model): +class SAPSupportedSkusRequest(_Model): """The SAP request to get list of supported SKUs. :ivar app_location: The geo-location where the resource is to be created. Required. @@ -3024,7 +3027,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.SAPVirtualInstanceProperties"] = None, identity: Optional["_models.SAPVirtualInstanceIdentity"] = None, ) -> None: ... @@ -3040,7 +3043,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPVirtualInstanceError(_model_base.Model): +class SAPVirtualInstanceError(_Model): """An error response from the Virtual Instance for SAP Workload service. :ivar properties: The Virtual Instance for SAP error body. @@ -3070,7 +3073,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPVirtualInstanceIdentity(_model_base.Model): +class SAPVirtualInstanceIdentity(_Model): """Managed service identity (user assigned identities). :ivar type: The type of managed identity assigned to this resource. Required. Known values are: @@ -3087,7 +3090,7 @@ class SAPVirtualInstanceIdentity(_model_base.Model): ) """The type of managed identity assigned to this resource. Required. Known values are: \"None\" and \"UserAssigned\".""" - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = rest_field( + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] ) """The identities assigned to this resource by the user.""" @@ -3097,7 +3100,7 @@ def __init__( self, *, type: Union[str, "_models.SAPVirtualInstanceIdentityType"], - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, ) -> None: ... @overload @@ -3111,7 +3114,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SAPVirtualInstanceProperties(_model_base.Model): +class SAPVirtualInstanceProperties(_Model): """Defines the Virtual Instance for SAP solutions resource properties. :ivar environment: Defines the environment type - Production/Non Production. Required. Known @@ -3288,10 +3291,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, software_installation_type=SAPSoftwareInstallationType.SERVICE_INITIATED, **kwargs) + super().__init__(*args, **kwargs) + self.software_installation_type = SAPSoftwareInstallationType.SERVICE_INITIATED # type: ignore -class SharedStorageResourceNames(_model_base.Model): +class SharedStorageResourceNames(_Model): """The resource names object for shared storage. :ivar shared_storage_account_name: The full name of the shared storage account. If it is not @@ -3410,10 +3414,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, deployment_type=SAPDeploymentType.SINGLE_SERVER, **kwargs) + super().__init__(*args, **kwargs) + self.deployment_type = SAPDeploymentType.SINGLE_SERVER # type: ignore -class SingleServerCustomResourceNames(_model_base.Model): +class SingleServerCustomResourceNames(_Model): """The resource-names input to specify custom names for underlying azure resources that are part of a single server SAP system. @@ -3425,7 +3430,7 @@ class SingleServerCustomResourceNames(_model_base.Model): ~azure.mgmt.workloadssapvirtualinstance.models.NamingPatternType """ - __mapping__: Dict[str, _model_base.Model] = {} + __mapping__: dict[str, _Model] = {} naming_pattern_type: str = rest_discriminator( name="namingPatternType", visibility=["read", "create", "update", "delete", "query"] ) @@ -3485,7 +3490,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, naming_pattern_type=NamingPatternType.FULL_RESOURCE_NAME, **kwargs) + super().__init__(*args, **kwargs) + self.naming_pattern_type = NamingPatternType.FULL_RESOURCE_NAME # type: ignore class SingleServerRecommendationResult(SAPSizingRecommendationResult, discriminator="SingleServer"): @@ -3518,7 +3524,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, deployment_type=SAPDeploymentType.SINGLE_SERVER, **kwargs) + super().__init__(*args, **kwargs) + self.deployment_type = SAPDeploymentType.SINGLE_SERVER # type: ignore class SkipFileShareConfiguration(FileShareConfiguration, discriminator="Skip"): @@ -3547,17 +3554,18 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, configuration_type=FileShareConfigurationType.SKIP, **kwargs) + super().__init__(*args, **kwargs) + self.configuration_type = FileShareConfigurationType.SKIP # type: ignore -class SshConfiguration(_model_base.Model): +class SshConfiguration(_Model): """SSH configuration for Linux based VMs running on Azure. :ivar public_keys: The list of SSH public keys used to authenticate with linux based VMs. :vartype public_keys: list[~azure.mgmt.workloadssapvirtualinstance.models.SshPublicKey] """ - public_keys: Optional[List["_models.SshPublicKey"]] = rest_field( + public_keys: Optional[list["_models.SshPublicKey"]] = rest_field( name="publicKeys", visibility=["read", "create", "update", "delete", "query"] ) """The list of SSH public keys used to authenticate with linux based VMs.""" @@ -3566,7 +3574,7 @@ class SshConfiguration(_model_base.Model): def __init__( self, *, - public_keys: Optional[List["_models.SshPublicKey"]] = None, + public_keys: Optional[list["_models.SshPublicKey"]] = None, ) -> None: ... @overload @@ -3580,7 +3588,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SshKeyPair(_model_base.Model): +class SshKeyPair(_Model): """The SSH Key-pair used to authenticate with the VM. The key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, see `Create SSH keys on Linux and Mac for Linux VMs in Azure `_. @@ -3617,7 +3625,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SshPublicKey(_model_base.Model): +class SshPublicKey(_Model): """Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. @@ -3652,7 +3660,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StartRequest(_model_base.Model): +class StartRequest(_Model): """Start SAP instance(s) request body. :ivar start_vm: The boolean value indicates whether to start the virtual machines before @@ -3682,7 +3690,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StopRequest(_model_base.Model): +class StopRequest(_Model): """Stop SAP instance(s) request body. :ivar soft_stop_timeout_seconds: This parameter defines how long (in seconds) the soft shutdown @@ -3726,7 +3734,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StorageConfiguration(_model_base.Model): +class StorageConfiguration(_Model): """Gets or sets the storage configuration. :ivar transport_file_share_configuration: The properties of the transport directory attached to @@ -3760,7 +3768,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StorageInformation(_model_base.Model): +class StorageInformation(_Model): """Storage details of all the Storage accounts attached to the VM. For e.g. NFS on AFS Shared Storage. @@ -3772,7 +3780,7 @@ class StorageInformation(_model_base.Model): """Fully qualified resource ID for the storage account.""" -class SystemData(_model_base.Model): +class SystemData(_Model): """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. @@ -3928,10 +3936,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, deployment_type=SAPDeploymentType.THREE_TIER, **kwargs) + super().__init__(*args, **kwargs) + self.deployment_type = SAPDeploymentType.THREE_TIER # type: ignore -class ThreeTierCustomResourceNames(_model_base.Model): +class ThreeTierCustomResourceNames(_Model): """The resource-names input to specify custom names for underlying azure resources that are part of a three tier SAP system. @@ -3944,7 +3953,7 @@ class ThreeTierCustomResourceNames(_model_base.Model): ~azure.mgmt.workloadssapvirtualinstance.models.NamingPatternType """ - __mapping__: Dict[str, _model_base.Model] = {} + __mapping__: dict[str, _Model] = {} naming_pattern_type: str = rest_discriminator( name="namingPatternType", visibility=["read", "create", "update", "delete", "query"] ) @@ -4033,7 +4042,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, naming_pattern_type=NamingPatternType.FULL_RESOURCE_NAME, **kwargs) + super().__init__(*args, **kwargs) + self.naming_pattern_type = NamingPatternType.FULL_RESOURCE_NAME # type: ignore class ThreeTierRecommendationResult(SAPSizingRecommendationResult, discriminator="ThreeTier"): @@ -4101,24 +4111,25 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, deployment_type=SAPDeploymentType.THREE_TIER, **kwargs) + super().__init__(*args, **kwargs) + self.deployment_type = SAPDeploymentType.THREE_TIER # type: ignore -class UpdateSAPApplicationInstanceRequest(_model_base.Model): +class UpdateSAPApplicationInstanceRequest(_Model): """Defines the request body for updating SAP Application Instance. :ivar tags: Gets or sets the Resource tags. :vartype tags: dict[str, str] """ - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Gets or sets the Resource tags.""" @overload def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -4132,21 +4143,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UpdateSAPCentralInstanceRequest(_model_base.Model): +class UpdateSAPCentralInstanceRequest(_Model): """Defines the request body for updating SAP Central Instance. :ivar tags: Gets or sets the Resource tags. :vartype tags: dict[str, str] """ - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Gets or sets the Resource tags.""" @overload def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -4160,21 +4171,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UpdateSAPDatabaseInstanceRequest(_model_base.Model): +class UpdateSAPDatabaseInstanceRequest(_Model): """Defines the request body for updating SAP Database Instance. :ivar tags: Gets or sets the Resource tags. :vartype tags: dict[str, str] """ - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Gets or sets the Resource tags.""" @overload def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -4188,7 +4199,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UpdateSAPVirtualInstanceProperties(_model_base.Model): +class UpdateSAPVirtualInstanceProperties(_Model): """Defines the update request body properties for updating Virtual Instance for SAP. :ivar managed_resources_network_access_type: Specifies the network access configuration for the @@ -4233,7 +4244,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UpdateSAPVirtualInstanceRequest(_model_base.Model): +class UpdateSAPVirtualInstanceRequest(_Model): """Defines the request body for updating Virtual Instance for SAP. :ivar tags: Gets or sets the Resource tags. @@ -4245,7 +4256,7 @@ class UpdateSAPVirtualInstanceRequest(_model_base.Model): ~azure.mgmt.workloadssapvirtualinstance.models.UpdateSAPVirtualInstanceProperties """ - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Gets or sets the Resource tags.""" identity: Optional["_models.SAPVirtualInstanceIdentity"] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -4260,7 +4271,7 @@ class UpdateSAPVirtualInstanceRequest(_model_base.Model): def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, identity: Optional["_models.SAPVirtualInstanceIdentity"] = None, properties: Optional["_models.UpdateSAPVirtualInstanceProperties"] = None, ) -> None: ... @@ -4276,22 +4287,22 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserAssignedIdentity(_model_base.Model): +class UserAssignedIdentity(_Model): """User assigned identity properties. - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str :ivar principal_id: The principal ID of the assigned identity. :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str """ - client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) - """The client ID of the assigned identity.""" principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" -class VirtualMachineConfiguration(_model_base.Model): +class VirtualMachineConfiguration(_Model): """Defines the virtual machine configuration. :ivar vm_size: The virtual machine size. Required. @@ -4333,7 +4344,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VirtualMachineResourceNames(_model_base.Model): +class VirtualMachineResourceNames(_Model): """The resource names object for virtual machine and related resources. :ivar vm_name: The full name for virtual machine. The length of this field can be upto 64 @@ -4373,7 +4384,7 @@ class VirtualMachineResourceNames(_model_base.Model): """The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are less than or equal to 13 characters long. If this value is not provided, vmName will be used as host name.""" - network_interfaces: Optional[List["_models.NetworkInterfaceResourceNames"]] = rest_field( + network_interfaces: Optional[list["_models.NetworkInterfaceResourceNames"]] = rest_field( name="networkInterfaces", visibility=["read", "create", "update", "delete", "query"] ) """The list of network interface name objects for the selected virtual machine. Currently, only @@ -4384,7 +4395,7 @@ class VirtualMachineResourceNames(_model_base.Model): """The full name for OS disk attached to the VM. If this value is not provided, it will be named by ARM as per its default naming standards (prefixed with vm name). There is only one OS disk attached per Virtual Machine.""" - data_disk_names: Optional[Dict[str, List[str]]] = rest_field( + data_disk_names: Optional[dict[str, list[str]]] = rest_field( name="dataDiskNames", visibility=["read", "create", "update", "delete", "query"] ) """The full resource names for virtual machine data disks. This is a dictionary containing list of @@ -4398,9 +4409,9 @@ def __init__( *, vm_name: Optional[str] = None, host_name: Optional[str] = None, - network_interfaces: Optional[List["_models.NetworkInterfaceResourceNames"]] = None, + network_interfaces: Optional[list["_models.NetworkInterfaceResourceNames"]] = None, os_disk_name: Optional[str] = None, - data_disk_names: Optional[Dict[str, List[str]]] = None, + data_disk_names: Optional[dict[str, list[str]]] = None, ) -> None: ... @overload @@ -4437,4 +4448,5 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, os_type=OSType.WINDOWS, **kwargs) + super().__init__(*args, **kwargs) + self.os_type = OSType.WINDOWS # type: ignore diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/models/_patch.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/models/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/models/_patch.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/models/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/operations/_operations.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/operations/_operations.py index eb67ffe0a2a3..3b7402c89eb5 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/operations/_operations.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/operations/_operations.py @@ -6,10 +6,10 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -34,16 +34,13 @@ from .. import models as _models from .._configuration import WorkloadsSapVirtualInstanceMgmtClientConfiguration -from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from .._serialization import Deserializer, Serializer +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, 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]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] +List = list _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -161,12 +158,9 @@ def build_sap_virtual_instances_update_request( # pylint: disable=name-too-long def build_sap_virtual_instances_delete_request( # pylint: disable=name-too-long resource_group_name: str, sap_virtual_instance_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", "2024-09-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}" path_format_arguments = { @@ -180,10 +174,7 @@ def build_sap_virtual_instances_delete_request( # pylint: disable=name-too-long # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_sap_virtual_instances_list_by_resource_group_request( # pylint: disable=name-too-long @@ -533,12 +524,9 @@ def build_sap_central_server_instances_delete_request( # pylint: disable=name-t 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-09-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}" path_format_arguments = { @@ -553,10 +541,7 @@ def build_sap_central_server_instances_delete_request( # pylint: disable=name-t # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_sap_central_server_instances_list_request( # pylint: disable=name-too-long @@ -771,12 +756,9 @@ def build_sap_database_instances_delete_request( # pylint: disable=name-too-lon 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-09-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}" path_format_arguments = { @@ -791,10 +773,7 @@ def build_sap_database_instances_delete_request( # pylint: disable=name-too-lon # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_sap_database_instances_list_request( # pylint: disable=name-too-long @@ -1009,12 +988,9 @@ def build_sap_application_server_instances_delete_request( # pylint: disable=na 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-09-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}" path_format_arguments = { @@ -1029,10 +1005,7 @@ def build_sap_application_server_instances_delete_request( # pylint: disable=na # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_sap_application_server_instances_list_request( # pylint: disable=name-too-long @@ -1145,7 +1118,7 @@ class Operations: :attr:`operations` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: WorkloadsSapVirtualInstanceMgmtClientConfiguration = ( @@ -1155,7 +1128,7 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation @@ -1201,7 +1174,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1214,7 +1190,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1230,7 +1209,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1248,7 +1230,7 @@ class SAPVirtualInstancesOperations: :attr:`sap_virtual_instances` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: WorkloadsSapVirtualInstanceMgmtClientConfiguration = ( @@ -1299,6 +1281,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1313,11 +1296,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPVirtualInstance, response.json()) @@ -1369,6 +1355,7 @@ def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1382,7 +1369,10 @@ def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1392,7 +1382,7 @@ def _create_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1610,6 +1600,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1623,7 +1614,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1631,7 +1625,7 @@ def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1840,6 +1834,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1853,7 +1848,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1861,7 +1859,7 @@ def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1928,7 +1926,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.SAPVirtualInstance"]: + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.SAPVirtualInstance"]: """Gets all Virtual Instances for SAP solutions resources in a Resource Group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -1980,7 +1980,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1993,7 +1996,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SAPVirtualInstance], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SAPVirtualInstance], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2009,7 +2015,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2017,7 +2026,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SAPVirtualInstance"]: + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.SAPVirtualInstance"]: """Gets all Virtual Instances for SAP solutions resources in a Subscription. :return: An iterator like instance of SAPVirtualInstance @@ -2065,7 +2074,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2078,7 +2090,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SAPVirtualInstance], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SAPVirtualInstance], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2094,7 +2109,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2120,9 +2138,10 @@ def _start_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -2147,6 +2166,7 @@ def _start_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2160,7 +2180,10 @@ def _start_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2168,7 +2191,7 @@ def _start_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2301,6 +2324,7 @@ def begin_start( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2320,14 +2344,10 @@ def begin_start( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -2372,9 +2392,10 @@ def _stop_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -2399,6 +2420,7 @@ def _stop_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2412,7 +2434,10 @@ def _stop_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2420,7 +2445,7 @@ def _stop_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2553,6 +2578,7 @@ def begin_stop( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2572,14 +2598,10 @@ def begin_stop( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -2719,6 +2741,7 @@ def get_sizing_recommendations( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2733,11 +2756,14 @@ def get_sizing_recommendations( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPSizingRecommendationResult, response.json()) @@ -2860,6 +2886,7 @@ def get_sap_supported_sku( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2874,11 +2901,14 @@ def get_sap_supported_sku( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPSupportedResourceSkusResult, response.json()) @@ -3001,6 +3031,7 @@ def get_disk_configurations( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3015,11 +3046,14 @@ def get_disk_configurations( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPDiskConfigurationsResult, response.json()) @@ -3142,6 +3176,7 @@ def get_availability_zone_details( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3156,11 +3191,14 @@ def get_availability_zone_details( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPAvailabilityZoneDetailsResult, response.json()) @@ -3180,7 +3218,7 @@ class SAPCentralServerInstancesOperations: :attr:`sap_central_server_instances` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: WorkloadsSapVirtualInstanceMgmtClientConfiguration = ( @@ -3236,6 +3274,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3250,11 +3289,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPCentralServerInstance, response.json()) @@ -3308,6 +3350,7 @@ def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3321,7 +3364,10 @@ def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3331,7 +3377,7 @@ def _create_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3698,6 +3744,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3712,11 +3759,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPCentralServerInstance, response.json()) @@ -3755,6 +3805,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3768,7 +3819,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3776,7 +3830,7 @@ def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3853,7 +3907,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list( self, resource_group_name: str, sap_virtual_instance_name: str, **kwargs: Any - ) -> Iterable["_models.SAPCentralServerInstance"]: + ) -> ItemPaged["_models.SAPCentralServerInstance"]: """Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. @@ -3910,7 +3964,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3923,7 +3980,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SAPCentralServerInstance], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SAPCentralServerInstance], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3939,7 +3999,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3966,9 +4029,10 @@ def _start_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -3994,6 +4058,7 @@ def _start_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4007,7 +4072,10 @@ def _start_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4015,7 +4083,7 @@ def _start_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4157,6 +4225,7 @@ def begin_start( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4177,14 +4246,10 @@ def begin_start( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -4230,9 +4295,10 @@ def _stop_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -4258,6 +4324,7 @@ def _stop_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4271,7 +4338,10 @@ def _stop_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4279,7 +4349,7 @@ def _stop_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4421,6 +4491,7 @@ def begin_stop( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4441,14 +4512,10 @@ def begin_stop( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -4485,7 +4552,7 @@ class SAPDatabaseInstancesOperations: :attr:`sap_database_instances` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: WorkloadsSapVirtualInstanceMgmtClientConfiguration = ( @@ -4540,6 +4607,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4554,11 +4622,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPDatabaseInstance, response.json()) @@ -4612,6 +4683,7 @@ def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4625,7 +4697,10 @@ def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4635,7 +4710,7 @@ def _create_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4998,6 +5073,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5012,11 +5088,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPDatabaseInstance, response.json()) @@ -5055,6 +5134,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5068,7 +5148,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5076,7 +5159,7 @@ def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5152,7 +5235,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list( self, resource_group_name: str, sap_virtual_instance_name: str, **kwargs: Any - ) -> Iterable["_models.SAPDatabaseInstance"]: + ) -> ItemPaged["_models.SAPDatabaseInstance"]: """Lists the Database resources associated with a Virtual Instance for SAP solutions resource. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -5208,7 +5291,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5221,7 +5307,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SAPDatabaseInstance], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SAPDatabaseInstance], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5237,7 +5326,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -5264,9 +5356,10 @@ def _start_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -5292,6 +5385,7 @@ def _start_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5305,7 +5399,10 @@ def _start_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5313,7 +5410,7 @@ def _start_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5455,6 +5552,7 @@ def begin_start( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5475,14 +5573,10 @@ def begin_start( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -5528,9 +5622,10 @@ def _stop_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -5556,6 +5651,7 @@ def _stop_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5569,7 +5665,10 @@ def _stop_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5577,7 +5676,7 @@ def _stop_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5719,6 +5818,7 @@ def begin_stop( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5739,14 +5839,10 @@ def begin_stop( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -5783,7 +5879,7 @@ class SAPApplicationServerInstancesOperations: :attr:`sap_application_server_instances` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: WorkloadsSapVirtualInstanceMgmtClientConfiguration = ( @@ -5840,6 +5936,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5854,11 +5951,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPApplicationServerInstance, response.json()) @@ -5912,6 +6012,7 @@ def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5925,7 +6026,10 @@ def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5935,7 +6039,7 @@ def _create_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6298,6 +6402,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6312,11 +6417,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SAPApplicationServerInstance, response.json()) @@ -6355,6 +6463,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6368,7 +6477,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -6376,7 +6488,7 @@ def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6451,7 +6563,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list( self, resource_group_name: str, sap_virtual_instance_name: str, **kwargs: Any - ) -> Iterable["_models.SAPApplicationServerInstance"]: + ) -> ItemPaged["_models.SAPApplicationServerInstance"]: """Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. @@ -6508,7 +6620,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6521,7 +6636,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SAPApplicationServerInstance], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SAPApplicationServerInstance], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -6537,7 +6655,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -6564,9 +6685,10 @@ def _start_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -6592,6 +6714,7 @@ def _start_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6605,7 +6728,10 @@ def _start_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -6613,7 +6739,7 @@ def _start_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6755,6 +6881,7 @@ def begin_start( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -6775,14 +6902,10 @@ def begin_start( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -6828,9 +6951,10 @@ def _stop_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None if isinstance(body, (IOBase, bytes)): _content = body @@ -6856,6 +6980,7 @@ def _stop_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6869,7 +6994,10 @@ def _stop_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -6877,7 +7005,7 @@ def _stop_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -7019,6 +7147,7 @@ def begin_stop( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -7039,14 +7168,10 @@ def begin_stop( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/operations/_patch.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/operations/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/operations/_patch.py +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/operations/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_availability_zone_details_eastus.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_availability_zone_details_eastus.py deleted file mode 100644 index 4f6c6ee2658d..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_availability_zone_details_eastus.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.workloadssapvirtualinstance import WorkloadsSapVirtualInstanceMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloadssapvirtualinstance -# USAGE - python sap_virtual_instances_invoke_availability_zone_details_eastus.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 = WorkloadsSapVirtualInstanceMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.sap_virtual_instances.get_availability_zone_details( - location="eastus", - body={"appLocation": "eastus", "databaseType": "HANA", "sapProduct": "S4HANA"}, - ) - print(response) - - -# x-ms-original-file: 2024-09-01/SapVirtualInstances_InvokeAvailabilityZoneDetails_eastus.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_availability_zone_details_northeurope.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_availability_zone_details_northeurope.py deleted file mode 100644 index b5aafbb4b875..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_availability_zone_details_northeurope.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.workloadssapvirtualinstance import WorkloadsSapVirtualInstanceMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloadssapvirtualinstance -# USAGE - python sap_virtual_instances_invoke_availability_zone_details_northeurope.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 = WorkloadsSapVirtualInstanceMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.sap_virtual_instances.get_availability_zone_details( - location="northeurope", - body={"appLocation": "northeurope", "databaseType": "HANA", "sapProduct": "S4HANA"}, - ) - print(response) - - -# x-ms-original-file: 2024-09-01/SapVirtualInstances_InvokeAvailabilityZoneDetails_northeurope.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_disk_configurations_non_prod.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_disk_configurations_non_prod.py deleted file mode 100644 index b4d549bc410b..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_disk_configurations_non_prod.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.workloadssapvirtualinstance import WorkloadsSapVirtualInstanceMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloadssapvirtualinstance -# USAGE - python sap_virtual_instances_invoke_disk_configurations_non_prod.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 = WorkloadsSapVirtualInstanceMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.sap_virtual_instances.get_disk_configurations( - location="centralus", - body={ - "appLocation": "eastus", - "databaseType": "HANA", - "dbVmSku": "Standard_M32ts", - "deploymentType": "ThreeTier", - "environment": "NonProd", - "sapProduct": "S4HANA", - }, - ) - print(response) - - -# x-ms-original-file: 2024-09-01/SapVirtualInstances_InvokeDiskConfigurations_NonProd.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_disk_configurations_prod.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_disk_configurations_prod.py deleted file mode 100644 index 7fa1556f07cc..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_disk_configurations_prod.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.workloadssapvirtualinstance import WorkloadsSapVirtualInstanceMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloadssapvirtualinstance -# USAGE - python sap_virtual_instances_invoke_disk_configurations_prod.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 = WorkloadsSapVirtualInstanceMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.sap_virtual_instances.get_disk_configurations( - location="centralus", - body={ - "appLocation": "eastus", - "databaseType": "HANA", - "dbVmSku": "Standard_M32ts", - "deploymentType": "ThreeTier", - "environment": "Prod", - "sapProduct": "S4HANA", - }, - ) - print(response) - - -# x-ms-original-file: 2024-09-01/SapVirtualInstances_InvokeDiskConfigurations_Prod.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sap_supported_sku_distributed.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sap_supported_sku_distributed.py deleted file mode 100644 index 7174302e6835..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sap_supported_sku_distributed.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.workloadssapvirtualinstance import WorkloadsSapVirtualInstanceMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloadssapvirtualinstance -# USAGE - python sap_virtual_instances_invoke_sap_supported_sku_distributed.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 = WorkloadsSapVirtualInstanceMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.sap_virtual_instances.get_sap_supported_sku( - location="centralus", - body={ - "appLocation": "eastus", - "databaseType": "HANA", - "deploymentType": "ThreeTier", - "environment": "Prod", - "sapProduct": "S4HANA", - }, - ) - print(response) - - -# x-ms-original-file: 2024-09-01/SapVirtualInstances_InvokeSapSupportedSku_Distributed.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sap_supported_sku_distributed_ha_av_set.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sap_supported_sku_distributed_ha_av_set.py deleted file mode 100644 index 662b3432a65d..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sap_supported_sku_distributed_ha_av_set.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.workloadssapvirtualinstance import WorkloadsSapVirtualInstanceMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloadssapvirtualinstance -# USAGE - python sap_virtual_instances_invoke_sap_supported_sku_distributed_ha_av_set.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 = WorkloadsSapVirtualInstanceMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.sap_virtual_instances.get_sap_supported_sku( - location="centralus", - body={ - "appLocation": "eastus", - "databaseType": "HANA", - "deploymentType": "ThreeTier", - "environment": "Prod", - "highAvailabilityType": "AvailabilitySet", - "sapProduct": "S4HANA", - }, - ) - print(response) - - -# x-ms-original-file: 2024-09-01/SapVirtualInstances_InvokeSapSupportedSku_DistributedHA_AvSet.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sap_supported_sku_distributed_ha_av_zone.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sap_supported_sku_distributed_ha_av_zone.py deleted file mode 100644 index 57311bd4e784..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sap_supported_sku_distributed_ha_av_zone.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.workloadssapvirtualinstance import WorkloadsSapVirtualInstanceMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloadssapvirtualinstance -# USAGE - python sap_virtual_instances_invoke_sap_supported_sku_distributed_ha_av_zone.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 = WorkloadsSapVirtualInstanceMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.sap_virtual_instances.get_sap_supported_sku( - location="centralus", - body={ - "appLocation": "eastus", - "databaseType": "HANA", - "deploymentType": "ThreeTier", - "environment": "Prod", - "highAvailabilityType": "AvailabilityZone", - "sapProduct": "S4HANA", - }, - ) - print(response) - - -# x-ms-original-file: 2024-09-01/SapVirtualInstances_InvokeSapSupportedSku_DistributedHA_AvZone.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sap_supported_sku_single_server.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sap_supported_sku_single_server.py deleted file mode 100644 index fd2d1217aca8..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sap_supported_sku_single_server.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.workloadssapvirtualinstance import WorkloadsSapVirtualInstanceMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloadssapvirtualinstance -# USAGE - python sap_virtual_instances_invoke_sap_supported_sku_single_server.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 = WorkloadsSapVirtualInstanceMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.sap_virtual_instances.get_sap_supported_sku( - location="centralus", - body={ - "appLocation": "eastus", - "databaseType": "HANA", - "deploymentType": "SingleServer", - "environment": "NonProd", - "sapProduct": "S4HANA", - }, - ) - print(response) - - -# x-ms-original-file: 2024-09-01/SapVirtualInstances_InvokeSapSupportedSku_SingleServer.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sizing_recommendations_s4_hana_distributed.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sizing_recommendations_s4_hana_distributed.py deleted file mode 100644 index 3d494d59d44d..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sizing_recommendations_s4_hana_distributed.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.workloadssapvirtualinstance import WorkloadsSapVirtualInstanceMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloadssapvirtualinstance -# USAGE - python sap_virtual_instances_invoke_sizing_recommendations_s4_hana_distributed.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 = WorkloadsSapVirtualInstanceMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.sap_virtual_instances.get_sizing_recommendations( - location="centralus", - body={ - "appLocation": "eastus", - "databaseType": "HANA", - "dbMemory": 1024, - "dbScaleMethod": "ScaleUp", - "deploymentType": "ThreeTier", - "environment": "Prod", - "sapProduct": "S4HANA", - "saps": 20000, - }, - ) - print(response) - - -# x-ms-original-file: 2024-09-01/SapVirtualInstances_InvokeSizingRecommendations_S4HANA_Distributed.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sizing_recommendations_s4_hana_ha_av_set.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sizing_recommendations_s4_hana_ha_av_set.py deleted file mode 100644 index 487ab59a6d89..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sizing_recommendations_s4_hana_ha_av_set.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.workloadssapvirtualinstance import WorkloadsSapVirtualInstanceMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloadssapvirtualinstance -# USAGE - python sap_virtual_instances_invoke_sizing_recommendations_s4_hana_ha_av_set.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 = WorkloadsSapVirtualInstanceMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.sap_virtual_instances.get_sizing_recommendations( - location="centralus", - body={ - "appLocation": "eastus", - "databaseType": "HANA", - "dbMemory": 1024, - "dbScaleMethod": "ScaleUp", - "deploymentType": "ThreeTier", - "environment": "Prod", - "highAvailabilityType": "AvailabilitySet", - "sapProduct": "S4HANA", - "saps": 75000, - }, - ) - print(response) - - -# x-ms-original-file: 2024-09-01/SapVirtualInstances_InvokeSizingRecommendations_S4HANA_HA_AvSet.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sizing_recommendations_s4_hana_ha_av_zone.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sizing_recommendations_s4_hana_ha_av_zone.py deleted file mode 100644 index 5eae9be4146d..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sizing_recommendations_s4_hana_ha_av_zone.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.workloadssapvirtualinstance import WorkloadsSapVirtualInstanceMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloadssapvirtualinstance -# USAGE - python sap_virtual_instances_invoke_sizing_recommendations_s4_hana_ha_av_zone.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 = WorkloadsSapVirtualInstanceMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.sap_virtual_instances.get_sizing_recommendations( - location="centralus", - body={ - "appLocation": "eastus", - "databaseType": "HANA", - "dbMemory": 1024, - "dbScaleMethod": "ScaleUp", - "deploymentType": "ThreeTier", - "environment": "Prod", - "highAvailabilityType": "AvailabilityZone", - "sapProduct": "S4HANA", - "saps": 75000, - }, - ) - print(response) - - -# x-ms-original-file: 2024-09-01/SapVirtualInstances_InvokeSizingRecommendations_S4HANA_HA_AvZone.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sizing_recommendations_s4_hana_single_server.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sizing_recommendations_s4_hana_single_server.py deleted file mode 100644 index 804e349172c0..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/generated_samples/sap_virtual_instances_invoke_sizing_recommendations_s4_hana_single_server.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.workloadssapvirtualinstance import WorkloadsSapVirtualInstanceMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloadssapvirtualinstance -# USAGE - python sap_virtual_instances_invoke_sizing_recommendations_s4_hana_single_server.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 = WorkloadsSapVirtualInstanceMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.sap_virtual_instances.get_sizing_recommendations( - location="centralus", - body={ - "appLocation": "eastus", - "databaseType": "HANA", - "dbMemory": 2000, - "dbScaleMethod": "ScaleUp", - "deploymentType": "SingleServer", - "environment": "NonProd", - "sapProduct": "S4HANA", - "saps": 60000, - }, - ) - print(response) - - -# x-ms-original-file: 2024-09-01/SapVirtualInstances_InvokeSizingRecommendations_S4HANA_SingleServer.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/pyproject.toml b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/pyproject.toml index 540da07d41af..c184c33ad143 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/pyproject.toml +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/pyproject.toml @@ -1,6 +1,87 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-workloadssapvirtualinstance" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Workloadssapvirtualinstance Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", +] +requires-python = ">=3.10" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.workloadssapvirtualinstance._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + [tool.azure-sdk-build] breaking = false mypy = false pyright = false type_check_samples = false verifytypes = false + +[packaging] +package_name = "azure-mgmt-workloadssapvirtualinstance" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Workloadssapvirtualinstance Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +exclude_folders = "" +title = "WorkloadsSapVirtualInstanceMgmtClient" diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/sdk_packaging.toml b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/sdk_packaging.toml deleted file mode 100644 index f0c65b1c0b4b..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/sdk_packaging.toml +++ /dev/null @@ -1,12 +0,0 @@ -[packaging] -package_name = "azure-mgmt-workloadssapvirtualinstance" -package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "Workloadssapvirtualinstance Management" -package_doc_id = "" -is_stable = true -is_arm = true -need_msrestazure = false -need_azuremgmtcore = true -sample_link = "" -exclude_folders = "" -title = "WorkloadsSapVirtualInstanceMgmtClient" diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/setup.py b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/setup.py deleted file mode 100644 index bad35d089fb8..000000000000 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/setup.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -import re -import os.path -from io import open -from setuptools import find_packages, setup - -# Change the PACKAGE_NAME only to change folder and different name -PACKAGE_NAME = "azure-mgmt-workloadssapvirtualinstance" -PACKAGE_PPRINT_NAME = "Workloadssapvirtualinstance Management" - -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") -# a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace("-", ".") - -# 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"), - "r", -) as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - -with open("README.md", encoding="utf-8") as f: - readme = f.read() -with open("CHANGELOG.md", encoding="utf-8") as f: - changelog = f.read() - -setup( - name=PACKAGE_NAME, - version=version, - description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), - long_description=readme + "\n\n" + changelog, - long_description_content_type="text/markdown", - license="MIT License", - author="Microsoft Corporation", - author_email="azpysdkhelp@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python", - keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - packages=find_packages( - exclude=[ - "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.mgmt", - ] - ), - include_package_data=True, - package_data={ - "pytyped": ["py.typed"], - }, - install_requires=[ - "isodate>=0.6.1", - "typing-extensions>=4.6.0", - "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", - ], - python_requires=">=3.8", -) diff --git a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/tsp-location.yaml b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/tsp-location.yaml index 775ea66b2935..99fa3179e3c8 100644 --- a/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/tsp-location.yaml +++ b/sdk/workloads/azure-mgmt-workloadssapvirtualinstance/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/workloads/Workloads.SAPVirtualInstance.Management -commit: 0d182673b42de227bc01c0e4f04932b6c074f5ce +commit: b373ded4a6c77a9f541ca8f020fd2072db632751 repo: Azure/azure-rest-api-specs additionalDirectories: