From 2e767b4e1490fc9abe1a8c72de6a8247dad243bb Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 10 Mar 2026 21:05:25 +0000 Subject: [PATCH] Configurations: 'specification/standbypool/StandbyPool.Management/tspconfig.yaml', API Version: 2025-10-01, SDK Release Type: stable, and CommitSHA: '856e8ce58dbf26fda36a11548a07974d1afa3814' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5989681 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../azure-mgmt-standbypool/CHANGELOG.md | 10 + .../azure-mgmt-standbypool/MANIFEST.in | 9 +- .../azure-mgmt-standbypool/_meta.json | 6 - .../azure-mgmt-standbypool/_metadata.json | 10 + .../apiview-properties.json | 58 ++-- .../azure-mgmt-standbypool/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure/mgmt/standbypool/_client.py | 36 ++- .../azure/mgmt/standbypool/_configuration.py | 15 +- .../azure/mgmt/standbypool/_patch.py | 4 +- .../azure/mgmt/standbypool/_utils/__init__.py | 6 + .../{_model_base.py => _utils/model_base.py} | 201 +++++++++++--- .../serialization.py} | 43 +-- .../azure/mgmt/standbypool/_validation.py | 20 +- .../azure/mgmt/standbypool/_version.py | 2 +- .../azure/mgmt/standbypool/aio/_client.py | 38 ++- .../mgmt/standbypool/aio/_configuration.py | 15 +- .../azure/mgmt/standbypool/aio/_patch.py | 4 +- .../standbypool/aio/operations/_operations.py | 193 +++++++++---- .../mgmt/standbypool/aio/operations/_patch.py | 4 +- .../azure/mgmt/standbypool/models/__init__.py | 2 + .../azure/mgmt/standbypool/models/_models.py | 181 +++++++----- .../azure/mgmt/standbypool/models/_patch.py | 4 +- .../standbypool/operations/_operations.py | 259 ++++++++++++------ .../mgmt/standbypool/operations/_patch.py | 4 +- .../generated_samples/operations_list.py | 2 +- ..._container_group_pool_runtime_views_get.py | 2 +- ...pool_runtime_views_list_by_standby_pool.py | 2 +- ..._container_group_pools_create_or_update.py | 8 +- .../standby_container_group_pools_delete.py | 2 +- .../standby_container_group_pools_get.py | 2 +- ...iner_group_pools_list_by_resource_group.py | 2 +- ...tainer_group_pools_list_by_subscription.py | 2 +- .../standby_container_group_pools_update.py | 8 +- ..._virtual_machine_pool_runtime_views_get.py | 2 +- ...pool_runtime_views_list_by_standby_pool.py | 2 +- ..._virtual_machine_pools_create_or_update.py | 9 +- .../standby_virtual_machine_pools_delete.py | 2 +- .../standby_virtual_machine_pools_get.py | 2 +- ...al_machine_pools_list_by_resource_group.py | 2 +- ...tual_machine_pools_list_by_subscription.py | 2 +- .../standby_virtual_machine_pools_update.py | 9 +- .../standby_virtual_machines_get.py | 2 +- ...y_standby_virtual_machine_pool_resource.py | 2 +- ...tandby_container_group_pools_operations.py | 12 +- ..._container_group_pools_operations_async.py | 12 +- ...tandby_virtual_machine_pools_operations.py | 14 +- ..._virtual_machine_pools_operations_async.py | 14 +- .../azure-mgmt-standbypool/pyproject.toml | 82 ++++++ .../azure-mgmt-standbypool/sdk_packaging.toml | 12 - .../azure-mgmt-standbypool/setup.py | 82 ------ .../azure-mgmt-standbypool/tsp-location.yaml | 2 +- 52 files changed, 960 insertions(+), 462 deletions(-) delete mode 100644 sdk/standbypool/azure-mgmt-standbypool/_meta.json create mode 100644 sdk/standbypool/azure-mgmt-standbypool/_metadata.json create mode 100644 sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_utils/__init__.py rename sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/{_model_base.py => _utils/model_base.py} (84%) rename sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/{_serialization.py => _utils/serialization.py} (98%) delete mode 100644 sdk/standbypool/azure-mgmt-standbypool/sdk_packaging.toml delete mode 100644 sdk/standbypool/azure-mgmt-standbypool/setup.py diff --git a/sdk/standbypool/azure-mgmt-standbypool/CHANGELOG.md b/sdk/standbypool/azure-mgmt-standbypool/CHANGELOG.md index 7784e92583e7..b690f8db8422 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/CHANGELOG.md +++ b/sdk/standbypool/azure-mgmt-standbypool/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 2.1.0 (2026-03-10) + +### Features Added + + - Model `StandbyPoolMgmtClient` added parameter `cloud_setting` in method `__init__` + - Model `StandbyContainerGroupPoolElasticityProfile` added property `dynamic_sizing` + - Model `StandbyVirtualMachinePoolElasticityProfile` added property `post_provisioning_delay` + - Model `StandbyVirtualMachinePoolElasticityProfile` added property `dynamic_sizing` + - Added model `DynamicSizing` + ## 2.0.0 (2025-04-21) ### Features Added diff --git a/sdk/standbypool/azure-mgmt-standbypool/MANIFEST.in b/sdk/standbypool/azure-mgmt-standbypool/MANIFEST.in index 071b060d0c1f..fac14a378c3f 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/MANIFEST.in +++ b/sdk/standbypool/azure-mgmt-standbypool/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/standbypool/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/standbypool/azure-mgmt-standbypool/_meta.json b/sdk/standbypool/azure-mgmt-standbypool/_meta.json deleted file mode 100644 index 6b28f70cbce3..000000000000 --- a/sdk/standbypool/azure-mgmt-standbypool/_meta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "commit": "525c8c6cebc5837606cb14cfcb0afdb4f2f17fa9", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "typespec_src": "specification/standbypool/StandbyPool.Management", - "@azure-tools/typespec-python": "0.42.3" -} \ No newline at end of file diff --git a/sdk/standbypool/azure-mgmt-standbypool/_metadata.json b/sdk/standbypool/azure-mgmt-standbypool/_metadata.json new file mode 100644 index 000000000000..ed504a2d22f4 --- /dev/null +++ b/sdk/standbypool/azure-mgmt-standbypool/_metadata.json @@ -0,0 +1,10 @@ +{ + "apiVersion": "2025-10-01", + "apiVersions": { + "Microsoft.StandbyPool": "2025-10-01" + }, + "commit": "856e8ce58dbf26fda36a11548a07974d1afa3814", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/standbypool/StandbyPool.Management", + "emitterVersion": "0.60.2" +} \ No newline at end of file diff --git a/sdk/standbypool/azure-mgmt-standbypool/apiview-properties.json b/sdk/standbypool/azure-mgmt-standbypool/apiview-properties.json index 58f8c68ef5d8..f675edd3705f 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/apiview-properties.json +++ b/sdk/standbypool/azure-mgmt-standbypool/apiview-properties.json @@ -4,6 +4,7 @@ "azure.mgmt.standbypool.models.ContainerGroupInstanceCountSummary": "Microsoft.StandbyPool.ContainerGroupInstanceCountSummary", "azure.mgmt.standbypool.models.ContainerGroupProfile": "Microsoft.StandbyPool.ContainerGroupProfile", "azure.mgmt.standbypool.models.ContainerGroupProperties": "Microsoft.StandbyPool.ContainerGroupProperties", + "azure.mgmt.standbypool.models.DynamicSizing": "Microsoft.StandbyPool.DynamicSizing", "azure.mgmt.standbypool.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", "azure.mgmt.standbypool.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", "azure.mgmt.standbypool.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", @@ -47,24 +48,43 @@ "azure.mgmt.standbypool.models.HealthStateCode": "Microsoft.StandbyPool.HealthStateCode", "azure.mgmt.standbypool.models.RefillPolicy": "Microsoft.StandbyPool.RefillPolicy", "azure.mgmt.standbypool.models.PoolContainerGroupState": "Microsoft.StandbyPool.PoolContainerGroupState", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.operations.list": "Azure.ResourceManager.Operations.list", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pools.get": "Microsoft.StandbyPool.StandbyVirtualMachinePools.get", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pools.begin_create_or_update": "Microsoft.StandbyPool.StandbyVirtualMachinePools.createOrUpdate", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pools.begin_delete": "Microsoft.StandbyPool.StandbyVirtualMachinePools.delete", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pools.update": "Microsoft.StandbyPool.StandbyVirtualMachinePools.update", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pools.list_by_resource_group": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listByResourceGroup", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pools.list_by_subscription": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listBySubscription", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machines.get": "Microsoft.StandbyPool.StandbyVirtualMachines.get", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machines.list_by_standby_virtual_machine_pool_resource": "Microsoft.StandbyPool.StandbyVirtualMachines.listByStandbyVirtualMachinePoolResource", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pool_runtime_views.get": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.get", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_virtual_machine_pool_runtime_views.list_by_standby_pool": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.listByStandbyPool", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pools.get": "Microsoft.StandbyPool.StandbyContainerGroupPools.get", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pools.begin_create_or_update": "Microsoft.StandbyPool.StandbyContainerGroupPools.createOrUpdate", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pools.begin_delete": "Microsoft.StandbyPool.StandbyContainerGroupPools.delete", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pools.update": "Microsoft.StandbyPool.StandbyContainerGroupPools.update", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pools.list_by_resource_group": "Microsoft.StandbyPool.StandbyContainerGroupPools.listByResourceGroup", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pools.list_by_subscription": "Microsoft.StandbyPool.StandbyContainerGroupPools.listBySubscription", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pool_runtime_views.get": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.get", - "azure.mgmt.standbypool.StandbyPoolMgmtClient.standby_container_group_pool_runtime_views.list_by_standby_pool": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.listByStandbyPool" + "azure.mgmt.standbypool.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.standbypool.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.standbypool.operations.StandbyVirtualMachinePoolsOperations.get": "Microsoft.StandbyPool.StandbyVirtualMachinePools.get", + "azure.mgmt.standbypool.aio.operations.StandbyVirtualMachinePoolsOperations.get": "Microsoft.StandbyPool.StandbyVirtualMachinePools.get", + "azure.mgmt.standbypool.operations.StandbyVirtualMachinePoolsOperations.begin_create_or_update": "Microsoft.StandbyPool.StandbyVirtualMachinePools.createOrUpdate", + "azure.mgmt.standbypool.aio.operations.StandbyVirtualMachinePoolsOperations.begin_create_or_update": "Microsoft.StandbyPool.StandbyVirtualMachinePools.createOrUpdate", + "azure.mgmt.standbypool.operations.StandbyVirtualMachinePoolsOperations.begin_delete": "Microsoft.StandbyPool.StandbyVirtualMachinePools.delete", + "azure.mgmt.standbypool.aio.operations.StandbyVirtualMachinePoolsOperations.begin_delete": "Microsoft.StandbyPool.StandbyVirtualMachinePools.delete", + "azure.mgmt.standbypool.operations.StandbyVirtualMachinePoolsOperations.update": "Microsoft.StandbyPool.StandbyVirtualMachinePools.update", + "azure.mgmt.standbypool.aio.operations.StandbyVirtualMachinePoolsOperations.update": "Microsoft.StandbyPool.StandbyVirtualMachinePools.update", + "azure.mgmt.standbypool.operations.StandbyVirtualMachinePoolsOperations.list_by_resource_group": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listByResourceGroup", + "azure.mgmt.standbypool.aio.operations.StandbyVirtualMachinePoolsOperations.list_by_resource_group": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listByResourceGroup", + "azure.mgmt.standbypool.operations.StandbyVirtualMachinePoolsOperations.list_by_subscription": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listBySubscription", + "azure.mgmt.standbypool.aio.operations.StandbyVirtualMachinePoolsOperations.list_by_subscription": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listBySubscription", + "azure.mgmt.standbypool.operations.StandbyVirtualMachinesOperations.get": "Microsoft.StandbyPool.StandbyVirtualMachines.get", + "azure.mgmt.standbypool.aio.operations.StandbyVirtualMachinesOperations.get": "Microsoft.StandbyPool.StandbyVirtualMachines.get", + "azure.mgmt.standbypool.operations.StandbyVirtualMachinesOperations.list_by_standby_virtual_machine_pool_resource": "Microsoft.StandbyPool.StandbyVirtualMachines.listByStandbyVirtualMachinePoolResource", + "azure.mgmt.standbypool.aio.operations.StandbyVirtualMachinesOperations.list_by_standby_virtual_machine_pool_resource": "Microsoft.StandbyPool.StandbyVirtualMachines.listByStandbyVirtualMachinePoolResource", + "azure.mgmt.standbypool.operations.StandbyVirtualMachinePoolRuntimeViewsOperations.get": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.get", + "azure.mgmt.standbypool.aio.operations.StandbyVirtualMachinePoolRuntimeViewsOperations.get": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.get", + "azure.mgmt.standbypool.operations.StandbyVirtualMachinePoolRuntimeViewsOperations.list_by_standby_pool": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.listByStandbyPool", + "azure.mgmt.standbypool.aio.operations.StandbyVirtualMachinePoolRuntimeViewsOperations.list_by_standby_pool": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.listByStandbyPool", + "azure.mgmt.standbypool.operations.StandbyContainerGroupPoolsOperations.get": "Microsoft.StandbyPool.StandbyContainerGroupPools.get", + "azure.mgmt.standbypool.aio.operations.StandbyContainerGroupPoolsOperations.get": "Microsoft.StandbyPool.StandbyContainerGroupPools.get", + "azure.mgmt.standbypool.operations.StandbyContainerGroupPoolsOperations.begin_create_or_update": "Microsoft.StandbyPool.StandbyContainerGroupPools.createOrUpdate", + "azure.mgmt.standbypool.aio.operations.StandbyContainerGroupPoolsOperations.begin_create_or_update": "Microsoft.StandbyPool.StandbyContainerGroupPools.createOrUpdate", + "azure.mgmt.standbypool.operations.StandbyContainerGroupPoolsOperations.begin_delete": "Microsoft.StandbyPool.StandbyContainerGroupPools.delete", + "azure.mgmt.standbypool.aio.operations.StandbyContainerGroupPoolsOperations.begin_delete": "Microsoft.StandbyPool.StandbyContainerGroupPools.delete", + "azure.mgmt.standbypool.operations.StandbyContainerGroupPoolsOperations.update": "Microsoft.StandbyPool.StandbyContainerGroupPools.update", + "azure.mgmt.standbypool.aio.operations.StandbyContainerGroupPoolsOperations.update": "Microsoft.StandbyPool.StandbyContainerGroupPools.update", + "azure.mgmt.standbypool.operations.StandbyContainerGroupPoolsOperations.list_by_resource_group": "Microsoft.StandbyPool.StandbyContainerGroupPools.listByResourceGroup", + "azure.mgmt.standbypool.aio.operations.StandbyContainerGroupPoolsOperations.list_by_resource_group": "Microsoft.StandbyPool.StandbyContainerGroupPools.listByResourceGroup", + "azure.mgmt.standbypool.operations.StandbyContainerGroupPoolsOperations.list_by_subscription": "Microsoft.StandbyPool.StandbyContainerGroupPools.listBySubscription", + "azure.mgmt.standbypool.aio.operations.StandbyContainerGroupPoolsOperations.list_by_subscription": "Microsoft.StandbyPool.StandbyContainerGroupPools.listBySubscription", + "azure.mgmt.standbypool.operations.StandbyContainerGroupPoolRuntimeViewsOperations.get": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.get", + "azure.mgmt.standbypool.aio.operations.StandbyContainerGroupPoolRuntimeViewsOperations.get": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.get", + "azure.mgmt.standbypool.operations.StandbyContainerGroupPoolRuntimeViewsOperations.list_by_standby_pool": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.listByStandbyPool", + "azure.mgmt.standbypool.aio.operations.StandbyContainerGroupPoolRuntimeViewsOperations.list_by_standby_pool": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.listByStandbyPool" } } \ No newline at end of file diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/__init__.py +++ b/sdk/standbypool/azure-mgmt-standbypool/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/standbypool/azure-mgmt-standbypool/azure/mgmt/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/__init__.py +++ b/sdk/standbypool/azure-mgmt-standbypool/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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_client.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_client.py index 838d5a06be96..c8c2aa9bd4bf 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_client.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_client.py @@ -7,16 +7,18 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING, cast from typing_extensions import Self 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 StandbyPoolMgmtClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer from .operations import ( Operations, StandbyContainerGroupPoolRuntimeViewsOperations, @@ -27,6 +29,7 @@ ) if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -56,10 +59,14 @@ class StandbyPoolMgmtClient: :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 "2025-03-01". - Note that overriding this default value may result in unsupported behavior. + :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 "2025-10-01" + and None. Default value is "2025-10-01". Note that overriding this default value may result in + unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -69,13 +76,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 = StandbyPoolMgmtClientConfiguration( - 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 = [ @@ -94,7 +114,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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_configuration.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_configuration.py index 8d17b6ced765..2b00f4dd5a0b 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_configuration.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_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,8 +30,12 @@ class StandbyPoolMgmtClientConfiguration: # pylint: disable=too-many-instance-a :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 "2025-03-01". - Note that overriding this default value may result in unsupported behavior. + :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 "2025-10-01" + and None. Default value is "2025-10-01". Note that overriding this default value may result in + unsupported behavior. :paramtype api_version: str """ @@ -39,9 +44,10 @@ 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", "2025-03-01") + api_version: str = kwargs.pop("api_version", "2025-10-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -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-standbypool/{}".format(VERSION)) diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_patch.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_patch.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_patch.py @@ -7,9 +7,9 @@ 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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_utils/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_model_base.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_utils/model_base.py similarity index 84% rename from sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_model_base.py rename to sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_utils/model_base.py index 49d5c7259389..b4433021b4e5 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_model_base.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_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. @@ -29,6 +29,7 @@ from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null +from azure.core.rest import HttpResponse _LOGGER = logging.getLogger(__name__) @@ -36,6 +37,7 @@ TZ_UTC = timezone.utc _T = typing.TypeVar("_T") +_NONE_TYPE = type(None) def _timedelta_as_isostr(td: timedelta) -> str: @@ -170,6 +172,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. @@ -201,7 +218,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: @@ -255,7 +272,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): @@ -314,6 +331,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 @@ -345,16 +364,46 @@ def _get_model(module_name: str, model_name: str): class _MyMutableMapping(MutableMapping[str, typing.Any]): - def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + 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: @@ -425,7 +474,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. @@ -466,6 +515,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: @@ -482,6 +533,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()} @@ -513,9 +566,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: @@ -538,7 +589,7 @@ 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__ @@ -623,7 +674,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 = { @@ -638,7 +689,7 @@ 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) @@ -680,7 +731,7 @@ def _deserialize(cls, data, exist_discriminators): 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. @@ -740,7 +791,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 @@ -750,7 +801,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, ): @@ -759,6 +810,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], @@ -768,17 +827,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, @@ -818,16 +890,16 @@ 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 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 @@ -843,7 +915,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 ) @@ -856,7 +931,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) @@ -905,16 +983,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) @@ -940,14 +1022,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 ) @@ -956,11 +1038,11 @@ 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 ) @@ -974,11 +1056,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 @@ -993,7 +1075,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: @@ -1004,14 +1090,37 @@ 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) 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: @@ -1036,11 +1145,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, @@ -1057,8 +1166,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) @@ -1077,9 +1186,9 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: 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", {}) @@ -1168,7 +1277,7 @@ 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: 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 @@ -1179,7 +1288,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: @@ -1192,7 +1301,9 @@ def _get_primitive_type_value(v) -> str: return str(v) -def _create_xml_element(tag, prefix=None, ns=None): +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: if prefix and ns: ET.register_namespace(prefix, ns) if ns: @@ -1211,7 +1322,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): @@ -1224,7 +1335,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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_serialization.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_utils/serialization.py similarity index 98% rename from sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_serialization.py rename to sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_utils/serialization.py index eb86ea23c965..81ec1de5922b 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_serialization.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_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: @@ -229,12 +227,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 +309,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 +378,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 +412,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 +526,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 +577,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 +787,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 +821,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 +1189,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 +1391,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 +1764,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 +1790,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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_validation.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_validation.py index 752b2822f9d3..f5af3a4eb8a2 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_validation.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_validation.py @@ -10,6 +10,22 @@ def api_version_validation(**kwargs): params_added_on = kwargs.pop("params_added_on", {}) method_added_on = kwargs.pop("method_added_on", "") + api_versions_list = kwargs.pop("api_versions_list", []) + + def _index_with_default(value: str, default: int = -1) -> int: + """Get the index of value in lst, or return default if not found. + + :param value: The value to search for in the api_versions_list. + :type value: str + :param default: The default value to return if the value is not found. + :type default: int + :return: The index of the value in the list, or the default value if not found. + :rtype: int + """ + try: + return api_versions_list.index(value) + except ValueError: + return default def decorator(func): @functools.wraps(func) @@ -21,7 +37,7 @@ def wrapper(*args, **kwargs): except AttributeError: return func(*args, **kwargs) - if method_added_on > client_api_version: + if _index_with_default(method_added_on) > _index_with_default(client_api_version): raise ValueError( f"'{func.__name__}' is not available in API version " f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." @@ -31,7 +47,7 @@ def wrapper(*args, **kwargs): parameter: api_version for api_version, parameters in params_added_on.items() for parameter in parameters - if parameter in kwargs and api_version > client_api_version + if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) } if unsupported: raise ValueError( diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_version.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_version.py index 8f2350dd3b0c..ccb75164d3bc 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_version.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "2.1.0" diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_client.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_client.py index 36c987258b90..5a7972bab3c9 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_client.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_client.py @@ -7,15 +7,17 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from typing_extensions import Self 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 StandbyPoolMgmtClientConfiguration from .operations import ( Operations, @@ -27,6 +29,7 @@ ) if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -56,10 +59,14 @@ class StandbyPoolMgmtClient: :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 "2025-03-01". - Note that overriding this default value may result in unsupported behavior. + :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 "2025-10-01" + and None. Default value is "2025-10-01". Note that overriding this default value may result in + unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -69,13 +76,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 = StandbyPoolMgmtClientConfiguration( - 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 = [ @@ -94,7 +114,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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_configuration.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_configuration.py index c81d9bafc16c..2b6f3b3e0f30 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_configuration.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/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,8 +30,12 @@ class StandbyPoolMgmtClientConfiguration: # pylint: disable=too-many-instance-a :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 "2025-03-01". - Note that overriding this default value may result in unsupported behavior. + :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 "2025-10-01" + and None. Default value is "2025-10-01". Note that overriding this default value may result in + unsupported behavior. :paramtype api_version: str """ @@ -39,9 +44,10 @@ 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", "2025-03-01") + api_version: str = kwargs.pop("api_version", "2025-10-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -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-standbypool/{}".format(VERSION)) diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_patch.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_patch.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_patch.py @@ -7,9 +7,9 @@ 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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_operations.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_operations.py index ae9005baa095..1a912fb126ba 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_operations.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -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 ..._validation import api_version_validation from ...operations._operations import ( build_operations_list_request, @@ -61,8 +61,9 @@ from .._configuration import StandbyPoolMgmtClientConfiguration T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] JSON = MutableMapping[str, Any] +List = list class Operations: @@ -83,7 +84,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 @@ -142,7 +143,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) @@ -158,7 +162,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 @@ -225,6 +232,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 @@ -239,11 +247,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.StandbyVirtualMachinePoolResource, response.json()) @@ -295,6 +306,7 @@ async def _create_or_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 @@ -308,14 +320,17 @@ async def _create_or_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 = {} if response.status_code == 201: 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 @@ -515,6 +530,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 @@ -528,7 +544,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 = {} @@ -536,7 +555,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 @@ -746,6 +765,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 @@ -760,11 +780,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.StandbyVirtualMachinePoolResource, response.json()) @@ -776,7 +799,7 @@ async def update( @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.StandbyVirtualMachinePoolResource"]: + ) -> AsyncItemPaged["_models.StandbyVirtualMachinePoolResource"]: """List StandbyVirtualMachinePoolResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -841,7 +864,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.StandbyVirtualMachinePoolResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.StandbyVirtualMachinePoolResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -857,7 +883,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 @@ -865,7 +894,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.StandbyVirtualMachinePoolResource"]: + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.StandbyVirtualMachinePoolResource"]: """List StandbyVirtualMachinePoolResource resources by subscription ID. :return: An iterator like instance of StandbyVirtualMachinePoolResource @@ -926,7 +955,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.StandbyVirtualMachinePoolResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.StandbyVirtualMachinePoolResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -942,7 +974,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 @@ -1016,6 +1051,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 @@ -1030,11 +1066,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.StandbyVirtualMachineResource, response.json()) @@ -1046,7 +1085,7 @@ async def get( @distributed_trace def list_by_standby_virtual_machine_pool_resource( # pylint: disable=name-too-long self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any - ) -> AsyncIterable["_models.StandbyVirtualMachineResource"]: + ) -> AsyncItemPaged["_models.StandbyVirtualMachineResource"]: """List StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -1114,7 +1153,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.StandbyVirtualMachineResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.StandbyVirtualMachineResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1130,7 +1172,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 @@ -1168,6 +1213,7 @@ def __init__(self, *args, **kwargs) -> None: "accept", ] }, + api_versions_list=["2024-03-01-preview", "2024-03-01", "2025-03-01", "2025-10-01"], ) async def get( self, resource_group_name: str, standby_virtual_machine_pool_name: str, runtime_view: str, **kwargs: Any @@ -1215,6 +1261,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 @@ -1229,11 +1276,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.StandbyVirtualMachinePoolRuntimeViewResource, response.json()) @@ -1254,10 +1304,11 @@ async def get( "accept", ] }, + api_versions_list=["2024-03-01-preview", "2024-03-01", "2025-03-01", "2025-10-01"], ) def list_by_standby_pool( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any - ) -> AsyncIterable["_models.StandbyVirtualMachinePoolRuntimeViewResource"]: + ) -> AsyncItemPaged["_models.StandbyVirtualMachinePoolRuntimeViewResource"]: """List StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource. @@ -1327,7 +1378,8 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.StandbyVirtualMachinePoolRuntimeViewResource], deserialized.get("value", []) + List[_models.StandbyVirtualMachinePoolRuntimeViewResource], + deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -1344,7 +1396,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 @@ -1411,6 +1466,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 @@ -1425,11 +1481,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.StandbyContainerGroupPoolResource, response.json()) @@ -1481,6 +1540,7 @@ async def _create_or_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 @@ -1494,14 +1554,17 @@ async def _create_or_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 = {} if response.status_code == 201: 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 @@ -1701,6 +1764,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 @@ -1714,7 +1778,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 = {} @@ -1722,7 +1789,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 @@ -1932,6 +1999,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 @@ -1946,11 +2014,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.StandbyContainerGroupPoolResource, response.json()) @@ -1962,7 +2033,7 @@ async def update( @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.StandbyContainerGroupPoolResource"]: + ) -> AsyncItemPaged["_models.StandbyContainerGroupPoolResource"]: """List StandbyContainerGroupPoolResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -2027,7 +2098,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.StandbyContainerGroupPoolResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.StandbyContainerGroupPoolResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2043,7 +2117,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 @@ -2051,7 +2128,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.StandbyContainerGroupPoolResource"]: + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.StandbyContainerGroupPoolResource"]: """List StandbyContainerGroupPoolResource resources by subscription ID. :return: An iterator like instance of StandbyContainerGroupPoolResource @@ -2112,7 +2189,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.StandbyContainerGroupPoolResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.StandbyContainerGroupPoolResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2128,7 +2208,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 @@ -2166,6 +2249,7 @@ def __init__(self, *args, **kwargs) -> None: "accept", ] }, + api_versions_list=["2024-03-01-preview", "2024-03-01", "2025-03-01", "2025-10-01"], ) async def get( self, resource_group_name: str, standby_container_group_pool_name: str, runtime_view: str, **kwargs: Any @@ -2213,6 +2297,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 @@ -2227,11 +2312,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.StandbyContainerGroupPoolRuntimeViewResource, response.json()) @@ -2252,10 +2340,11 @@ async def get( "accept", ] }, + api_versions_list=["2024-03-01-preview", "2024-03-01", "2025-03-01", "2025-10-01"], ) def list_by_standby_pool( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any - ) -> AsyncIterable["_models.StandbyContainerGroupPoolRuntimeViewResource"]: + ) -> AsyncItemPaged["_models.StandbyContainerGroupPoolRuntimeViewResource"]: """List StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource. @@ -2325,7 +2414,8 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.StandbyContainerGroupPoolRuntimeViewResource], deserialized.get("value", []) + List[_models.StandbyContainerGroupPoolRuntimeViewResource], + deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -2342,7 +2432,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 diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_patch.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_patch.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_patch.py @@ -7,9 +7,9 @@ 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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/__init__.py index cad271ee49cf..cf5d9ef15b94 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/__init__.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/__init__.py @@ -17,6 +17,7 @@ ContainerGroupInstanceCountSummary, ContainerGroupProfile, ContainerGroupProperties, + DynamicSizing, ErrorAdditionalInfo, ErrorDetail, ErrorResponse, @@ -72,6 +73,7 @@ "ContainerGroupInstanceCountSummary", "ContainerGroupProfile", "ContainerGroupProperties", + "DynamicSizing", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_models.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_models.py index 9d41de57dab7..e07f2493f357 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_models.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_models.py @@ -9,16 +9,15 @@ # pylint: disable=useless-super-delegation import datetime -from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload +from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload -from .. import _model_base -from .._model_base import rest_field +from .._utils.model_base import Model as _Model, rest_field if TYPE_CHECKING: from .. import models as _models -class ContainerGroupInstanceCountSummary(_model_base.Model): +class ContainerGroupInstanceCountSummary(_Model): """Displays the counts of container groups in each state, as known by the StandbyPool resource provider. @@ -33,7 +32,7 @@ class ContainerGroupInstanceCountSummary(_model_base.Model): zone: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The zone that the provided counts are in. It will not have a value if zones are not enabled.""" - instance_counts_by_state: List["_models.PoolContainerGroupStateCount"] = rest_field( + instance_counts_by_state: list["_models.PoolContainerGroupStateCount"] = rest_field( name="instanceCountsByState", visibility=["read", "create", "update", "delete", "query"] ) """The count of pooled container groups in each state for the given zone. Required.""" @@ -42,7 +41,7 @@ class ContainerGroupInstanceCountSummary(_model_base.Model): def __init__( self, *, - instance_counts_by_state: List["_models.PoolContainerGroupStateCount"], + instance_counts_by_state: list["_models.PoolContainerGroupStateCount"], zone: Optional[int] = None, ) -> None: ... @@ -57,7 +56,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerGroupProfile(_model_base.Model): +class ContainerGroupProfile(_Model): """Details of the ContainerGroupProfile. :ivar id: Specifies container group profile id of standby container groups. Required. @@ -90,7 +89,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerGroupProperties(_model_base.Model): +class ContainerGroupProperties(_Model): """Details of the ContainerGroupProperties. :ivar container_group_profile: Specifies container group profile of standby container groups. @@ -104,7 +103,7 @@ class ContainerGroupProperties(_model_base.Model): name="containerGroupProfile", visibility=["read", "create", "update", "delete", "query"] ) """Specifies container group profile of standby container groups. Required.""" - subnet_ids: Optional[List["_models.Subnet"]] = rest_field( + subnet_ids: Optional[list["_models.Subnet"]] = rest_field( name="subnetIds", visibility=["read", "create", "update", "delete", "query"] ) """Specifies subnet Ids for container group.""" @@ -114,7 +113,7 @@ def __init__( self, *, container_group_profile: "_models.ContainerGroupProfile", - subnet_ids: Optional[List["_models.Subnet"]] = None, + subnet_ids: Optional[list["_models.Subnet"]] = None, ) -> None: ... @overload @@ -128,7 +127,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ErrorAdditionalInfo(_model_base.Model): +class DynamicSizing(_Model): + """Specifies the dynamic sizing configuration. + + :ivar enabled: Indicates whether dynamic sizing is enabled for the standby pool. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates whether dynamic sizing is enabled for the standby pool.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ErrorAdditionalInfo(_Model): """The resource management error additional info. :ivar type: The additional info type. @@ -143,7 +170,7 @@ class ErrorAdditionalInfo(_model_base.Model): """The additional info.""" -class ErrorDetail(_model_base.Model): +class ErrorDetail(_Model): """The error detail. :ivar code: The error code. @@ -164,17 +191,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.standbypool.models.ErrorDetail @@ -201,8 +227,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". @@ -258,8 +284,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". @@ -289,7 +315,7 @@ class OperationDisplay(_model_base.Model): views.""" -class PoolContainerGroupStateCount(_model_base.Model): +class PoolContainerGroupStateCount(_Model): """Displays the counts of pooled container groups in each state, as known by the StandbyPool resource provider. @@ -327,7 +353,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PoolStatus(_model_base.Model): +class PoolStatus(_Model): """Displays StandbyPool status. :ivar code: Displays the healthy state of the StandbyPool. Required. Known values are: @@ -344,7 +370,7 @@ class PoolStatus(_model_base.Model): """Displays the StandbyPool health state details.""" -class PoolVirtualMachineStateCount(_model_base.Model): +class PoolVirtualMachineStateCount(_Model): """Displays the counts of pooled virtual machines in each state, as known by the StandbyPool resource provider. @@ -384,8 +410,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}. @@ -413,8 +439,7 @@ class Resource(_model_base.Model): class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. + """Proxy Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -430,7 +455,7 @@ class ProxyResource(Resource): """ -class StandbyContainerGroupPoolElasticityProfile(_model_base.Model): # pylint: disable=name-too-long +class StandbyContainerGroupPoolElasticityProfile(_Model): # pylint: disable=name-too-long """Specifies the elasticity profile of the standby container group pools. :ivar max_ready_capacity: Specifies maximum number of standby container groups in the standby @@ -438,6 +463,8 @@ class StandbyContainerGroupPoolElasticityProfile(_model_base.Model): # pylint: :vartype max_ready_capacity: int :ivar refill_policy: Specifies refill policy of the pool. "always" :vartype refill_policy: str or ~azure.mgmt.standbypool.models.RefillPolicy + :ivar dynamic_sizing: Specifies the dynamic sizing configuration. + :vartype dynamic_sizing: ~azure.mgmt.standbypool.models.DynamicSizing """ max_ready_capacity: int = rest_field( @@ -448,6 +475,10 @@ class StandbyContainerGroupPoolElasticityProfile(_model_base.Model): # pylint: name="refillPolicy", visibility=["read", "create", "update", "delete", "query"] ) """Specifies refill policy of the pool. \"always\"""" + dynamic_sizing: Optional["_models.DynamicSizing"] = rest_field( + name="dynamicSizing", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the dynamic sizing configuration.""" @overload def __init__( @@ -455,6 +486,7 @@ def __init__( *, max_ready_capacity: int, refill_policy: Optional[Union[str, "_models.RefillPolicy"]] = None, + dynamic_sizing: Optional["_models.DynamicSizing"] = None, ) -> None: ... @overload @@ -468,7 +500,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StandbyContainerGroupPoolForecastValues(_model_base.Model): +class StandbyContainerGroupPoolForecastValues(_Model): """Displays the forecast information of the standby pool. :ivar instances_requested_count: Displays the predicted count of instances to be requested from @@ -476,11 +508,11 @@ class StandbyContainerGroupPoolForecastValues(_model_base.Model): :vartype instances_requested_count: list[int] """ - instances_requested_count: List[int] = rest_field(name="instancesRequestedCount", visibility=["read"]) + instances_requested_count: list[int] = rest_field(name="instancesRequestedCount", visibility=["read"]) """Displays the predicted count of instances to be requested from the standby pool. Required.""" -class StandbyContainerGroupPoolPrediction(_model_base.Model): +class StandbyContainerGroupPoolPrediction(_Model): """Displays prediction information of the standby pool. :ivar forecast_values: Displays the forecast information of the standby pool. Required. @@ -505,8 +537,7 @@ class StandbyContainerGroupPoolPrediction(_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}. @@ -525,7 +556,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.""" @@ -535,7 +566,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -581,7 +612,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.StandbyContainerGroupPoolResourceProperties"] = None, ) -> None: ... @@ -596,7 +627,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StandbyContainerGroupPoolResourceProperties(_model_base.Model): # pylint: disable=name-too-long +class StandbyContainerGroupPoolResourceProperties(_Model): # pylint: disable=name-too-long """Details of the StandbyContainerGroupPool. :ivar elasticity_profile: Specifies elasticity profile of standby container group pools. @@ -621,7 +652,7 @@ class StandbyContainerGroupPoolResourceProperties(_model_base.Model): # pylint: name="containerGroupProperties", visibility=["read", "create", "update", "delete", "query"] ) """Specifies container group properties of standby container group pools. Required.""" - zones: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + zones: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Specifies zones of standby container group pools.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] @@ -635,7 +666,7 @@ def __init__( *, elasticity_profile: "_models.StandbyContainerGroupPoolElasticityProfile", container_group_properties: "_models.ContainerGroupProperties", - zones: Optional[List[str]] = None, + zones: Optional[list[str]] = None, ) -> None: ... @overload @@ -649,7 +680,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StandbyContainerGroupPoolResourceUpdate(_model_base.Model): +class StandbyContainerGroupPoolResourceUpdate(_Model): """The type used for update operations of the StandbyContainerGroupPoolResource. :ivar tags: Resource tags. @@ -659,7 +690,7 @@ class StandbyContainerGroupPoolResourceUpdate(_model_base.Model): ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolResourceUpdateProperties """ - 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.""" properties: Optional["_models.StandbyContainerGroupPoolResourceUpdateProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -670,7 +701,7 @@ class StandbyContainerGroupPoolResourceUpdate(_model_base.Model): def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.StandbyContainerGroupPoolResourceUpdateProperties"] = None, ) -> None: ... @@ -685,7 +716,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StandbyContainerGroupPoolResourceUpdateProperties(_model_base.Model): # pylint: disable=name-too-long +class StandbyContainerGroupPoolResourceUpdateProperties(_Model): # pylint: disable=name-too-long """The updatable properties of the StandbyContainerGroupPoolResource. :ivar elasticity_profile: Specifies elasticity profile of standby container group pools. @@ -706,7 +737,7 @@ class StandbyContainerGroupPoolResourceUpdateProperties(_model_base.Model): # p name="containerGroupProperties", visibility=["read", "create", "update", "delete", "query"] ) """Specifies container group properties of standby container group pools.""" - zones: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + zones: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Specifies zones of standby container group pools.""" @overload @@ -715,7 +746,7 @@ def __init__( *, elasticity_profile: Optional["_models.StandbyContainerGroupPoolElasticityProfile"] = None, container_group_properties: Optional["_models.ContainerGroupProperties"] = None, - zones: Optional[List[str]] = None, + zones: Optional[list[str]] = None, ) -> None: ... @overload @@ -772,7 +803,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StandbyContainerGroupPoolRuntimeViewResourceProperties(_model_base.Model): # pylint: disable=name-too-long +class StandbyContainerGroupPoolRuntimeViewResourceProperties(_Model): # pylint: disable=name-too-long """Contains information about a standby pool as last known by the StandbyPool resource provider. :ivar instance_count_summary: A list containing the counts of container groups in each possible @@ -788,7 +819,7 @@ class StandbyContainerGroupPoolRuntimeViewResourceProperties(_model_base.Model): :vartype prediction: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolPrediction """ - instance_count_summary: List["_models.ContainerGroupInstanceCountSummary"] = rest_field( + instance_count_summary: list["_models.ContainerGroupInstanceCountSummary"] = rest_field( name="instanceCountSummary", visibility=["read"] ) """A list containing the counts of container groups in each possible state, as known by the @@ -804,7 +835,7 @@ class StandbyContainerGroupPoolRuntimeViewResourceProperties(_model_base.Model): """Displays prediction information of the standby pool.""" -class StandbyVirtualMachinePoolElasticityProfile(_model_base.Model): # pylint: disable=name-too-long +class StandbyVirtualMachinePoolElasticityProfile(_Model): # pylint: disable=name-too-long """Details of the elasticity profile. :ivar max_ready_capacity: Specifies the maximum number of virtual machines in the standby @@ -813,6 +844,12 @@ class StandbyVirtualMachinePoolElasticityProfile(_model_base.Model): # pylint: :ivar min_ready_capacity: Specifies the desired minimum number of virtual machines in the standby virtual machine pool. MinReadyCapacity cannot exceed MaxReadyCapacity. :vartype min_ready_capacity: int + :ivar post_provisioning_delay: Specifies the duration to wait after virtual machine + provisioning before the virtual machine becomes available for use. The duration should be + specified in ISO 8601 format (e.g., PT2S for 2 seconds). + :vartype post_provisioning_delay: str + :ivar dynamic_sizing: Specifies the dynamic sizing configuration. + :vartype dynamic_sizing: ~azure.mgmt.standbypool.models.DynamicSizing """ max_ready_capacity: int = rest_field( @@ -824,6 +861,16 @@ class StandbyVirtualMachinePoolElasticityProfile(_model_base.Model): # pylint: ) """Specifies the desired minimum number of virtual machines in the standby virtual machine pool. MinReadyCapacity cannot exceed MaxReadyCapacity.""" + post_provisioning_delay: Optional[str] = rest_field( + name="postProvisioningDelay", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the duration to wait after virtual machine provisioning before the virtual machine + becomes available for use. The duration should be specified in ISO 8601 format (e.g., PT2S for + 2 seconds).""" + dynamic_sizing: Optional["_models.DynamicSizing"] = rest_field( + name="dynamicSizing", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the dynamic sizing configuration.""" @overload def __init__( @@ -831,6 +878,8 @@ def __init__( *, max_ready_capacity: int, min_ready_capacity: Optional[int] = None, + post_provisioning_delay: Optional[str] = None, + dynamic_sizing: Optional["_models.DynamicSizing"] = None, ) -> None: ... @overload @@ -844,7 +893,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StandbyVirtualMachinePoolForecastValues(_model_base.Model): +class StandbyVirtualMachinePoolForecastValues(_Model): """Displays the forecast information of the standby pool. :ivar instances_requested_count: Displays the predicted count of instances to be requested from @@ -852,11 +901,11 @@ class StandbyVirtualMachinePoolForecastValues(_model_base.Model): :vartype instances_requested_count: list[int] """ - instances_requested_count: List[int] = rest_field(name="instancesRequestedCount", visibility=["read"]) + instances_requested_count: list[int] = rest_field(name="instancesRequestedCount", visibility=["read"]) """Displays the predicted count of instances to be requested from the standby pool. Required.""" -class StandbyVirtualMachinePoolPrediction(_model_base.Model): +class StandbyVirtualMachinePoolPrediction(_Model): """Displays prediction information of the standby pool. :ivar forecast_values: Displays the forecast information of the standby pool. Required. @@ -912,7 +961,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.StandbyVirtualMachinePoolResourceProperties"] = None, ) -> None: ... @@ -927,7 +976,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StandbyVirtualMachinePoolResourceProperties(_model_base.Model): # pylint: disable=name-too-long +class StandbyVirtualMachinePoolResourceProperties(_Model): # pylint: disable=name-too-long """Details of the StandbyVirtualMachinePool. :ivar elasticity_profile: Specifies the elasticity profile of the standby virtual machine @@ -985,7 +1034,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StandbyVirtualMachinePoolResourceUpdate(_model_base.Model): +class StandbyVirtualMachinePoolResourceUpdate(_Model): """The type used for update operations of the StandbyVirtualMachinePoolResource. :ivar tags: Resource tags. @@ -995,7 +1044,7 @@ class StandbyVirtualMachinePoolResourceUpdate(_model_base.Model): ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResourceUpdateProperties """ - 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.""" properties: Optional["_models.StandbyVirtualMachinePoolResourceUpdateProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -1006,7 +1055,7 @@ class StandbyVirtualMachinePoolResourceUpdate(_model_base.Model): def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.StandbyVirtualMachinePoolResourceUpdateProperties"] = None, ) -> None: ... @@ -1021,7 +1070,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StandbyVirtualMachinePoolResourceUpdateProperties(_model_base.Model): # pylint: disable=name-too-long +class StandbyVirtualMachinePoolResourceUpdateProperties(_Model): # pylint: disable=name-too-long """The updatable properties of the StandbyVirtualMachinePoolResource. :ivar elasticity_profile: Specifies the elasticity profile of the standby virtual machine @@ -1114,7 +1163,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StandbyVirtualMachinePoolRuntimeViewResourceProperties(_model_base.Model): # pylint: disable=name-too-long +class StandbyVirtualMachinePoolRuntimeViewResourceProperties(_Model): # pylint: disable=name-too-long """Contains information about a standby pool as last known by the StandbyPool resource provider. :ivar instance_count_summary: A list containing the counts of virtual machines in each possible @@ -1133,7 +1182,7 @@ class StandbyVirtualMachinePoolRuntimeViewResourceProperties(_model_base.Model): :vartype prediction: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolPrediction """ - instance_count_summary: List["_models.VirtualMachineInstanceCountSummary"] = rest_field( + instance_count_summary: list["_models.VirtualMachineInstanceCountSummary"] = rest_field( name="instanceCountSummary", visibility=["read"] ) """A list containing the counts of virtual machines in each possible power state for each zone if @@ -1193,7 +1242,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StandbyVirtualMachineResourceProperties(_model_base.Model): +class StandbyVirtualMachineResourceProperties(_Model): """Details of the StandbyVirtualMachine. :ivar virtual_machine_resource_id: Resource id of the virtual machine. Required. @@ -1231,7 +1280,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Subnet(_model_base.Model): +class Subnet(_Model): """Subnet of container group. :ivar id: Specifies ARM resource id of the subnet. Required. @@ -1259,7 +1308,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -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. @@ -1326,7 +1375,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VirtualMachineInstanceCountSummary(_model_base.Model): +class VirtualMachineInstanceCountSummary(_Model): """Contains the counts of VMs in each power state in a given zone, fault domain, as known by the StandbyPool resource provider. Note: any resources in the Running state may still be installing extensions / not fully provisioned. @@ -1343,7 +1392,7 @@ class VirtualMachineInstanceCountSummary(_model_base.Model): zone: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The zone that the provided counts are in. It will not have a value if zones are not enabled on the attached VMSS.""" - instance_counts_by_state: List["_models.PoolVirtualMachineStateCount"] = rest_field( + instance_counts_by_state: list["_models.PoolVirtualMachineStateCount"] = rest_field( name="instanceCountsByState", visibility=["read", "create", "update", "delete", "query"] ) """The count of pooled virtual machines in each state for the given zone. Required.""" @@ -1352,7 +1401,7 @@ class VirtualMachineInstanceCountSummary(_model_base.Model): def __init__( self, *, - instance_counts_by_state: List["_models.PoolVirtualMachineStateCount"], + instance_counts_by_state: list["_models.PoolVirtualMachineStateCount"], zone: Optional[int] = None, ) -> None: ... diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_patch.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_patch.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_patch.py @@ -7,9 +7,9 @@ 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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_operations.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_operations.py index 2e379adcf834..3a64014fe9ef 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_operations.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -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,13 +34,14 @@ from .. import models as _models from .._configuration import StandbyPoolMgmtClientConfiguration -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 .._validation import api_version_validation T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] JSON = MutableMapping[str, Any] +List = list _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -50,7 +51,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +72,7 @@ def build_standby_virtual_machine_pools_get_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +103,7 @@ def build_standby_virtual_machine_pools_create_or_update_request( # pylint: dis _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,12 +132,9 @@ def build_standby_virtual_machine_pools_create_or_update_request( # pylint: dis def build_standby_virtual_machine_pools_delete_request( # pylint: disable=name-too-long resource_group_name: str, standby_virtual_machine_pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}" path_format_arguments = { @@ -152,10 +150,7 @@ def build_standby_virtual_machine_pools_delete_request( # pylint: disable=name- # 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_standby_virtual_machine_pools_update_request( # pylint: disable=name-too-long @@ -165,7 +160,7 @@ def build_standby_virtual_machine_pools_update_request( # pylint: disable=name- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -197,7 +192,7 @@ def build_standby_virtual_machine_pools_list_by_resource_group_request( # pylin _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +219,7 @@ def build_standby_virtual_machine_pools_list_by_subscription_request( # pylint: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -254,7 +249,7 @@ def build_standby_virtual_machines_get_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +282,7 @@ def build_standby_virtual_machines_list_by_standby_virtual_machine_pool_resource _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -321,7 +316,7 @@ def build_standby_virtual_machine_pool_runtime_views_get_request( # pylint: dis _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -352,7 +347,7 @@ def build_standby_virtual_machine_pool_runtime_views_list_by_standby_pool_reques _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -382,7 +377,7 @@ def build_standby_container_group_pools_get_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -413,7 +408,7 @@ def build_standby_container_group_pools_create_or_update_request( # pylint: dis _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -442,12 +437,9 @@ def build_standby_container_group_pools_create_or_update_request( # pylint: dis def build_standby_container_group_pools_delete_request( # pylint: disable=name-too-long resource_group_name: str, standby_container_group_pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}" path_format_arguments = { @@ -463,10 +455,7 @@ def build_standby_container_group_pools_delete_request( # pylint: disable=name- # 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_standby_container_group_pools_update_request( # pylint: disable=name-too-long @@ -476,7 +465,7 @@ def build_standby_container_group_pools_update_request( # pylint: disable=name- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -508,7 +497,7 @@ def build_standby_container_group_pools_list_by_resource_group_request( # pylin _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -535,7 +524,7 @@ def build_standby_container_group_pools_list_by_subscription_request( # pylint: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -565,7 +554,7 @@ def build_standby_container_group_pool_runtime_views_get_request( # pylint: dis _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -596,7 +585,7 @@ def build_standby_container_group_pool_runtime_views_list_by_standby_pool_reques _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -630,7 +619,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: StandbyPoolMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") @@ -638,7 +627,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 @@ -697,7 +686,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) @@ -713,7 +705,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 @@ -731,7 +726,7 @@ class StandbyVirtualMachinePoolsOperations: :attr:`standby_virtual_machine_pools` 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: StandbyPoolMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") @@ -780,6 +775,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 @@ -794,11 +790,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.StandbyVirtualMachinePoolResource, response.json()) @@ -850,6 +849,7 @@ def _create_or_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 @@ -863,14 +863,17 @@ def _create_or_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 = {} if response.status_code == 201: 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 @@ -1070,6 +1073,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 @@ -1083,7 +1087,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 = {} @@ -1091,7 +1098,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 @@ -1301,6 +1308,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 @@ -1315,11 +1323,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.StandbyVirtualMachinePoolResource, response.json()) @@ -1331,7 +1342,7 @@ def update( @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.StandbyVirtualMachinePoolResource"]: + ) -> ItemPaged["_models.StandbyVirtualMachinePoolResource"]: """List StandbyVirtualMachinePoolResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -1396,7 +1407,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.StandbyVirtualMachinePoolResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.StandbyVirtualMachinePoolResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1412,7 +1426,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 @@ -1420,7 +1437,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.StandbyVirtualMachinePoolResource"]: + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.StandbyVirtualMachinePoolResource"]: """List StandbyVirtualMachinePoolResource resources by subscription ID. :return: An iterator like instance of StandbyVirtualMachinePoolResource @@ -1481,7 +1498,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.StandbyVirtualMachinePoolResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.StandbyVirtualMachinePoolResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1497,7 +1517,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 @@ -1515,7 +1538,7 @@ class StandbyVirtualMachinesOperations: :attr:`standby_virtual_machines` 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: StandbyPoolMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") @@ -1571,6 +1594,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 @@ -1585,11 +1609,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.StandbyVirtualMachineResource, response.json()) @@ -1601,7 +1628,7 @@ def get( @distributed_trace def list_by_standby_virtual_machine_pool_resource( # pylint: disable=name-too-long self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any - ) -> Iterable["_models.StandbyVirtualMachineResource"]: + ) -> ItemPaged["_models.StandbyVirtualMachineResource"]: """List StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -1669,7 +1696,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.StandbyVirtualMachineResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.StandbyVirtualMachineResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1685,7 +1715,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 @@ -1703,7 +1736,7 @@ class StandbyVirtualMachinePoolRuntimeViewsOperations: # pylint: disable=name-t :attr:`standby_virtual_machine_pool_runtime_views` 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: StandbyPoolMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") @@ -1723,6 +1756,7 @@ def __init__(self, *args, **kwargs): "accept", ] }, + api_versions_list=["2024-03-01-preview", "2024-03-01", "2025-03-01", "2025-10-01"], ) def get( self, resource_group_name: str, standby_virtual_machine_pool_name: str, runtime_view: str, **kwargs: Any @@ -1770,6 +1804,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 @@ -1784,11 +1819,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.StandbyVirtualMachinePoolRuntimeViewResource, response.json()) @@ -1809,10 +1847,11 @@ def get( "accept", ] }, + api_versions_list=["2024-03-01-preview", "2024-03-01", "2025-03-01", "2025-10-01"], ) def list_by_standby_pool( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any - ) -> Iterable["_models.StandbyVirtualMachinePoolRuntimeViewResource"]: + ) -> ItemPaged["_models.StandbyVirtualMachinePoolRuntimeViewResource"]: """List StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource. @@ -1882,7 +1921,8 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.StandbyVirtualMachinePoolRuntimeViewResource], deserialized.get("value", []) + List[_models.StandbyVirtualMachinePoolRuntimeViewResource], + deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -1899,7 +1939,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 @@ -1917,7 +1960,7 @@ class StandbyContainerGroupPoolsOperations: :attr:`standby_container_group_pools` 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: StandbyPoolMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") @@ -1966,6 +2009,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 @@ -1980,11 +2024,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.StandbyContainerGroupPoolResource, response.json()) @@ -2036,6 +2083,7 @@ def _create_or_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 @@ -2049,14 +2097,17 @@ def _create_or_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 = {} if response.status_code == 201: 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 @@ -2256,6 +2307,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 @@ -2269,7 +2321,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 = {} @@ -2277,7 +2332,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 @@ -2487,6 +2542,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 @@ -2501,11 +2557,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.StandbyContainerGroupPoolResource, response.json()) @@ -2517,7 +2576,7 @@ def update( @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.StandbyContainerGroupPoolResource"]: + ) -> ItemPaged["_models.StandbyContainerGroupPoolResource"]: """List StandbyContainerGroupPoolResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -2582,7 +2641,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.StandbyContainerGroupPoolResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.StandbyContainerGroupPoolResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2598,7 +2660,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 @@ -2606,7 +2671,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.StandbyContainerGroupPoolResource"]: + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.StandbyContainerGroupPoolResource"]: """List StandbyContainerGroupPoolResource resources by subscription ID. :return: An iterator like instance of StandbyContainerGroupPoolResource @@ -2667,7 +2732,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.StandbyContainerGroupPoolResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.StandbyContainerGroupPoolResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2683,7 +2751,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 @@ -2701,7 +2772,7 @@ class StandbyContainerGroupPoolRuntimeViewsOperations: # pylint: disable=name-t :attr:`standby_container_group_pool_runtime_views` 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: StandbyPoolMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") @@ -2721,6 +2792,7 @@ def __init__(self, *args, **kwargs): "accept", ] }, + api_versions_list=["2024-03-01-preview", "2024-03-01", "2025-03-01", "2025-10-01"], ) def get( self, resource_group_name: str, standby_container_group_pool_name: str, runtime_view: str, **kwargs: Any @@ -2768,6 +2840,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 @@ -2782,11 +2855,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.StandbyContainerGroupPoolRuntimeViewResource, response.json()) @@ -2807,10 +2883,11 @@ def get( "accept", ] }, + api_versions_list=["2024-03-01-preview", "2024-03-01", "2025-03-01", "2025-10-01"], ) def list_by_standby_pool( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any - ) -> Iterable["_models.StandbyContainerGroupPoolRuntimeViewResource"]: + ) -> ItemPaged["_models.StandbyContainerGroupPoolRuntimeViewResource"]: """List StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource. @@ -2880,7 +2957,8 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.StandbyContainerGroupPoolRuntimeViewResource], deserialized.get("value", []) + List[_models.StandbyContainerGroupPoolRuntimeViewResource], + deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -2897,7 +2975,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 diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_patch.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_patch.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_patch.py @@ -7,9 +7,9 @@ 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/standbypool/azure-mgmt-standbypool/generated_samples/operations_list.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/operations_list.py index f839954cf55b..b4725d5a670b 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/operations_list.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-01/Operations_List.json +# x-ms-original-file: 2025-10-01/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_get.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_get.py index 40f52f7a7291..c9861dbf9c3c 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_get.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json +# x-ms-original-file: 2025-10-01/StandbyContainerGroupPoolRuntimeViews_Get.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_list_by_standby_pool.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_list_by_standby_pool.py index 9fd207ba8f31..4093406e8cda 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_list_by_standby_pool.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_list_by_standby_pool.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json +# x-ms-original-file: 2025-10-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_create_or_update.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_create_or_update.py index a690eb43a07c..b14119c469b6 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_create_or_update.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_create_or_update.py @@ -48,7 +48,11 @@ def main(): } ], }, - "elasticityProfile": {"maxReadyCapacity": 688, "refillPolicy": "always"}, + "elasticityProfile": { + "dynamicSizing": {"enabled": True}, + "maxReadyCapacity": 688, + "refillPolicy": "always", + }, "zones": ["1", "2", "3"], }, "tags": {}, @@ -57,6 +61,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_CreateOrUpdate.json +# x-ms-original-file: 2025-10-01/StandbyContainerGroupPools_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_delete.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_delete.py index 7824aefdcfa8..73092e9421d8 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_delete.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_Delete.json +# x-ms-original-file: 2025-10-01/StandbyContainerGroupPools_Delete.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_get.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_get.py index 8d3092a652ab..51742a42ad78 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_get.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_Get.json +# x-ms-original-file: 2025-10-01/StandbyContainerGroupPools_Get.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_resource_group.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_resource_group.py index 5ba3f0f9b3e3..37136932c03f 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_resource_group.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_ListByResourceGroup.json +# x-ms-original-file: 2025-10-01/StandbyContainerGroupPools_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_subscription.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_subscription.py index 9da3cee45276..40386d60f1bc 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_subscription.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_ListBySubscription.json +# x-ms-original-file: 2025-10-01/StandbyContainerGroupPools_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_update.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_update.py index 72d3cf49f042..315dca7439c7 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_update.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_update.py @@ -47,7 +47,11 @@ def main(): } ], }, - "elasticityProfile": {"maxReadyCapacity": 1743, "refillPolicy": "always"}, + "elasticityProfile": { + "dynamicSizing": {"enabled": True}, + "maxReadyCapacity": 1743, + "refillPolicy": "always", + }, "zones": ["1", "2", "3"], }, "tags": {}, @@ -56,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_Update.json +# x-ms-original-file: 2025-10-01/StandbyContainerGroupPools_Update.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_get.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_get.py index 5d589b5b18b4..ffe6879c7e5e 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_get.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json +# x-ms-original-file: 2025-10-01/StandbyVirtualMachinePoolRuntimeViews_Get.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_list_by_standby_pool.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_list_by_standby_pool.py index 8ed5a3d01d81..a809155ddde2 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_list_by_standby_pool.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_list_by_standby_pool.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json +# x-ms-original-file: 2025-10-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_create_or_update.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_create_or_update.py index b188605c2ddd..05e724fc00f4 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_create_or_update.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_create_or_update.py @@ -38,7 +38,12 @@ def main(): "location": "West US", "properties": { "attachedVirtualMachineScaleSetId": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss", - "elasticityProfile": {"maxReadyCapacity": 304, "minReadyCapacity": 300}, + "elasticityProfile": { + "dynamicSizing": {"enabled": True}, + "maxReadyCapacity": 304, + "minReadyCapacity": 300, + "postProvisioningDelay": "PT2S", + }, "virtualMachineState": "Running", }, "tags": {}, @@ -47,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json +# x-ms-original-file: 2025-10-01/StandbyVirtualMachinePools_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_delete.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_delete.py index 4a015df45a2c..8a163566b7c7 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_delete.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_Delete.json +# x-ms-original-file: 2025-10-01/StandbyVirtualMachinePools_Delete.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_get.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_get.py index 60a51171b542..abaa2507ff1e 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_get.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_Get.json +# x-ms-original-file: 2025-10-01/StandbyVirtualMachinePools_Get.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_resource_group.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_resource_group.py index 6bd661c23086..a908180eab2b 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_resource_group.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json +# x-ms-original-file: 2025-10-01/StandbyVirtualMachinePools_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_subscription.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_subscription.py index 065efd166993..d99afede23d1 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_subscription.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_ListBySubscription.json +# x-ms-original-file: 2025-10-01/StandbyVirtualMachinePools_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_update.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_update.py index 010673df31ab..65d7b15ce92a 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_update.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_update.py @@ -37,7 +37,12 @@ def main(): properties={ "properties": { "attachedVirtualMachineScaleSetId": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss", - "elasticityProfile": {"maxReadyCapacity": 304, "minReadyCapacity": 300}, + "elasticityProfile": { + "dynamicSizing": {"enabled": True}, + "maxReadyCapacity": 304, + "minReadyCapacity": 300, + "postProvisioningDelay": "PT2S", + }, "virtualMachineState": "Running", }, "tags": {}, @@ -46,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_Update.json +# x-ms-original-file: 2025-10-01/StandbyVirtualMachinePools_Update.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_get.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_get.py index 5543ba6df820..6099a07a7657 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_get.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-03-01/StandbyVirtualMachines_Get.json +# x-ms-original-file: 2025-10-01/StandbyVirtualMachines_Get.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_list_by_standby_virtual_machine_pool_resource.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_list_by_standby_virtual_machine_pool_resource.py index 8256d53b560d..dae2da54619a 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_list_by_standby_virtual_machine_pool_resource.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_list_by_standby_virtual_machine_pool_resource.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json +# x-ms-original-file: 2025-10-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations.py b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations.py index 8d4d8873b3ad..31fbe71d7df0 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations.py @@ -44,7 +44,11 @@ def test_standby_container_group_pools_begin_create_or_update(self, resource_gro "containerGroupProfile": {"id": "str", "revision": 0}, "subnetIds": [{"id": "str"}], }, - "elasticityProfile": {"maxReadyCapacity": 0, "refillPolicy": "str"}, + "elasticityProfile": { + "maxReadyCapacity": 0, + "dynamicSizing": {"enabled": bool}, + "refillPolicy": "str", + }, "provisioningState": "str", "zones": ["str"], }, @@ -87,7 +91,11 @@ def test_standby_container_group_pools_update(self, resource_group): "containerGroupProfile": {"id": "str", "revision": 0}, "subnetIds": [{"id": "str"}], }, - "elasticityProfile": {"maxReadyCapacity": 0, "refillPolicy": "str"}, + "elasticityProfile": { + "maxReadyCapacity": 0, + "dynamicSizing": {"enabled": bool}, + "refillPolicy": "str", + }, "zones": ["str"], }, "tags": {"str": "str"}, diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations_async.py b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations_async.py index 6623ea478f57..2af251d862fc 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations_async.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations_async.py @@ -46,7 +46,11 @@ async def test_standby_container_group_pools_begin_create_or_update(self, resour "containerGroupProfile": {"id": "str", "revision": 0}, "subnetIds": [{"id": "str"}], }, - "elasticityProfile": {"maxReadyCapacity": 0, "refillPolicy": "str"}, + "elasticityProfile": { + "maxReadyCapacity": 0, + "dynamicSizing": {"enabled": bool}, + "refillPolicy": "str", + }, "provisioningState": "str", "zones": ["str"], }, @@ -92,7 +96,11 @@ async def test_standby_container_group_pools_update(self, resource_group): "containerGroupProfile": {"id": "str", "revision": 0}, "subnetIds": [{"id": "str"}], }, - "elasticityProfile": {"maxReadyCapacity": 0, "refillPolicy": "str"}, + "elasticityProfile": { + "maxReadyCapacity": 0, + "dynamicSizing": {"enabled": bool}, + "refillPolicy": "str", + }, "zones": ["str"], }, "tags": {"str": "str"}, diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations.py b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations.py index 631bc6c80a84..c289f9c01acf 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations.py @@ -42,7 +42,12 @@ def test_standby_virtual_machine_pools_begin_create_or_update(self, resource_gro "properties": { "virtualMachineState": "str", "attachedVirtualMachineScaleSetId": "str", - "elasticityProfile": {"maxReadyCapacity": 0, "minReadyCapacity": 0}, + "elasticityProfile": { + "maxReadyCapacity": 0, + "dynamicSizing": {"enabled": bool}, + "minReadyCapacity": 0, + "postProvisioningDelay": "str", + }, "provisioningState": "str", }, "systemData": { @@ -81,7 +86,12 @@ def test_standby_virtual_machine_pools_update(self, resource_group): properties={ "properties": { "attachedVirtualMachineScaleSetId": "str", - "elasticityProfile": {"maxReadyCapacity": 0, "minReadyCapacity": 0}, + "elasticityProfile": { + "maxReadyCapacity": 0, + "dynamicSizing": {"enabled": bool}, + "minReadyCapacity": 0, + "postProvisioningDelay": "str", + }, "virtualMachineState": "str", }, "tags": {"str": "str"}, diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async.py b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async.py index 7649f28bdb4b..77d4a326544e 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async.py @@ -44,7 +44,12 @@ async def test_standby_virtual_machine_pools_begin_create_or_update(self, resour "properties": { "virtualMachineState": "str", "attachedVirtualMachineScaleSetId": "str", - "elasticityProfile": {"maxReadyCapacity": 0, "minReadyCapacity": 0}, + "elasticityProfile": { + "maxReadyCapacity": 0, + "dynamicSizing": {"enabled": bool}, + "minReadyCapacity": 0, + "postProvisioningDelay": "str", + }, "provisioningState": "str", }, "systemData": { @@ -86,7 +91,12 @@ async def test_standby_virtual_machine_pools_update(self, resource_group): properties={ "properties": { "attachedVirtualMachineScaleSetId": "str", - "elasticityProfile": {"maxReadyCapacity": 0, "minReadyCapacity": 0}, + "elasticityProfile": { + "maxReadyCapacity": 0, + "dynamicSizing": {"enabled": bool}, + "minReadyCapacity": 0, + "postProvisioningDelay": "str", + }, "virtualMachineState": "str", }, "tags": {"str": "str"}, diff --git a/sdk/standbypool/azure-mgmt-standbypool/pyproject.toml b/sdk/standbypool/azure-mgmt-standbypool/pyproject.toml index 540da07d41af..c061e6506c9a 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/pyproject.toml +++ b/sdk/standbypool/azure-mgmt-standbypool/pyproject.toml @@ -1,6 +1,88 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-standbypool" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Standbypool Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", +] +requires-python = ">=3.9" +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.standbypool._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-standbypool" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Standbypool Management" +package_doc_id = "" +is_stable = true +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +exclude_folders = "" +title = "StandbyPoolMgmtClient" diff --git a/sdk/standbypool/azure-mgmt-standbypool/sdk_packaging.toml b/sdk/standbypool/azure-mgmt-standbypool/sdk_packaging.toml deleted file mode 100644 index 8bc9e445a342..000000000000 --- a/sdk/standbypool/azure-mgmt-standbypool/sdk_packaging.toml +++ /dev/null @@ -1,12 +0,0 @@ -[packaging] -package_name = "azure-mgmt-standbypool" -package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "Standbypool Management" -package_doc_id = "" -is_stable = true -is_arm = true -need_msrestazure = false -need_azuremgmtcore = true -sample_link = "" -exclude_folders = "" -title = "StandbyPoolMgmtClient" diff --git a/sdk/standbypool/azure-mgmt-standbypool/setup.py b/sdk/standbypool/azure-mgmt-standbypool/setup.py deleted file mode 100644 index da184f127ffb..000000000000 --- a/sdk/standbypool/azure-mgmt-standbypool/setup.py +++ /dev/null @@ -1,82 +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-standbypool" -PACKAGE_PPRINT_NAME = "Standbypool 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.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.9", -) diff --git a/sdk/standbypool/azure-mgmt-standbypool/tsp-location.yaml b/sdk/standbypool/azure-mgmt-standbypool/tsp-location.yaml index 5f8a4ecb7b38..36e99d73d137 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/tsp-location.yaml +++ b/sdk/standbypool/azure-mgmt-standbypool/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/standbypool/StandbyPool.Management -commit: 525c8c6cebc5837606cb14cfcb0afdb4f2f17fa9 +commit: 856e8ce58dbf26fda36a11548a07974d1afa3814 repo: Azure/azure-rest-api-specs additionalDirectories: