diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/CHANGELOG.md b/sdk/computeschedule/azure-mgmt-computeschedule/CHANGELOG.md index 92070b02c488..b8c66651257e 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/CHANGELOG.md +++ b/sdk/computeschedule/azure-mgmt-computeschedule/CHANGELOG.md @@ -1,5 +1,55 @@ # Release History +## 1.2.0b2 (2026-03-17) + +### Features Added + + - Model `ComputeScheduleMgmtClient` added parameter `cloud_setting` in method `__init__` + - Model `ResourceOperationDetails` added property `fallback_operation_info` + - Enum `ResourceOperationType` added member `CREATE` + - Enum `ResourceOperationType` added member `DELETE` + - Model `RetryPolicy` added property `on_failure_action` + - Added enum `AllocationStrategy` + - Added model `CancelOperationsContent` + - Added model `CreateFlexResourceOperationResponse` + - Added enum `DistributionStrategy` + - Added model `ExecuteCreateContent` + - Added model `ExecuteCreateFlexRequest` + - Added model `ExecuteDeallocateContent` + - Added model `ExecuteDeleteContent` + - Added model `ExecuteHibernateContent` + - Added model `ExecuteStartContent` + - Added model `FallbackOperationInfo` + - Added model `FlexProperties` + - Added model `GetOperationErrorsContent` + - Added model `GetOperationStatusContent` + - Added enum `OsType` + - Added model `PriorityProfile` + - Added enum `PriorityType` + - Added model `ResourceProvisionFlexPayload` + - Added model `ScheduledActionsExtensionProperties` + - Added model `SubmitDeallocateContent` + - Added model `SubmitHibernateContent` + - Added model `SubmitStartContent` + - Added model `VmSizeProfile` + - Added model `ZoneAllocationPolicy` + - Added model `ZonePreference` + - Model `ScheduledActionsOperations` added method `virtual_machines_execute_create_flex` + +### Breaking Changes + + - Deleted or renamed model `CancelOperationsRequest` + - Deleted or renamed model `ExecuteCreateRequest` + - Deleted or renamed model `ExecuteDeallocateRequest` + - Deleted or renamed model `ExecuteDeleteRequest` + - Deleted or renamed model `ExecuteHibernateRequest` + - Deleted or renamed model `ExecuteStartRequest` + - Deleted or renamed model `GetOperationErrorsRequest` + - Deleted or renamed model `GetOperationStatusRequest` + - Deleted or renamed model `SubmitDeallocateRequest` + - Deleted or renamed model `SubmitHibernateRequest` + - Deleted or renamed model `SubmitStartRequest` + ## 1.2.0b1 (2025-07-24) ### Features Added diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/MANIFEST.in b/sdk/computeschedule/azure-mgmt-computeschedule/MANIFEST.in index 4ce078d2d688..10439f5f3698 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/MANIFEST.in +++ b/sdk/computeschedule/azure-mgmt-computeschedule/MANIFEST.in @@ -1,7 +1,7 @@ -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/computeschedule/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/_metadata.json b/sdk/computeschedule/azure-mgmt-computeschedule/_metadata.json index eeb144c1f469..27bfd3b24749 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/_metadata.json +++ b/sdk/computeschedule/azure-mgmt-computeschedule/_metadata.json @@ -1,7 +1,10 @@ { - "apiVersion": "2025-04-15-preview", - "commit": "a9b095e39f774899a97d857d92a34c7715dc3f42", + "apiVersion": "2026-03-01-preview", + "apiVersions": { + "Microsoft.ComputeSchedule": "2026-03-01-preview" + }, + "commit": "00f1feade1e5f3aab30ca03b547f77a869f52bf2", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/computeschedule/ComputeSchedule.Management", - "emitterVersion": "0.47.0" + "emitterVersion": "0.61.0" } \ No newline at end of file diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/apiview-properties.json b/sdk/computeschedule/azure-mgmt-computeschedule/apiview-properties.json index 919242b06627..ab3bf7b314dd 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/apiview-properties.json +++ b/sdk/computeschedule/azure-mgmt-computeschedule/apiview-properties.json @@ -2,8 +2,9 @@ "CrossLanguagePackageId": "Microsoft.ComputeSchedule", "CrossLanguageDefinitionId": { "azure.mgmt.computeschedule.models.CancelOccurrenceRequest": "Microsoft.ComputeSchedule.CancelOccurrenceRequest", - "azure.mgmt.computeschedule.models.CancelOperationsRequest": "Microsoft.ComputeSchedule.CancelOperationsRequest", + "azure.mgmt.computeschedule.models.CancelOperationsContent": "Microsoft.ComputeSchedule.CancelOperationsRequest", "azure.mgmt.computeschedule.models.CancelOperationsResponse": "Microsoft.ComputeSchedule.CancelOperationsResponse", + "azure.mgmt.computeschedule.models.CreateFlexResourceOperationResponse": "Microsoft.ComputeSchedule.CreateFlexResourceOperationResponse", "azure.mgmt.computeschedule.models.CreateResourceOperationResponse": "Microsoft.ComputeSchedule.CreateResourceOperationResponse", "azure.mgmt.computeschedule.models.DeallocateResourceOperationResponse": "Microsoft.ComputeSchedule.DeallocateResourceOperationResponse", "azure.mgmt.computeschedule.models.DelayRequest": "Microsoft.ComputeSchedule.DelayRequest", @@ -11,17 +12,20 @@ "azure.mgmt.computeschedule.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", "azure.mgmt.computeschedule.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", "azure.mgmt.computeschedule.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", - "azure.mgmt.computeschedule.models.ExecuteCreateRequest": "Microsoft.ComputeSchedule.ExecuteCreateRequest", - "azure.mgmt.computeschedule.models.ExecuteDeallocateRequest": "Microsoft.ComputeSchedule.ExecuteDeallocateRequest", - "azure.mgmt.computeschedule.models.ExecuteDeleteRequest": "Microsoft.ComputeSchedule.ExecuteDeleteRequest", - "azure.mgmt.computeschedule.models.ExecuteHibernateRequest": "Microsoft.ComputeSchedule.ExecuteHibernateRequest", - "azure.mgmt.computeschedule.models.ExecuteStartRequest": "Microsoft.ComputeSchedule.ExecuteStartRequest", + "azure.mgmt.computeschedule.models.ExecuteCreateContent": "Microsoft.ComputeSchedule.ExecuteCreateRequest", + "azure.mgmt.computeschedule.models.ExecuteCreateFlexRequest": "Microsoft.ComputeSchedule.ExecuteCreateFlexRequest", + "azure.mgmt.computeschedule.models.ExecuteDeallocateContent": "Microsoft.ComputeSchedule.ExecuteDeallocateRequest", + "azure.mgmt.computeschedule.models.ExecuteDeleteContent": "Microsoft.ComputeSchedule.ExecuteDeleteRequest", + "azure.mgmt.computeschedule.models.ExecuteHibernateContent": "Microsoft.ComputeSchedule.ExecuteHibernateRequest", + "azure.mgmt.computeschedule.models.ExecuteStartContent": "Microsoft.ComputeSchedule.ExecuteStartRequest", "azure.mgmt.computeschedule.models.ExecutionParameters": "Microsoft.ComputeSchedule.ExecutionParameters", "azure.mgmt.computeschedule.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", "azure.mgmt.computeschedule.models.ExtensionResource": "Azure.ResourceManager.CommonTypes.ExtensionResource", - "azure.mgmt.computeschedule.models.GetOperationErrorsRequest": "Microsoft.ComputeSchedule.GetOperationErrorsRequest", + "azure.mgmt.computeschedule.models.FallbackOperationInfo": "Microsoft.ComputeSchedule.FallbackOperationInfo", + "azure.mgmt.computeschedule.models.FlexProperties": "Microsoft.ComputeSchedule.FlexProperties", + "azure.mgmt.computeschedule.models.GetOperationErrorsContent": "Microsoft.ComputeSchedule.GetOperationErrorsRequest", "azure.mgmt.computeschedule.models.GetOperationErrorsResponse": "Microsoft.ComputeSchedule.GetOperationErrorsResponse", - "azure.mgmt.computeschedule.models.GetOperationStatusRequest": "Microsoft.ComputeSchedule.GetOperationStatusRequest", + "azure.mgmt.computeschedule.models.GetOperationStatusContent": "Microsoft.ComputeSchedule.GetOperationStatusRequest", "azure.mgmt.computeschedule.models.GetOperationStatusResponse": "Microsoft.ComputeSchedule.GetOperationStatusResponse", "azure.mgmt.computeschedule.models.HibernateResourceOperationResponse": "Microsoft.ComputeSchedule.HibernateResourceOperationResponse", "azure.mgmt.computeschedule.models.NotificationProperties": "Microsoft.ComputeSchedule.NotificationProperties", @@ -36,6 +40,7 @@ "azure.mgmt.computeschedule.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", "azure.mgmt.computeschedule.models.OperationErrorDetails": "Microsoft.ComputeSchedule.OperationErrorDetails", "azure.mgmt.computeschedule.models.OperationErrorsResult": "Microsoft.ComputeSchedule.OperationErrorsResult", + "azure.mgmt.computeschedule.models.PriorityProfile": "Microsoft.ComputeSchedule.PriorityProfile", "azure.mgmt.computeschedule.models.RecurringActionsResourceOperationResult": "Microsoft.ComputeSchedule.ResourceOperationResponse", "azure.mgmt.computeschedule.models.ResourceAttachRequest": "Microsoft.ComputeSchedule.ResourceAttachRequest", "azure.mgmt.computeschedule.models.ResourceDetachRequest": "Microsoft.ComputeSchedule.ResourceDetachRequest", @@ -43,6 +48,7 @@ "azure.mgmt.computeschedule.models.ResourceOperationDetails": "Microsoft.ComputeSchedule.ResourceOperationDetails", "azure.mgmt.computeschedule.models.ResourceOperationError": "Microsoft.ComputeSchedule.ResourceOperationError", "azure.mgmt.computeschedule.models.ResourcePatchRequest": "Microsoft.ComputeSchedule.ResourcePatchRequest", + "azure.mgmt.computeschedule.models.ResourceProvisionFlexPayload": "Microsoft.ComputeSchedule.ResourceProvisionFlexPayload", "azure.mgmt.computeschedule.models.ResourceProvisionPayload": "Microsoft.ComputeSchedule.ResourceProvisionPayload", "azure.mgmt.computeschedule.models.ResourceResultSummary": "Microsoft.ComputeSchedule.ResourceResultSummary", "azure.mgmt.computeschedule.models.Resources": "Microsoft.ComputeSchedule.Resources", @@ -54,20 +60,28 @@ "azure.mgmt.computeschedule.models.ScheduledActionProperties": "Microsoft.ComputeSchedule.ScheduledActionProperties", "azure.mgmt.computeschedule.models.ScheduledActionResource": "Microsoft.ComputeSchedule.ScheduledActionResource", "azure.mgmt.computeschedule.models.ScheduledActionResources": "Microsoft.ComputeSchedule.ScheduledActionResources", + "azure.mgmt.computeschedule.models.ScheduledActionsExtensionProperties": "Microsoft.ComputeSchedule.ScheduledActionsExtensionProperties", "azure.mgmt.computeschedule.models.ScheduledActionsSchedule": "Microsoft.ComputeSchedule.ScheduledActionsSchedule", "azure.mgmt.computeschedule.models.ScheduledActionUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", "azure.mgmt.computeschedule.models.ScheduledActionUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", "azure.mgmt.computeschedule.models.StartResourceOperationResponse": "Microsoft.ComputeSchedule.StartResourceOperationResponse", - "azure.mgmt.computeschedule.models.SubmitDeallocateRequest": "Microsoft.ComputeSchedule.SubmitDeallocateRequest", - "azure.mgmt.computeschedule.models.SubmitHibernateRequest": "Microsoft.ComputeSchedule.SubmitHibernateRequest", - "azure.mgmt.computeschedule.models.SubmitStartRequest": "Microsoft.ComputeSchedule.SubmitStartRequest", + "azure.mgmt.computeschedule.models.SubmitDeallocateContent": "Microsoft.ComputeSchedule.SubmitDeallocateRequest", + "azure.mgmt.computeschedule.models.SubmitHibernateContent": "Microsoft.ComputeSchedule.SubmitHibernateRequest", + "azure.mgmt.computeschedule.models.SubmitStartContent": "Microsoft.ComputeSchedule.SubmitStartRequest", "azure.mgmt.computeschedule.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.computeschedule.models.VmSizeProfile": "Microsoft.ComputeSchedule.VmSizeProfile", + "azure.mgmt.computeschedule.models.ZoneAllocationPolicy": "Microsoft.ComputeSchedule.ZoneAllocationPolicy", + "azure.mgmt.computeschedule.models.ZonePreference": "Microsoft.ComputeSchedule.ZonePreference", "azure.mgmt.computeschedule.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", "azure.mgmt.computeschedule.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", "azure.mgmt.computeschedule.models.ResourceOperationType": "Microsoft.ComputeSchedule.ResourceOperationType", "azure.mgmt.computeschedule.models.DeadlineType": "Microsoft.ComputeSchedule.DeadlineType", "azure.mgmt.computeschedule.models.OperationState": "Microsoft.ComputeSchedule.OperationState", "azure.mgmt.computeschedule.models.OptimizationPreference": "Microsoft.ComputeSchedule.OptimizationPreference", + "azure.mgmt.computeschedule.models.OsType": "Microsoft.ComputeSchedule.OsType", + "azure.mgmt.computeschedule.models.PriorityType": "Microsoft.ComputeSchedule.PriorityType", + "azure.mgmt.computeschedule.models.AllocationStrategy": "Microsoft.ComputeSchedule.AllocationStrategy", + "azure.mgmt.computeschedule.models.DistributionStrategy": "Microsoft.ComputeSchedule.DistributionStrategy", "azure.mgmt.computeschedule.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", "azure.mgmt.computeschedule.models.ResourceType": "Microsoft.ComputeSchedule.ResourceType", "azure.mgmt.computeschedule.models.ScheduledActionType": "Microsoft.ComputeSchedule.ActionType", @@ -93,6 +107,8 @@ "azure.mgmt.computeschedule.aio.operations.ScheduledActionsOperations.virtual_machines_execute_hibernate": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteHibernate", "azure.mgmt.computeschedule.operations.ScheduledActionsOperations.virtual_machines_execute_start": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteStart", "azure.mgmt.computeschedule.aio.operations.ScheduledActionsOperations.virtual_machines_execute_start": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteStart", + "azure.mgmt.computeschedule.operations.ScheduledActionsOperations.virtual_machines_execute_create_flex": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteCreateFlex", + "azure.mgmt.computeschedule.aio.operations.ScheduledActionsOperations.virtual_machines_execute_create_flex": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteCreateFlex", "azure.mgmt.computeschedule.operations.ScheduledActionsOperations.virtual_machines_execute_create": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteCreate", "azure.mgmt.computeschedule.aio.operations.ScheduledActionsOperations.virtual_machines_execute_create": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteCreate", "azure.mgmt.computeschedule.operations.ScheduledActionsOperations.virtual_machines_execute_delete": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteDelete", diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/__init__.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/__init__.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/__init__.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/__init__.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_client.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_client.py index 4bc6257d8a87..9f847edf7ebb 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_client.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_client.py @@ -28,6 +28,7 @@ ) if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -52,19 +53,28 @@ class ComputeScheduleMgmtClient: :type subscription_id: str :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-04-15-preview". 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 + "2026-03-01-preview" and None. Default value is "2026-03-01-preview". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any + self, + credential: "TokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any ) -> None: _endpoint = "{endpoint}" - _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: base_url = _endpoints["resource_manager"] @@ -73,6 +83,7 @@ def __init__( credential=credential, subscription_id=subscription_id, base_url=cast(str, base_url), + cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs ) diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_configuration.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_configuration.py index 4a9cbf0fa48e..2f48cc1e5707 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_configuration.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_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,9 +30,12 @@ class ComputeScheduleMgmtClientConfiguration: # pylint: disable=too-many-instan :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-04-15-preview". 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 + "2026-03-01-preview" and None. Default value is "2026-03-01-preview". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ @@ -40,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-04-15-preview") + api_version: str = kwargs.pop("api_version", "2026-03-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -52,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-computeschedule/{}".format(VERSION)) diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_patch.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_patch.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_utils/model_base.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_utils/model_base.py index 49d5c7259389..7b7f8ba67b53 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_utils/model_base.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_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__ @@ -579,6 +630,9 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if len(items) > 0: existed_attr_keys.append(xml_name) dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = [] continue # text element is primitive type @@ -623,7 +677,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 +692,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 +734,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 +794,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 +804,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 +813,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 +830,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 +893,18 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur # is it optional? try: - if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True if len(annotation.__args__) <= 2: # pyright: ignore if_obj_deserializer = _get_deserialize_callable_from_annotation( - next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore ) return functools.partial(_deserialize_with_optional, if_obj_deserializer) # the type is Optional[Union[...]], we need to remove the None type from the Union annotation_copy = copy.copy(annotation) - annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) except AttributeError: pass @@ -843,7 +920,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 +936,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 +988,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 +1027,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,17 +1043,18 @@ def _failsafe_deserialize( def _failsafe_deserialize_xml( deserializer: typing.Any, - value: typing.Any, + response: HttpResponse, ) -> typing.Any: try: - return _deserialize_xml(deserializer, value) - except DeserializationError: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) return None +# pylint: disable=too-many-instance-attributes class _RestField: def __init__( self, @@ -974,11 +1062,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 @@ -986,6 +1074,7 @@ def __init__( self._is_discriminator = is_discriminator self._visibility = visibility self._is_model = False + self._is_optional = False self._default = default self._format = format self._is_multipart_file_input = is_multipart_file_input @@ -993,7 +1082,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 +1097,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 +1152,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 +1173,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 +1193,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 +1284,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 +1295,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 +1308,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 +1329,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 +1342,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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_utils/serialization.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_utils/serialization.py index eb86ea23c965..81ec1de5922b 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_utils/serialization.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_version.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_version.py index 5bf479b145f7..a8cca866f40a 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_version.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.2.0b1" +VERSION = "1.2.0b2" diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_client.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_client.py index 72f9b1931d9e..121efc81aec1 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_client.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_client.py @@ -28,6 +28,7 @@ ) if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -53,19 +54,28 @@ class ComputeScheduleMgmtClient: :type subscription_id: str :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-04-15-preview". 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 + "2026-03-01-preview" and None. Default value is "2026-03-01-preview". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any ) -> None: _endpoint = "{endpoint}" - _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: base_url = _endpoints["resource_manager"] @@ -74,6 +84,7 @@ def __init__( credential=credential, subscription_id=subscription_id, base_url=cast(str, base_url), + cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs ) diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_configuration.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_configuration.py index d9853890ac34..d2b553513f18 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_configuration.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/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,9 +30,12 @@ class ComputeScheduleMgmtClientConfiguration: # pylint: disable=too-many-instan :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-04-15-preview". 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 + "2026-03-01-preview" and None. Default value is "2026-03-01-preview". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ @@ -40,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-04-15-preview") + api_version: str = kwargs.pop("api_version", "2026-03-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -52,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-computeschedule/{}".format(VERSION)) diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_patch.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_patch.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/_operations.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/_operations.py index 6adc8f3234f6..09064f20316f 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/_operations.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, 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 @@ -61,6 +61,7 @@ build_scheduled_actions_trigger_manual_occurrence_request, build_scheduled_actions_update_request, build_scheduled_actions_virtual_machines_cancel_operations_request, + build_scheduled_actions_virtual_machines_execute_create_flex_request, build_scheduled_actions_virtual_machines_execute_create_request, build_scheduled_actions_virtual_machines_execute_deallocate_request, build_scheduled_actions_virtual_machines_execute_delete_request, @@ -75,8 +76,9 @@ from .._configuration import ComputeScheduleMgmtClientConfiguration 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: @@ -156,7 +158,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) @@ -172,7 +177,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 @@ -201,7 +209,7 @@ def __init__(self, *args, **kwargs) -> None: async def virtual_machines_submit_deallocate( self, locationparameter: str, - request_body: _models.SubmitDeallocateRequest, + request_body: _models.SubmitDeallocateContent, *, content_type: str = "application/json", **kwargs: Any @@ -212,7 +220,7 @@ async def virtual_machines_submit_deallocate( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.SubmitDeallocateRequest + :type request_body: ~azure.mgmt.computeschedule.models.SubmitDeallocateContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -266,7 +274,7 @@ async def virtual_machines_submit_deallocate( async def virtual_machines_submit_deallocate( self, locationparameter: str, - request_body: Union[_models.SubmitDeallocateRequest, JSON, IO[bytes]], + request_body: Union[_models.SubmitDeallocateContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: """VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines @@ -274,9 +282,9 @@ async def virtual_machines_submit_deallocate( :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: SubmitDeallocateRequest, + :param request_body: The request body. Is one of the following types: SubmitDeallocateContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.SubmitDeallocateRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.SubmitDeallocateContent or JSON or IO[bytes] :return: DeallocateResourceOperationResponse. The DeallocateResourceOperationResponse is compatible with MutableMapping @@ -318,6 +326,7 @@ async def virtual_machines_submit_deallocate( } _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 @@ -332,11 +341,14 @@ async def virtual_machines_submit_deallocate( 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.DeallocateResourceOperationResponse, response.json()) @@ -349,7 +361,7 @@ async def virtual_machines_submit_deallocate( async def virtual_machines_submit_hibernate( self, locationparameter: str, - request_body: _models.SubmitHibernateRequest, + request_body: _models.SubmitHibernateContent, *, content_type: str = "application/json", **kwargs: Any @@ -360,7 +372,7 @@ async def virtual_machines_submit_hibernate( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.SubmitHibernateRequest + :type request_body: ~azure.mgmt.computeschedule.models.SubmitHibernateContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -414,7 +426,7 @@ async def virtual_machines_submit_hibernate( async def virtual_machines_submit_hibernate( self, locationparameter: str, - request_body: Union[_models.SubmitHibernateRequest, JSON, IO[bytes]], + request_body: Union[_models.SubmitHibernateContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.HibernateResourceOperationResponse: """VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at @@ -422,9 +434,9 @@ async def virtual_machines_submit_hibernate( :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: SubmitHibernateRequest, + :param request_body: The request body. Is one of the following types: SubmitHibernateContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.SubmitHibernateRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.SubmitHibernateContent or JSON or IO[bytes] :return: HibernateResourceOperationResponse. The HibernateResourceOperationResponse is compatible with MutableMapping @@ -466,6 +478,7 @@ async def virtual_machines_submit_hibernate( } _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 @@ -480,11 +493,14 @@ async def virtual_machines_submit_hibernate( 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.HibernateResourceOperationResponse, response.json()) @@ -497,7 +513,7 @@ async def virtual_machines_submit_hibernate( async def virtual_machines_submit_start( self, locationparameter: str, - request_body: _models.SubmitStartRequest, + request_body: _models.SubmitStartContent, *, content_type: str = "application/json", **kwargs: Any @@ -508,7 +524,7 @@ async def virtual_machines_submit_start( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.SubmitStartRequest + :type request_body: ~azure.mgmt.computeschedule.models.SubmitStartContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -560,16 +576,16 @@ async def virtual_machines_submit_start( @distributed_trace_async async def virtual_machines_submit_start( - self, locationparameter: str, request_body: Union[_models.SubmitStartRequest, JSON, IO[bytes]], **kwargs: Any + self, locationparameter: str, request_body: Union[_models.SubmitStartContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.StartResourceOperationResponse: """VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: SubmitStartRequest, JSON, + :param request_body: The request body. Is one of the following types: SubmitStartContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.SubmitStartRequest or JSON or IO[bytes] + :type request_body: ~azure.mgmt.computeschedule.models.SubmitStartContent or JSON or IO[bytes] :return: StartResourceOperationResponse. The StartResourceOperationResponse is compatible with MutableMapping :rtype: ~azure.mgmt.computeschedule.models.StartResourceOperationResponse @@ -610,6 +626,7 @@ async def virtual_machines_submit_start( } _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 @@ -624,11 +641,14 @@ async def virtual_machines_submit_start( 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.StartResourceOperationResponse, response.json()) @@ -641,7 +661,7 @@ async def virtual_machines_submit_start( async def virtual_machines_execute_deallocate( self, locationparameter: str, - request_body: _models.ExecuteDeallocateRequest, + request_body: _models.ExecuteDeallocateContent, *, content_type: str = "application/json", **kwargs: Any @@ -652,7 +672,7 @@ async def virtual_machines_execute_deallocate( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeallocateRequest + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeallocateContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -706,7 +726,7 @@ async def virtual_machines_execute_deallocate( async def virtual_machines_execute_deallocate( self, locationparameter: str, - request_body: Union[_models.ExecuteDeallocateRequest, JSON, IO[bytes]], + request_body: Union[_models.ExecuteDeallocateContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: """VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, @@ -714,9 +734,9 @@ async def virtual_machines_execute_deallocate( :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: ExecuteDeallocateRequest, + :param request_body: The request body. Is one of the following types: ExecuteDeallocateContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeallocateRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeallocateContent or JSON or IO[bytes] :return: DeallocateResourceOperationResponse. The DeallocateResourceOperationResponse is compatible with MutableMapping @@ -758,6 +778,7 @@ async def virtual_machines_execute_deallocate( } _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 @@ -772,11 +793,14 @@ async def virtual_machines_execute_deallocate( 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.DeallocateResourceOperationResponse, response.json()) @@ -789,7 +813,7 @@ async def virtual_machines_execute_deallocate( async def virtual_machines_execute_hibernate( self, locationparameter: str, - request_body: _models.ExecuteHibernateRequest, + request_body: _models.ExecuteHibernateContent, *, content_type: str = "application/json", **kwargs: Any @@ -800,7 +824,7 @@ async def virtual_machines_execute_hibernate( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteHibernateRequest + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteHibernateContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -854,7 +878,7 @@ async def virtual_machines_execute_hibernate( async def virtual_machines_execute_hibernate( self, locationparameter: str, - request_body: Union[_models.ExecuteHibernateRequest, JSON, IO[bytes]], + request_body: Union[_models.ExecuteHibernateContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.HibernateResourceOperationResponse: """VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, @@ -862,9 +886,9 @@ async def virtual_machines_execute_hibernate( :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: ExecuteHibernateRequest, + :param request_body: The request body. Is one of the following types: ExecuteHibernateContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteHibernateRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteHibernateContent or JSON or IO[bytes] :return: HibernateResourceOperationResponse. The HibernateResourceOperationResponse is compatible with MutableMapping @@ -906,6 +930,7 @@ async def virtual_machines_execute_hibernate( } _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 @@ -920,11 +945,14 @@ async def virtual_machines_execute_hibernate( 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.HibernateResourceOperationResponse, response.json()) @@ -937,7 +965,7 @@ async def virtual_machines_execute_hibernate( async def virtual_machines_execute_start( self, locationparameter: str, - request_body: _models.ExecuteStartRequest, + request_body: _models.ExecuteStartContent, *, content_type: str = "application/json", **kwargs: Any @@ -948,7 +976,7 @@ async def virtual_machines_execute_start( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteStartRequest + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteStartContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1000,16 +1028,16 @@ async def virtual_machines_execute_start( @distributed_trace_async async def virtual_machines_execute_start( - self, locationparameter: str, request_body: Union[_models.ExecuteStartRequest, JSON, IO[bytes]], **kwargs: Any + self, locationparameter: str, request_body: Union[_models.ExecuteStartContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.StartResourceOperationResponse: """VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: ExecuteStartRequest, + :param request_body: The request body. Is one of the following types: ExecuteStartContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteStartRequest or JSON or IO[bytes] + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteStartContent or JSON or IO[bytes] :return: StartResourceOperationResponse. The StartResourceOperationResponse is compatible with MutableMapping :rtype: ~azure.mgmt.computeschedule.models.StartResourceOperationResponse @@ -1050,6 +1078,7 @@ async def virtual_machines_execute_start( } _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 @@ -1064,11 +1093,14 @@ async def virtual_machines_execute_start( 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.StartResourceOperationResponse, response.json()) @@ -1077,22 +1109,177 @@ async def virtual_machines_execute_start( return deserialized # type: ignore + @overload + async def virtual_machines_execute_create_flex( + self, + locationparameter: str, + body: _models.ExecuteCreateFlexRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CreateFlexResourceOperationResponse: + """VirtualMachinesExecuteCreateFlex: Execute create operation for a batch of virtual machines with + flex properties, this operation is triggered as soon as Computeschedule receives it. + + :param locationparameter: The location name. Required. + :type locationparameter: str + :param body: The request body. Required. + :type body: ~azure.mgmt.computeschedule.models.ExecuteCreateFlexRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CreateFlexResourceOperationResponse. The CreateFlexResourceOperationResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.computeschedule.models.CreateFlexResourceOperationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def virtual_machines_execute_create_flex( + self, locationparameter: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CreateFlexResourceOperationResponse: + """VirtualMachinesExecuteCreateFlex: Execute create operation for a batch of virtual machines with + flex properties, this operation is triggered as soon as Computeschedule receives it. + + :param locationparameter: The location name. Required. + :type locationparameter: str + :param body: The request body. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CreateFlexResourceOperationResponse. The CreateFlexResourceOperationResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.computeschedule.models.CreateFlexResourceOperationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def virtual_machines_execute_create_flex( + self, locationparameter: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CreateFlexResourceOperationResponse: + """VirtualMachinesExecuteCreateFlex: Execute create operation for a batch of virtual machines with + flex properties, this operation is triggered as soon as Computeschedule receives it. + + :param locationparameter: The location name. Required. + :type locationparameter: str + :param body: The request body. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CreateFlexResourceOperationResponse. The CreateFlexResourceOperationResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.computeschedule.models.CreateFlexResourceOperationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-03-01-preview", + params_added_on={ + "2026-03-01-preview": ["api_version", "subscription_id", "locationparameter", "content_type", "accept"] + }, + api_versions_list=["2026-03-01-preview"], + ) + async def virtual_machines_execute_create_flex( + self, locationparameter: str, body: Union[_models.ExecuteCreateFlexRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.CreateFlexResourceOperationResponse: + """VirtualMachinesExecuteCreateFlex: Execute create operation for a batch of virtual machines with + flex properties, this operation is triggered as soon as Computeschedule receives it. + + :param locationparameter: The location name. Required. + :type locationparameter: str + :param body: The request body. Is one of the following types: ExecuteCreateFlexRequest, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.computeschedule.models.ExecuteCreateFlexRequest or JSON or IO[bytes] + :return: CreateFlexResourceOperationResponse. The CreateFlexResourceOperationResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.computeschedule.models.CreateFlexResourceOperationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CreateFlexResourceOperationResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_scheduled_actions_virtual_machines_execute_create_flex_request( + locationparameter=locationparameter, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _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 + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CreateFlexResourceOperationResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @overload async def virtual_machines_execute_create( self, locationparameter: str, - request_body: _models.ExecuteCreateRequest, + request_body: _models.ExecuteCreateContent, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateResourceOperationResponse: - """VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteCreate: Execute create operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteCreateRequest + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteCreateContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1106,8 +1293,8 @@ async def virtual_machines_execute_create( async def virtual_machines_execute_create( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateResourceOperationResponse: - """VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteCreate: Execute create operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1126,8 +1313,8 @@ async def virtual_machines_execute_create( async def virtual_machines_execute_create( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateResourceOperationResponse: - """VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteCreate: Execute create operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1148,19 +1335,19 @@ async def virtual_machines_execute_create( params_added_on={ "2025-05-01": ["api_version", "subscription_id", "locationparameter", "content_type", "accept"] }, - api_versions_list=["2025-05-01", "2025-04-15-preview"], + api_versions_list=["2025-05-01", "2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def virtual_machines_execute_create( - self, locationparameter: str, request_body: Union[_models.ExecuteCreateRequest, JSON, IO[bytes]], **kwargs: Any + self, locationparameter: str, request_body: Union[_models.ExecuteCreateContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.CreateResourceOperationResponse: - """VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteCreate: Execute create operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: ExecuteCreateRequest, + :param request_body: The request body. Is one of the following types: ExecuteCreateContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteCreateRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteCreateContent or JSON or IO[bytes] :return: CreateResourceOperationResponse. The CreateResourceOperationResponse is compatible with MutableMapping @@ -1202,6 +1389,7 @@ async def virtual_machines_execute_create( } _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 @@ -1216,11 +1404,14 @@ async def virtual_machines_execute_create( 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.CreateResourceOperationResponse, response.json()) @@ -1233,18 +1424,18 @@ async def virtual_machines_execute_create( async def virtual_machines_execute_delete( self, locationparameter: str, - request_body: _models.ExecuteDeleteRequest, + request_body: _models.ExecuteDeleteContent, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeleteResourceOperationResponse: - """VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteDelete: Execute delete operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeleteRequest + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeleteContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1258,8 +1449,8 @@ async def virtual_machines_execute_delete( async def virtual_machines_execute_delete( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeleteResourceOperationResponse: - """VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteDelete: Execute delete operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1278,8 +1469,8 @@ async def virtual_machines_execute_delete( async def virtual_machines_execute_delete( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeleteResourceOperationResponse: - """VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteDelete: Execute delete operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1300,19 +1491,19 @@ async def virtual_machines_execute_delete( params_added_on={ "2025-05-01": ["api_version", "subscription_id", "locationparameter", "content_type", "accept"] }, - api_versions_list=["2025-05-01", "2025-04-15-preview"], + api_versions_list=["2025-05-01", "2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def virtual_machines_execute_delete( - self, locationparameter: str, request_body: Union[_models.ExecuteDeleteRequest, JSON, IO[bytes]], **kwargs: Any + self, locationparameter: str, request_body: Union[_models.ExecuteDeleteContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.DeleteResourceOperationResponse: - """VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteDelete: Execute delete operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: ExecuteDeleteRequest, + :param request_body: The request body. Is one of the following types: ExecuteDeleteContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeleteRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeleteContent or JSON or IO[bytes] :return: DeleteResourceOperationResponse. The DeleteResourceOperationResponse is compatible with MutableMapping @@ -1354,6 +1545,7 @@ async def virtual_machines_execute_delete( } _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 @@ -1368,11 +1560,14 @@ async def virtual_machines_execute_delete( 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.DeleteResourceOperationResponse, response.json()) @@ -1385,7 +1580,7 @@ async def virtual_machines_execute_delete( async def virtual_machines_get_operation_status( self, locationparameter: str, - request_body: _models.GetOperationStatusRequest, + request_body: _models.GetOperationStatusContent, *, content_type: str = "application/json", **kwargs: Any @@ -1396,7 +1591,7 @@ async def virtual_machines_get_operation_status( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.GetOperationStatusRequest + :type request_body: ~azure.mgmt.computeschedule.models.GetOperationStatusContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1450,7 +1645,7 @@ async def virtual_machines_get_operation_status( async def virtual_machines_get_operation_status( self, locationparameter: str, - request_body: Union[_models.GetOperationStatusRequest, JSON, IO[bytes]], + request_body: Union[_models.GetOperationStatusContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.GetOperationStatusResponse: """VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on @@ -1459,8 +1654,8 @@ async def virtual_machines_get_operation_status( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Is one of the following types: - GetOperationStatusRequest, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.GetOperationStatusRequest or JSON or + GetOperationStatusContent, JSON, IO[bytes] Required. + :type request_body: ~azure.mgmt.computeschedule.models.GetOperationStatusContent or JSON or IO[bytes] :return: GetOperationStatusResponse. The GetOperationStatusResponse is compatible with MutableMapping @@ -1502,6 +1697,7 @@ async def virtual_machines_get_operation_status( } _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 @@ -1516,11 +1712,14 @@ async def virtual_machines_get_operation_status( 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.GetOperationStatusResponse, response.json()) @@ -1533,7 +1732,7 @@ async def virtual_machines_get_operation_status( async def virtual_machines_cancel_operations( self, locationparameter: str, - request_body: _models.CancelOperationsRequest, + request_body: _models.CancelOperationsContent, *, content_type: str = "application/json", **kwargs: Any @@ -1544,7 +1743,7 @@ async def virtual_machines_cancel_operations( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.CancelOperationsRequest + :type request_body: ~azure.mgmt.computeschedule.models.CancelOperationsContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1598,7 +1797,7 @@ async def virtual_machines_cancel_operations( async def virtual_machines_cancel_operations( self, locationparameter: str, - request_body: Union[_models.CancelOperationsRequest, JSON, IO[bytes]], + request_body: Union[_models.CancelOperationsContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.CancelOperationsResponse: """VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) @@ -1606,9 +1805,9 @@ async def virtual_machines_cancel_operations( :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: CancelOperationsRequest, + :param request_body: The request body. Is one of the following types: CancelOperationsContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.CancelOperationsRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.CancelOperationsContent or JSON or IO[bytes] :return: CancelOperationsResponse. The CancelOperationsResponse is compatible with MutableMapping @@ -1650,6 +1849,7 @@ async def virtual_machines_cancel_operations( } _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 @@ -1664,11 +1864,14 @@ async def virtual_machines_cancel_operations( 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.CancelOperationsResponse, response.json()) @@ -1681,7 +1884,7 @@ async def virtual_machines_cancel_operations( async def virtual_machines_get_operation_errors( self, locationparameter: str, - request_body: _models.GetOperationErrorsRequest, + request_body: _models.GetOperationErrorsContent, *, content_type: str = "application/json", **kwargs: Any @@ -1692,7 +1895,7 @@ async def virtual_machines_get_operation_errors( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.GetOperationErrorsRequest + :type request_body: ~azure.mgmt.computeschedule.models.GetOperationErrorsContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1746,7 +1949,7 @@ async def virtual_machines_get_operation_errors( async def virtual_machines_get_operation_errors( self, locationparameter: str, - request_body: Union[_models.GetOperationErrorsRequest, JSON, IO[bytes]], + request_body: Union[_models.GetOperationErrorsContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.GetOperationErrorsResponse: """VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors @@ -1755,8 +1958,8 @@ async def virtual_machines_get_operation_errors( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Is one of the following types: - GetOperationErrorsRequest, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.GetOperationErrorsRequest or JSON or + GetOperationErrorsContent, JSON, IO[bytes] Required. + :type request_body: ~azure.mgmt.computeschedule.models.GetOperationErrorsContent or JSON or IO[bytes] :return: GetOperationErrorsResponse. The GetOperationErrorsResponse is compatible with MutableMapping @@ -1798,6 +2001,7 @@ async def virtual_machines_get_operation_errors( } _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 @@ -1812,11 +2016,14 @@ async def virtual_machines_get_operation_errors( 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.GetOperationErrorsResponse, response.json()) @@ -1837,7 +2044,7 @@ async def virtual_machines_get_operation_errors( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def get(self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any) -> _models.ScheduledAction: """Get a ScheduledAction. @@ -1877,6 +2084,7 @@ async def get(self, resource_group_name: str, scheduled_action_name: str, **kwar } _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 @@ -1891,11 +2099,14 @@ async def get(self, resource_group_name: str, scheduled_action_name: str, **kwar 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.ScheduledAction, response.json()) @@ -1916,7 +2127,7 @@ async def get(self, resource_group_name: str, scheduled_action_name: str, **kwar "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def _create_or_update_initial( self, @@ -1961,6 +2172,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 @@ -1974,7 +2186,10 @@ 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 = {} @@ -1984,7 +2199,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2088,7 +2303,7 @@ async def begin_create_or_update( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def begin_create_or_update( self, @@ -2258,7 +2473,7 @@ async def update( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def update( self, @@ -2317,6 +2532,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 @@ -2331,11 +2547,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.ScheduledAction, response.json()) @@ -2347,15 +2566,9 @@ async def update( @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={ - "2025-04-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduled_action_name", - "accept", - ] + "2025-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "scheduled_action_name"] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def _delete_initial( self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any @@ -2386,6 +2599,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 @@ -2399,7 +2613,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 = {} @@ -2407,7 +2624,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 @@ -2418,15 +2635,9 @@ async def _delete_initial( @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={ - "2025-04-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduled_action_name", - "accept", - ] + "2025-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "scheduled_action_name"] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def begin_delete( self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any @@ -2490,7 +2701,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={"2025-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_by_resource_group( self, resource_group_name: str, **kwargs: Any @@ -2559,7 +2770,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.ScheduledAction], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ScheduledAction], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2575,7 +2789,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 @@ -2586,7 +2803,7 @@ async def get_next(next_link=None): @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={"2025-04-15-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.ScheduledAction"]: """List ScheduledAction resources by subscription ID. @@ -2649,7 +2866,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.ScheduledAction], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ScheduledAction], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2665,7 +2885,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 @@ -2684,7 +2907,7 @@ async def get_next(next_link=None): "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_resources( self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any @@ -2756,7 +2979,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.ScheduledActionResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ScheduledActionResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2772,7 +2998,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 @@ -2876,7 +3105,7 @@ async def attach_resources( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def attach_resources( self, @@ -2936,6 +3165,7 @@ async def attach_resources( } _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 @@ -2950,11 +3180,14 @@ async def attach_resources( 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.RecurringActionsResourceOperationResult, response.json()) @@ -3060,7 +3293,7 @@ async def detach_resources( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def detach_resources( self, @@ -3120,6 +3353,7 @@ async def detach_resources( } _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 @@ -3134,11 +3368,14 @@ async def detach_resources( 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.RecurringActionsResourceOperationResult, response.json()) @@ -3244,7 +3481,7 @@ async def patch_resources( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def patch_resources( self, @@ -3304,6 +3541,7 @@ async def patch_resources( } _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 @@ -3318,11 +3556,14 @@ async def patch_resources( 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.RecurringActionsResourceOperationResult, response.json()) @@ -3335,15 +3576,9 @@ async def patch_resources( @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={ - "2025-04-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduled_action_name", - "accept", - ] + "2025-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "scheduled_action_name"] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def disable(self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any) -> None: """A synchronous resource action. @@ -3392,7 +3627,10 @@ async def disable(self, resource_group_name: str, scheduled_action_name: str, ** 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) if cls: @@ -3402,15 +3640,9 @@ async def disable(self, resource_group_name: str, scheduled_action_name: str, ** @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={ - "2025-04-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduled_action_name", - "accept", - ] + "2025-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "scheduled_action_name"] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def enable(self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any) -> None: """A synchronous resource action. @@ -3459,7 +3691,10 @@ async def enable(self, resource_group_name: str, scheduled_action_name: str, **k 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) if cls: @@ -3562,7 +3797,7 @@ async def cancel_next_occurrence( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def cancel_next_occurrence( self, @@ -3622,6 +3857,7 @@ async def cancel_next_occurrence( } _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 @@ -3636,11 +3872,14 @@ async def cancel_next_occurrence( 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.RecurringActionsResourceOperationResult, response.json()) @@ -3661,7 +3900,7 @@ async def cancel_next_occurrence( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def trigger_manual_occurrence( self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any @@ -3703,6 +3942,7 @@ async def trigger_manual_occurrence( } _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 @@ -3717,11 +3957,14 @@ async def trigger_manual_occurrence( 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.Occurrence, response.json()) @@ -3752,7 +3995,7 @@ def __init__(self, *args, **kwargs) -> None: @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={"2025-04-15-preview": ["api_version", "resource_uri", "accept"]}, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_by_vms(self, resource_uri: str, **kwargs: Any) -> AsyncItemPaged["_models.ScheduledActionResources"]: """List ScheduledActionResources resources by parent. @@ -3818,7 +4061,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.ScheduledActionResources], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ScheduledActionResources], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3834,7 +4080,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 @@ -3872,7 +4121,7 @@ def __init__(self, *args, **kwargs) -> None: "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def get( self, resource_group_name: str, scheduled_action_name: str, occurrence_id: str, **kwargs: Any @@ -3917,6 +4166,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 @@ -3931,11 +4181,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.Occurrence, response.json()) @@ -3956,7 +4209,7 @@ async def get( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_by_scheduled_action( self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any @@ -4027,7 +4280,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.Occurrence], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Occurrence], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4043,7 +4299,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 @@ -4063,7 +4322,7 @@ async def get_next(next_link=None): "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_resources( self, resource_group_name: str, scheduled_action_name: str, occurrence_id: str, **kwargs: Any @@ -4138,7 +4397,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.OccurrenceResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.OccurrenceResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4154,7 +4416,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 @@ -4268,7 +4533,7 @@ async def cancel( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def cancel( self, @@ -4332,6 +4597,7 @@ async def cancel( } _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 @@ -4346,11 +4612,14 @@ async def cancel( 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.RecurringActionsResourceOperationResult, response.json()) @@ -4372,7 +4641,7 @@ async def cancel( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def _delay_initial( self, @@ -4419,6 +4688,7 @@ async def _delay_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 @@ -4432,7 +4702,10 @@ async def _delay_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 = {} @@ -4440,7 +4713,7 @@ async def _delay_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 @@ -4557,7 +4830,7 @@ async def begin_delay( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) async def begin_delay( self, @@ -4664,7 +4937,7 @@ def __init__(self, *args, **kwargs) -> None: @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={"2025-04-15-preview": ["api_version", "resource_uri", "accept"]}, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_occurrence_by_vms( self, resource_uri: str, **kwargs: Any @@ -4732,7 +5005,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.OccurrenceExtensionResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.OccurrenceExtensionResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4748,7 +5024,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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/_patch.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/_patch.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/__init__.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/__init__.py index d69b77c1f9a0..08f43600ad10 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/__init__.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/__init__.py @@ -15,8 +15,9 @@ from ._models import ( # type: ignore CancelOccurrenceRequest, - CancelOperationsRequest, + CancelOperationsContent, CancelOperationsResponse, + CreateFlexResourceOperationResponse, CreateResourceOperationResponse, DeallocateResourceOperationResponse, DelayRequest, @@ -24,16 +25,19 @@ ErrorAdditionalInfo, ErrorDetail, ErrorResponse, - ExecuteCreateRequest, - ExecuteDeallocateRequest, - ExecuteDeleteRequest, - ExecuteHibernateRequest, - ExecuteStartRequest, + ExecuteCreateContent, + ExecuteCreateFlexRequest, + ExecuteDeallocateContent, + ExecuteDeleteContent, + ExecuteHibernateContent, + ExecuteStartContent, ExecutionParameters, ExtensionResource, - GetOperationErrorsRequest, + FallbackOperationInfo, + FlexProperties, + GetOperationErrorsContent, GetOperationErrorsResponse, - GetOperationStatusRequest, + GetOperationStatusContent, GetOperationStatusResponse, HibernateResourceOperationResponse, NotificationProperties, @@ -47,6 +51,7 @@ OperationDisplay, OperationErrorDetails, OperationErrorsResult, + PriorityProfile, ProxyResource, RecurringActionsResourceOperationResult, Resource, @@ -56,6 +61,7 @@ ResourceOperationDetails, ResourceOperationError, ResourcePatchRequest, + ResourceProvisionFlexPayload, ResourceProvisionPayload, ResourceResultSummary, ResourceStatus, @@ -68,19 +74,25 @@ ScheduledActionResources, ScheduledActionUpdate, ScheduledActionUpdateProperties, + ScheduledActionsExtensionProperties, ScheduledActionsSchedule, StartResourceOperationResponse, - SubmitDeallocateRequest, - SubmitHibernateRequest, - SubmitStartRequest, + SubmitDeallocateContent, + SubmitHibernateContent, + SubmitStartContent, SystemData, TrackedResource, + VmSizeProfile, + ZoneAllocationPolicy, + ZonePreference, ) from ._enums import ( # type: ignore ActionType, + AllocationStrategy, CreatedByType, DeadlineType, + DistributionStrategy, Language, Month, NotificationType, @@ -88,6 +100,8 @@ OperationState, OptimizationPreference, Origin, + OsType, + PriorityType, ProvisioningState, ResourceOperationStatus, ResourceOperationType, @@ -102,8 +116,9 @@ __all__ = [ "CancelOccurrenceRequest", - "CancelOperationsRequest", + "CancelOperationsContent", "CancelOperationsResponse", + "CreateFlexResourceOperationResponse", "CreateResourceOperationResponse", "DeallocateResourceOperationResponse", "DelayRequest", @@ -111,16 +126,19 @@ "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", - "ExecuteCreateRequest", - "ExecuteDeallocateRequest", - "ExecuteDeleteRequest", - "ExecuteHibernateRequest", - "ExecuteStartRequest", + "ExecuteCreateContent", + "ExecuteCreateFlexRequest", + "ExecuteDeallocateContent", + "ExecuteDeleteContent", + "ExecuteHibernateContent", + "ExecuteStartContent", "ExecutionParameters", "ExtensionResource", - "GetOperationErrorsRequest", + "FallbackOperationInfo", + "FlexProperties", + "GetOperationErrorsContent", "GetOperationErrorsResponse", - "GetOperationStatusRequest", + "GetOperationStatusContent", "GetOperationStatusResponse", "HibernateResourceOperationResponse", "NotificationProperties", @@ -134,6 +152,7 @@ "OperationDisplay", "OperationErrorDetails", "OperationErrorsResult", + "PriorityProfile", "ProxyResource", "RecurringActionsResourceOperationResult", "Resource", @@ -143,6 +162,7 @@ "ResourceOperationDetails", "ResourceOperationError", "ResourcePatchRequest", + "ResourceProvisionFlexPayload", "ResourceProvisionPayload", "ResourceResultSummary", "ResourceStatus", @@ -155,16 +175,22 @@ "ScheduledActionResources", "ScheduledActionUpdate", "ScheduledActionUpdateProperties", + "ScheduledActionsExtensionProperties", "ScheduledActionsSchedule", "StartResourceOperationResponse", - "SubmitDeallocateRequest", - "SubmitHibernateRequest", - "SubmitStartRequest", + "SubmitDeallocateContent", + "SubmitHibernateContent", + "SubmitStartContent", "SystemData", "TrackedResource", + "VmSizeProfile", + "ZoneAllocationPolicy", + "ZonePreference", "ActionType", + "AllocationStrategy", "CreatedByType", "DeadlineType", + "DistributionStrategy", "Language", "Month", "NotificationType", @@ -172,6 +198,8 @@ "OperationState", "OptimizationPreference", "Origin", + "OsType", + "PriorityType", "ProvisioningState", "ResourceOperationStatus", "ResourceOperationType", diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_enums.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_enums.py index 74cc53c00996..29aabbba718a 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_enums.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_enums.py @@ -19,6 +19,17 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Actions are for internal-only APIs.""" +class AllocationStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The allocation strategy for VM size selection.""" + + LOWEST_PRICE = "LowestPrice" + """Platform prioritizes VM sizes with the lowest hourly cost.""" + PRIORITIZED = "Prioritized" + """Customer specifies a rank for each VM size, platform uses VM sizes in rank order.""" + CAPACITY_OPTIMIZED = "CapacityOptimized" + """Platform prioritizes VM sizes with the highest available capacity first.""" + + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The kind of entity that created the resource.""" @@ -43,11 +54,26 @@ class DeadlineType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Complete the operation by the given deadline.""" +class DistributionStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The distribution strategy for zone allocation.""" + + BEST_EFFORT_SINGLE_ZONE = "BestEffortSingleZone" + """Platform attempts to place as many VMs as possible in a single zone, falls back to multiple + zones if needed.""" + PRIORITIZED = "Prioritized" + """Platform uses customer-provided zone rankings to allocate VMs.""" + BEST_EFFORT_BALANCED = "BestEffortBalanced" + """Platform attempts to evenly distribute VMs across all available zones with best effort.""" + STRICT_BALANCED = "StrictBalanced" + """Platform must evenly distribute VMs across zones, request is rejected if exact balance cannot + be achieved.""" + + class Language(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The notification languages currently supported.""" EN_US = "en-us" - """American english language""" + """American english language.""" class Month(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -78,67 +104,67 @@ class Month(str, Enum, metaclass=CaseInsensitiveEnumMeta): DECEMBER = "December" """The December month.""" ALL = "All" - """All months""" + """All months.""" class NotificationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of notification supported.""" EMAIL = "Email" - """Notify through e-mail""" + """Notify through e-mail.""" class OccurrenceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The state the occurrence is at a given time.""" CREATED = "Created" - """The occurrence was created""" + """The occurrence was created.""" RESCHEDULING = "Rescheduling" - """The occurrence is being rescheduled""" + """The occurrence is being rescheduled.""" SCHEDULED = "Scheduled" - """The occurrence has been scheduled""" + """The occurrence has been scheduled.""" SUCCEEDED = "Succeeded" - """The occurrence has successfully ran""" + """The occurrence has successfully ran.""" FAILED = "Failed" - """The occurrence has failed during its scheduling""" + """The occurrence has failed during its scheduling.""" CANCELLING = "Cancelling" - """The occurrence is going through cancellation""" + """The occurrence is going through cancellation.""" CANCELED = "Canceled" - """The occurrence has been canceled""" + """The occurrence has been canceled.""" class OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Values that define the states of operations in Scheduled Actions.""" UNKNOWN = "Unknown" - """The default value for the operation state enum""" + """The default value for the operation state enum.""" PENDING_SCHEDULING = "PendingScheduling" - """Operations that are pending scheduling""" + """Operations that are pending scheduling.""" SCHEDULED = "Scheduled" - """Operations that have been scheduled""" + """Operations that have been scheduled.""" PENDING_EXECUTION = "PendingExecution" - """Operations that are waiting to be executed""" + """Operations that are waiting to be executed.""" EXECUTING = "Executing" - """Operations that are in the process of being executed""" + """Operations that are in the process of being executed.""" SUCCEEDED = "Succeeded" - """Operations that suceeded""" + """Operations that suceeded.""" FAILED = "Failed" - """Operations that have failed""" + """Operations that have failed.""" CANCELLED = "Cancelled" - """Operations that have been Cancelled by the user""" + """Operations that have been Cancelled by the user.""" BLOCKED = "Blocked" - """Operations that are blocked""" + """Operations that are blocked.""" class OptimizationPreference(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The preferences customers can select to optimize their requests to ScheduledActions.""" COST = "Cost" - """Optimize while considering cost savings""" + """Optimize while considering cost savings.""" AVAILABILITY = "Availability" - """Optimize while considering availability of resources""" + """Optimize while considering availability of resources.""" COST_AVAILABILITY_BALANCED = "CostAvailabilityBalanced" - """Optimize while considering a balance of cost and availability""" + """Optimize while considering a balance of cost and availability.""" class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -154,6 +180,24 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates the operation is initiated by a user or system.""" +class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The supported operating system types for flex VM creation.""" + + WINDOWS = "Windows" + """Windows operating system.""" + LINUX = "Linux" + """Linux operating system.""" + + +class PriorityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The priority type for VM allocation.""" + + REGULAR = "Regular" + """Regular priority VMs.""" + SPOT = "Spot" + """Spot priority VMs.""" + + class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provisioning state.""" @@ -171,7 +215,7 @@ class ResourceOperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The state the resource is on after the resource operation is applied.""" SUCCEEDED = "Succeeded" - """The resource operation was successful""" + """The resource operation was successful.""" FAILED = "Failed" """The resource operation has failed.""" @@ -180,13 +224,17 @@ class ResourceOperationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The kind of operation types that can be performed on resources using ScheduledActions.""" UNKNOWN = "Unknown" - """The default value for this enum type""" + """The default value for this enum type.""" START = "Start" - """Start operations on the resources""" + """Start operations on the resources.""" DEALLOCATE = "Deallocate" - """Deallocate operations on the resources""" + """Deallocate operations on the resources.""" HIBERNATE = "Hibernate" - """Hibernate operations on the resources""" + """Hibernate operations on the resources.""" + CREATE = "Create" + """Create operations on the resources.""" + DELETE = "Delete" + """Delete operations on the resources.""" class ResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -204,20 +252,20 @@ class ResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of resource being targeted.""" VIRTUAL_MACHINE = "VirtualMachine" - """Resources defined are Virtual Machines""" + """Resources defined are Virtual Machines.""" VIRTUAL_MACHINE_SCALE_SET = "VirtualMachineScaleSet" - """Resources defined are Virtual Machines Scale Sets""" + """Resources defined are Virtual Machines Scale Sets.""" class ScheduledActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specify which action user wants to be performed on the resources.""" START = "Start" - """Perform a start action on the specified resources""" + """Perform a start action on the specified resources.""" DEALLOCATE = "Deallocate" - """Perform a deallocate action on the specified resources""" + """Perform a deallocate action on the specified resources.""" HIBERNATE = "Hibernate" - """Perform hibernate and deallocate on the specified resources""" + """Perform hibernate and deallocate on the specified resources.""" class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -238,4 +286,4 @@ class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): SUNDAY = "Sunday" """Sunday weekday.""" ALL = "All" - """All week days""" + """All week days.""" diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_models.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_models.py index 5c4026b9e264..ab554b8c90a9 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_models.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_models.py @@ -9,7 +9,7 @@ # 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 azure.core.exceptions import ODataV4Format @@ -27,7 +27,7 @@ class CancelOccurrenceRequest(_Model): :vartype resource_ids: list[str] """ - resource_ids: List[str] = rest_field(name="resourceIds", visibility=["read", "create", "update", "delete", "query"]) + resource_ids: list[str] = rest_field(name="resourceIds", visibility=["read", "create", "update", "delete", "query"]) """The resources the cancellation should act on. If no resource is passed in the list, Scheduled Action will cancel the occurrence for all resources. Required.""" @@ -35,7 +35,7 @@ class CancelOccurrenceRequest(_Model): def __init__( self, *, - resource_ids: List[str], + resource_ids: list[str], ) -> None: ... @overload @@ -49,7 +49,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CancelOperationsRequest(_Model): +class CancelOperationsContent(_Model): """This is the request to cancel running operations in scheduled actions using the operation ids. :ivar operation_ids: The list of operation ids to cancel operations on. Required. @@ -58,7 +58,7 @@ class CancelOperationsRequest(_Model): :vartype correlationid: str """ - operation_ids: List[str] = rest_field( + operation_ids: list[str] = rest_field( name="operationIds", visibility=["read", "create", "update", "delete", "query"] ) """The list of operation ids to cancel operations on. Required.""" @@ -69,7 +69,7 @@ class CancelOperationsRequest(_Model): def __init__( self, *, - operation_ids: List[str], + operation_ids: list[str], correlationid: str, ) -> None: ... @@ -91,14 +91,60 @@ class CancelOperationsResponse(_Model): :vartype results: list[~azure.mgmt.computeschedule.models.ResourceOperation] """ - results: List["_models.ResourceOperation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + results: list["_models.ResourceOperation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """An array of resource operations that were successfully cancelled. Required.""" @overload def __init__( self, *, - results: List["_models.ResourceOperation"], + results: list["_models.ResourceOperation"], + ) -> 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 CreateFlexResourceOperationResponse(_Model): + """The response from a create flex request. + + :ivar description: The description of the operation response. Required. + :vartype description: str + :ivar type: The type of resources used in the create flex request eg virtual machines. + Required. + :vartype type: str + :ivar location: The location of the create flex request eg westus. Required. + :vartype location: str + :ivar results: The results from the create flex request if no errors exist. + :vartype results: list[~azure.mgmt.computeschedule.models.ResourceOperation] + """ + + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the operation response. Required.""" + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of resources used in the create flex request eg virtual machines. Required.""" + location: str = rest_field(visibility=["read", "create"]) + """The location of the create flex request eg westus. Required.""" + results: Optional[list["_models.ResourceOperation"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The results from the create flex request if no errors exist.""" + + @overload + def __init__( + self, + *, + description: str, + type: str, + location: str, + results: Optional[list["_models.ResourceOperation"]] = None, ) -> None: ... @overload @@ -131,7 +177,7 @@ class CreateResourceOperationResponse(_Model): """The type of resources used in the create request eg virtual machines. Required.""" location: str = rest_field(visibility=["read", "create"]) """The location of the start request eg westus. Required.""" - results: Optional[List["_models.ResourceOperation"]] = rest_field( + results: Optional[list["_models.ResourceOperation"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The results from the start request if no errors exist.""" @@ -143,7 +189,7 @@ def __init__( description: str, type: str, location: str, - results: Optional[List["_models.ResourceOperation"]] = None, + results: Optional[list["_models.ResourceOperation"]] = None, ) -> None: ... @overload @@ -176,7 +222,7 @@ class DeallocateResourceOperationResponse(_Model): """The type of resources used in the deallocate request eg virtual machines. Required.""" location: str = rest_field(visibility=["read", "create"]) """The location of the deallocate request eg westus. Required.""" - results: Optional[List["_models.ResourceOperation"]] = rest_field( + results: Optional[list["_models.ResourceOperation"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The results from the deallocate request if no errors exist.""" @@ -188,7 +234,7 @@ def __init__( description: str, type: str, location: str, - results: Optional[List["_models.ResourceOperation"]] = None, + results: Optional[list["_models.ResourceOperation"]] = None, ) -> None: ... @overload @@ -215,7 +261,7 @@ class DelayRequest(_Model): delay: datetime.datetime = rest_field(visibility=["read", "create", "update", "delete", "query"], format="rfc3339") """The exact time to delay the operations to. Required.""" - resource_ids: List[str] = rest_field(name="resourceIds", visibility=["read", "create", "update", "delete", "query"]) + resource_ids: list[str] = rest_field(name="resourceIds", visibility=["read", "create", "update", "delete", "query"]) """The resources that should be delayed. If empty, the delay will apply to the all resources in the occurrence. Required.""" @@ -224,7 +270,7 @@ def __init__( self, *, delay: datetime.datetime, - resource_ids: List[str], + resource_ids: list[str], ) -> None: ... @overload @@ -257,7 +303,7 @@ class DeleteResourceOperationResponse(_Model): """The type of resources used in the delete request eg virtual machines. Required.""" location: str = rest_field(visibility=["read", "create"]) """The location of the start request eg westus. Required.""" - results: Optional[List["_models.ResourceOperation"]] = rest_field( + results: Optional[list["_models.ResourceOperation"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The results from the start request if no errors exist.""" @@ -269,7 +315,7 @@ def __init__( description: str, type: str, location: str, - results: Optional[List["_models.ResourceOperation"]] = None, + results: Optional[list["_models.ResourceOperation"]] = None, ) -> None: ... @overload @@ -319,9 +365,9 @@ class ErrorDetail(_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.""" @@ -355,7 +401,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ExecuteCreateRequest(_Model): +class ExecuteCreateContent(_Model): """The ExecuteCreateRequest request for create operations. :ivar resource_config_parameters: resource creation payload. Required. @@ -398,7 +444,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ExecuteDeallocateRequest(_Model): +class ExecuteCreateFlexRequest(_Model): + """The ExecuteCreateFlexRequest request for executeCreateFlex operations. + + :ivar resource_config_parameters: Resource creation payload with flex properties. Required. + :vartype resource_config_parameters: + ~azure.mgmt.computeschedule.models.ResourceProvisionFlexPayload + :ivar execution_parameters: The execution parameters for the request. Required. + :vartype execution_parameters: ~azure.mgmt.computeschedule.models.ExecutionParameters + :ivar correlationid: Correlationid item. + :vartype correlationid: str + """ + + resource_config_parameters: "_models.ResourceProvisionFlexPayload" = rest_field( + name="resourceConfigParameters", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource creation payload with flex properties. Required.""" + execution_parameters: "_models.ExecutionParameters" = rest_field( + name="executionParameters", visibility=["read", "create", "update", "delete", "query"] + ) + """The execution parameters for the request. Required.""" + correlationid: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Correlationid item.""" + + @overload + def __init__( + self, + *, + resource_config_parameters: "_models.ResourceProvisionFlexPayload", + execution_parameters: "_models.ExecutionParameters", + correlationid: Optional[str] = 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 ExecuteDeallocateContent(_Model): """The ExecuteDeallocateRequest request for executeDeallocate operations. :ivar execution_parameters: The execution parameters for the request. Required. @@ -438,7 +527,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ExecuteDeleteRequest(_Model): +class ExecuteDeleteContent(_Model): """The ExecuteDeleteRequest for delete VM operation. :ivar execution_parameters: The execution parameters for the request. Required. @@ -485,7 +574,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ExecuteHibernateRequest(_Model): +class ExecuteHibernateContent(_Model): """The ExecuteHibernateRequest request for executeHibernate operations. :ivar execution_parameters: The execution parameters for the request. Required. @@ -525,7 +614,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ExecuteStartRequest(_Model): +class ExecuteStartContent(_Model): """The ExecuteStartRequest request for executeStart operations. :ivar execution_parameters: The execution parameters for the request. Required. @@ -650,14 +739,111 @@ class ExtensionResource(Resource): """ -class GetOperationErrorsRequest(_Model): +class FallbackOperationInfo(_Model): + """Describes the fallback operation that was performed. + + :ivar last_op_type: The last operation type that was performed as a fallback. Required. Known + values are: "Unknown", "Start", "Deallocate", "Hibernate", "Create", and "Delete". + :vartype last_op_type: str or ~azure.mgmt.computeschedule.models.ResourceOperationType + :ivar status: The status of the fallback operation. Required. + :vartype status: str + :ivar error: The error code if the fallback operation failed. + :vartype error: ~azure.mgmt.computeschedule.models.ResourceOperationError + """ + + last_op_type: Union[str, "_models.ResourceOperationType"] = rest_field( + name="lastOpType", visibility=["read", "create", "update", "delete", "query"] + ) + """The last operation type that was performed as a fallback. Required. Known values are: + \"Unknown\", \"Start\", \"Deallocate\", \"Hibernate\", \"Create\", and \"Delete\".""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The status of the fallback operation. Required.""" + error: Optional["_models.ResourceOperationError"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The error code if the fallback operation failed.""" + + @overload + def __init__( + self, + *, + last_op_type: Union[str, "_models.ResourceOperationType"], + status: str, + error: Optional["_models.ResourceOperationError"] = 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 FlexProperties(_Model): + """The flex properties for flexible VM creation. + + :ivar vm_size_profiles: The list of VM size profiles to use for flex creation. Required. + :vartype vm_size_profiles: list[~azure.mgmt.computeschedule.models.VmSizeProfile] + :ivar os_type: The operating system type for the VMs. Required. Known values are: "Windows" and + "Linux". + :vartype os_type: str or ~azure.mgmt.computeschedule.models.OsType + :ivar priority_profile: The priority profile for VM allocation. Required. + :vartype priority_profile: ~azure.mgmt.computeschedule.models.PriorityProfile + :ivar zone_allocation_policy: The zone allocation policy for distributing VMs across + availability zones. + :vartype zone_allocation_policy: ~azure.mgmt.computeschedule.models.ZoneAllocationPolicy + """ + + vm_size_profiles: list["_models.VmSizeProfile"] = rest_field( + name="vmSizeProfiles", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of VM size profiles to use for flex creation. Required.""" + os_type: Union[str, "_models.OsType"] = rest_field( + name="osType", visibility=["read", "create", "update", "delete", "query"] + ) + """The operating system type for the VMs. Required. Known values are: \"Windows\" and \"Linux\".""" + priority_profile: "_models.PriorityProfile" = rest_field( + name="priorityProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The priority profile for VM allocation. Required.""" + zone_allocation_policy: Optional["_models.ZoneAllocationPolicy"] = rest_field( + name="zoneAllocationPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """The zone allocation policy for distributing VMs across availability zones.""" + + @overload + def __init__( + self, + *, + vm_size_profiles: list["_models.VmSizeProfile"], + os_type: Union[str, "_models.OsType"], + priority_profile: "_models.PriorityProfile", + zone_allocation_policy: Optional["_models.ZoneAllocationPolicy"] = 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 GetOperationErrorsContent(_Model): """This is the request to get errors per vm operations. :ivar operation_ids: The list of operation ids to query errors of. Required. :vartype operation_ids: list[str] """ - operation_ids: List[str] = rest_field( + operation_ids: list[str] = rest_field( name="operationIds", visibility=["read", "create", "update", "delete", "query"] ) """The list of operation ids to query errors of. Required.""" @@ -666,7 +852,7 @@ class GetOperationErrorsRequest(_Model): def __init__( self, *, - operation_ids: List[str], + operation_ids: list[str], ) -> None: ... @overload @@ -687,7 +873,7 @@ class GetOperationErrorsResponse(_Model): :vartype results: list[~azure.mgmt.computeschedule.models.OperationErrorsResult] """ - results: List["_models.OperationErrorsResult"] = rest_field( + results: list["_models.OperationErrorsResult"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """An array of operationids and their corresponding errors if any. Required.""" @@ -696,7 +882,7 @@ class GetOperationErrorsResponse(_Model): def __init__( self, *, - results: List["_models.OperationErrorsResult"], + results: list["_models.OperationErrorsResult"], ) -> None: ... @overload @@ -710,7 +896,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GetOperationStatusRequest(_Model): +class GetOperationStatusContent(_Model): """This is the request to get operation status using operationids. :ivar operation_ids: The list of operation ids to get the status of. Required. @@ -719,7 +905,7 @@ class GetOperationStatusRequest(_Model): :vartype correlationid: str """ - operation_ids: List[str] = rest_field( + operation_ids: list[str] = rest_field( name="operationIds", visibility=["read", "create", "update", "delete", "query"] ) """The list of operation ids to get the status of. Required.""" @@ -730,7 +916,7 @@ class GetOperationStatusRequest(_Model): def __init__( self, *, - operation_ids: List[str], + operation_ids: list[str], correlationid: str, ) -> None: ... @@ -752,14 +938,14 @@ class GetOperationStatusResponse(_Model): :vartype results: list[~azure.mgmt.computeschedule.models.ResourceOperation] """ - results: List["_models.ResourceOperation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + results: list["_models.ResourceOperation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """An array of resource operations based on their operation ids. Required.""" @overload def __init__( self, *, - results: List["_models.ResourceOperation"], + results: list["_models.ResourceOperation"], ) -> None: ... @overload @@ -792,7 +978,7 @@ class HibernateResourceOperationResponse(_Model): """The type of resources used in the Hibernate request eg virtual machines. Required.""" location: str = rest_field(visibility=["read", "create"]) """The location of the Hibernate request eg westus. Required.""" - results: Optional[List["_models.ResourceOperation"]] = rest_field( + results: Optional[list["_models.ResourceOperation"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The results from the Hibernate request if no errors exist.""" @@ -804,7 +990,7 @@ def __init__( description: str, type: str, location: str, - results: Optional[List["_models.ResourceOperation"]] = None, + results: Optional[list["_models.ResourceOperation"]] = None, ) -> None: ... @overload @@ -951,7 +1137,7 @@ class OccurrenceExtensionProperties(_Model): """The ARM Id of the resource. \"subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}\". Required.""" - notification_settings: Optional[List["_models.NotificationProperties"]] = rest_field( + notification_settings: Optional[list["_models.NotificationProperties"]] = rest_field( name="notificationSettings", visibility=["read", "create", "update", "delete", "query"] ) """The desired notification settings for the specified resource.""" @@ -975,7 +1161,7 @@ def __init__( *, resource_id: str, scheduled_action_id: str, - notification_settings: Optional[List["_models.NotificationProperties"]] = None, + notification_settings: Optional[list["_models.NotificationProperties"]] = None, ) -> None: ... @overload @@ -1092,7 +1278,7 @@ class OccurrenceResource(_Model): """The ARM Id of the resource. \"subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}\". Required.""" - notification_settings: Optional[List["_models.NotificationProperties"]] = rest_field( + notification_settings: Optional[list["_models.NotificationProperties"]] = rest_field( name="notificationSettings", visibility=["read", "create", "update", "delete", "query"] ) """The desired notification settings for the specified resource.""" @@ -1111,7 +1297,7 @@ def __init__( self, *, resource_id: str, - notification_settings: Optional[List["_models.NotificationProperties"]] = None, + notification_settings: Optional[list["_models.NotificationProperties"]] = None, ) -> None: ... @overload @@ -1137,7 +1323,7 @@ class OccurrenceResultSummary(_Model): total: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The total number of resources that the occurrence was supposed to act on. Required.""" - statuses: List["_models.ResourceResultSummary"] = rest_field( + statuses: list["_models.ResourceResultSummary"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The summarized status of the resources. Required.""" @@ -1147,7 +1333,7 @@ def __init__( self, *, total: int, - statuses: List["_models.ResourceResultSummary"], + statuses: list["_models.ResourceResultSummary"], ) -> None: ... @overload @@ -1219,7 +1405,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OperationDisplay(_Model): - """Localized display information for and operation. + """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". @@ -1346,7 +1532,7 @@ class OperationErrorsResult(_Model): name="completedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" ) """The completion time of the operation if the operation was completed.""" - operation_errors: Optional[List["_models.OperationErrorDetails"]] = rest_field( + operation_errors: Optional[list["_models.OperationErrorDetails"]] = rest_field( name="operationErrors", visibility=["read", "create", "update", "delete", "query"] ) """A list of errors associated with the operationid.""" @@ -1367,7 +1553,7 @@ def __init__( creation_time: Optional[datetime.datetime] = None, activation_time: Optional[datetime.datetime] = None, completed_at: Optional[datetime.datetime] = None, - operation_errors: Optional[List["_models.OperationErrorDetails"]] = None, + operation_errors: Optional[list["_models.OperationErrorDetails"]] = None, request_error_code: Optional[str] = None, request_error_details: Optional[str] = None, ) -> None: ... @@ -1383,6 +1569,45 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class PriorityProfile(_Model): + """The priority profile for flex VM creation. + + :ivar type: The priority type for VM allocation. Known values are: "Regular" and "Spot". + :vartype type: str or ~azure.mgmt.computeschedule.models.PriorityType + :ivar allocation_strategy: The allocation strategy for VM size selection. Known values are: + "LowestPrice", "Prioritized", and "CapacityOptimized". + :vartype allocation_strategy: str or ~azure.mgmt.computeschedule.models.AllocationStrategy + """ + + type: Optional[Union[str, "_models.PriorityType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The priority type for VM allocation. Known values are: \"Regular\" and \"Spot\".""" + allocation_strategy: Optional[Union[str, "_models.AllocationStrategy"]] = rest_field( + name="allocationStrategy", visibility=["read", "create", "update", "delete", "query"] + ) + """The allocation strategy for VM size selection. Known values are: \"LowestPrice\", + \"Prioritized\", and \"CapacityOptimized\".""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.PriorityType"]] = None, + allocation_strategy: Optional[Union[str, "_models.AllocationStrategy"]] = 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 RecurringActionsResourceOperationResult(_Model): """The response from scheduled action resource requests, which contains the status of each resource. @@ -1395,7 +1620,7 @@ class RecurringActionsResourceOperationResult(_Model): total_resources: int = rest_field(name="totalResources", visibility=["read", "create", "update", "delete", "query"]) """The total number of resources operated on. Required.""" - resources_statuses: List["_models.ResourceStatus"] = rest_field( + resources_statuses: list["_models.ResourceStatus"] = rest_field( name="resourcesStatuses", visibility=["read", "create", "update", "delete", "query"] ) """The resource status of for each resource. Required.""" @@ -1405,7 +1630,7 @@ def __init__( self, *, total_resources: int, - resources_statuses: List["_models.ResourceStatus"], + resources_statuses: list["_models.ResourceStatus"], ) -> None: ... @overload @@ -1426,7 +1651,7 @@ class ResourceAttachRequest(_Model): :vartype resources: list[~azure.mgmt.computeschedule.models.ScheduledActionResource] """ - resources: List["_models.ScheduledActionResource"] = rest_field( + resources: list["_models.ScheduledActionResource"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """List of resources to be attached/patched. Required.""" @@ -1435,7 +1660,7 @@ class ResourceAttachRequest(_Model): def __init__( self, *, - resources: List["_models.ScheduledActionResource"], + resources: list["_models.ScheduledActionResource"], ) -> None: ... @overload @@ -1456,14 +1681,14 @@ class ResourceDetachRequest(_Model): :vartype resources: list[str] """ - resources: List[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + resources: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """List of resources to be detached. Required.""" @overload def __init__( self, *, - resources: List[str], + resources: list[str], ) -> None: ... @overload @@ -1534,7 +1759,7 @@ class ResourceOperationDetails(_Model): :ivar resource_id: Unique identifier for the resource involved in the operation, eg ArmId. :vartype resource_id: str :ivar op_type: Type of operation performed on the resources. Known values are: "Unknown", - "Start", "Deallocate", and "Hibernate". + "Start", "Deallocate", "Hibernate", "Create", and "Delete". :vartype op_type: str or ~azure.mgmt.computeschedule.models.ResourceOperationType :ivar subscription_id: Subscription id attached to the request. :vartype subscription_id: str @@ -1553,6 +1778,8 @@ class ResourceOperationDetails(_Model): :vartype time_zone: str :ivar resource_operation_error: Operation level errors if they exist. :vartype resource_operation_error: ~azure.mgmt.computeschedule.models.ResourceOperationError + :ivar fallback_operation_info: Fallback operation details if a fallback was performed. + :vartype fallback_operation_info: ~azure.mgmt.computeschedule.models.FallbackOperationInfo :ivar completed_at: Time the operation was complete if errors are null. :vartype completed_at: ~datetime.datetime :ivar retry_policy: Retry policy the user can pass. @@ -1569,7 +1796,7 @@ class ResourceOperationDetails(_Model): name="opType", visibility=["read", "create", "update", "delete", "query"] ) """Type of operation performed on the resources. Known values are: \"Unknown\", \"Start\", - \"Deallocate\", and \"Hibernate\".""" + \"Deallocate\", \"Hibernate\", \"Create\", and \"Delete\".""" subscription_id: Optional[str] = rest_field( name="subscriptionId", visibility=["read", "create", "update", "delete", "query"] ) @@ -1597,6 +1824,10 @@ class ResourceOperationDetails(_Model): name="resourceOperationError", visibility=["read", "create", "update", "delete", "query"] ) """Operation level errors if they exist.""" + fallback_operation_info: Optional["_models.FallbackOperationInfo"] = rest_field( + name="fallbackOperationInfo", visibility=["read", "create", "update", "delete", "query"] + ) + """Fallback operation details if a fallback was performed.""" completed_at: Optional[datetime.datetime] = rest_field( name="completedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" ) @@ -1620,6 +1851,7 @@ def __init__( timezone: Optional[str] = None, time_zone: Optional[str] = None, resource_operation_error: Optional["_models.ResourceOperationError"] = None, + fallback_operation_info: Optional["_models.FallbackOperationInfo"] = None, completed_at: Optional[datetime.datetime] = None, retry_policy: Optional["_models.RetryPolicy"] = None, ) -> None: ... @@ -1675,7 +1907,7 @@ class ResourcePatchRequest(_Model): :vartype resources: list[~azure.mgmt.computeschedule.models.ScheduledActionResource] """ - resources: List["_models.ScheduledActionResource"] = rest_field( + resources: list["_models.ScheduledActionResource"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The list of resources we watch to patch. Required.""" @@ -1684,7 +1916,67 @@ class ResourcePatchRequest(_Model): def __init__( self, *, - resources: List["_models.ScheduledActionResource"], + resources: list["_models.ScheduledActionResource"], + ) -> 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 ResourceProvisionFlexPayload(_Model): + """Resource creation data model for flex VM provisioning. + + :ivar base_profile: JSON object that contains VM properties that are common across all VMs in + this batch. + :vartype base_profile: dict[str, any] + :ivar resource_overrides: JSON array that contains VM properties that should be overridden for + each VM in the batch. + :vartype resource_overrides: list[dict[str, any]] + :ivar resource_count: Number of VMs to be created. Required. + :vartype resource_count: int + :ivar resource_prefix: If resourceOverrides doesn't contain name, service will create name + based on prefix and resourceCount. + :vartype resource_prefix: str + :ivar flex_properties: The flex properties for flexible VM creation. Required. + :vartype flex_properties: ~azure.mgmt.computeschedule.models.FlexProperties + """ + + base_profile: Optional[dict[str, Any]] = rest_field( + name="baseProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """JSON object that contains VM properties that are common across all VMs in this batch.""" + resource_overrides: Optional[list[dict[str, Any]]] = rest_field( + name="resourceOverrides", visibility=["read", "create", "update", "delete", "query"] + ) + """JSON array that contains VM properties that should be overridden for each VM in the batch.""" + resource_count: int = rest_field(name="resourceCount", visibility=["read", "create", "update", "delete", "query"]) + """Number of VMs to be created. Required.""" + resource_prefix: Optional[str] = rest_field( + name="resourcePrefix", visibility=["read", "create", "update", "delete", "query"] + ) + """If resourceOverrides doesn't contain name, service will create name based on prefix and + resourceCount.""" + flex_properties: "_models.FlexProperties" = rest_field( + name="flexProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """The flex properties for flexible VM creation. Required.""" + + @overload + def __init__( + self, + *, + resource_count: int, + flex_properties: "_models.FlexProperties", + base_profile: Optional[dict[str, Any]] = None, + resource_overrides: Optional[list[dict[str, Any]]] = None, + resource_prefix: Optional[str] = None, ) -> None: ... @overload @@ -1717,13 +2009,13 @@ class ResourceProvisionPayload(_Model): :vartype resource_prefix: str """ - base_profile: Optional[Dict[str, Any]] = rest_field( + base_profile: Optional[dict[str, Any]] = rest_field( name="baseProfile", visibility=["read", "create", "update", "delete", "query"] ) """JSON object that contains VM properties that are common across all VMs in this batch (if you want to create 100 VMs in this request, and they all have same vmSize, then include vmSize in baseProfile).""" - resource_overrides: Optional[List[Dict[str, Any]]] = rest_field( + resource_overrides: Optional[list[dict[str, Any]]] = rest_field( name="resourceOverrides", visibility=["read", "create", "update", "delete", "query"] ) """JSON array, that contains VM properties that should to be overridden for each VM in the batch @@ -1743,8 +2035,8 @@ def __init__( self, *, resource_count: int, - base_profile: Optional[Dict[str, Any]] = None, - resource_overrides: Optional[List[Dict[str, Any]]] = None, + base_profile: Optional[dict[str, Any]] = None, + resource_overrides: Optional[list[dict[str, Any]]] = None, resource_prefix: Optional[str] = None, ) -> None: ... @@ -1808,14 +2100,14 @@ class Resources(_Model): :vartype ids: list[str] """ - ids: List[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + ids: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The resource ids used for the request. Required.""" @overload def __init__( self, *, - ids: List[str], + ids: list[str], ) -> None: ... @overload @@ -1878,6 +2170,9 @@ class RetryPolicy(_Model): :vartype retry_count: int :ivar retry_window_in_minutes: Retry window in minutes for user request. :vartype retry_window_in_minutes: int + :ivar on_failure_action: Action to take on failure. Known values are: "Unknown", "Start", + "Deallocate", "Hibernate", "Create", and "Delete". + :vartype on_failure_action: str or ~azure.mgmt.computeschedule.models.ResourceOperationType """ retry_count: Optional[int] = rest_field( @@ -1888,6 +2183,11 @@ class RetryPolicy(_Model): name="retryWindowInMinutes", visibility=["read", "create", "update", "delete", "query"] ) """Retry window in minutes for user request.""" + on_failure_action: Optional[Union[str, "_models.ResourceOperationType"]] = rest_field( + name="onFailureAction", visibility=["read", "create", "update", "delete", "query"] + ) + """Action to take on failure. Known values are: \"Unknown\", \"Start\", \"Deallocate\", + \"Hibernate\", \"Create\", and \"Delete\".""" @overload def __init__( @@ -1895,6 +2195,7 @@ def __init__( *, retry_count: Optional[int] = None, retry_window_in_minutes: Optional[int] = None, + on_failure_action: Optional[Union[str, "_models.ResourceOperationType"]] = None, ) -> None: ... @overload @@ -1984,7 +2285,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.""" @@ -1994,7 +2295,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -2040,7 +2341,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.ScheduledActionProperties"] = None, ) -> None: ... @@ -2101,7 +2402,7 @@ class ScheduledActionProperties(_Model): visibility=["read", "create", "update", "delete", "query"] ) """The schedule the scheduled action is supposed to follow. Required.""" - notification_settings: List["_models.NotificationProperties"] = rest_field( + notification_settings: list["_models.NotificationProperties"] = rest_field( name="notificationSettings", visibility=["read", "create", "update", "delete", "query"] ) """The notification settings for the scheduled action. Required.""" @@ -2121,7 +2422,7 @@ def __init__( action_type: Union[str, "_models.ScheduledActionType"], start_time: datetime.datetime, schedule: "_models.ScheduledActionsSchedule", - notification_settings: List["_models.NotificationProperties"], + notification_settings: list["_models.NotificationProperties"], end_time: Optional[datetime.datetime] = None, disabled: Optional[bool] = None, ) -> None: ... @@ -2164,7 +2465,7 @@ class ScheduledActionResource(_Model): """The ARM Id of the resource. \"subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}\". Required.""" - notification_settings: Optional[List["_models.NotificationProperties"]] = rest_field( + notification_settings: Optional[list["_models.NotificationProperties"]] = rest_field( name="notificationSettings", visibility=["read", "create", "update", "delete", "query"] ) """The desired notification settings for the specified resource.""" @@ -2174,7 +2475,7 @@ def __init__( self, *, resource_id: str, - notification_settings: Optional[List["_models.NotificationProperties"]] = None, + notification_settings: Optional[list["_models.NotificationProperties"]] = None, ) -> None: ... @overload @@ -2203,10 +2504,10 @@ class ScheduledActionResources(ExtensionResource): information. :vartype system_data: ~azure.mgmt.computeschedule.models.SystemData :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.computeschedule.models.ScheduledActionProperties + :vartype properties: ~azure.mgmt.computeschedule.models.ScheduledActionsExtensionProperties """ - properties: Optional["_models.ScheduledActionProperties"] = rest_field( + properties: Optional["_models.ScheduledActionsExtensionProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" @@ -2215,7 +2516,100 @@ class ScheduledActionResources(ExtensionResource): def __init__( self, *, - properties: Optional["_models.ScheduledActionProperties"] = None, + properties: Optional["_models.ScheduledActionsExtensionProperties"] = 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 ScheduledActionsExtensionProperties(_Model): + """Scheduled action extension properties. + + :ivar resource_type: The type of resource the scheduled action is targeting. Required. Known + values are: "VirtualMachine" and "VirtualMachineScaleSet". + :vartype resource_type: str or ~azure.mgmt.computeschedule.models.ResourceType + :ivar action_type: The action the scheduled action should perform in the resources. Required. + Known values are: "Start", "Deallocate", and "Hibernate". + :vartype action_type: str or ~azure.mgmt.computeschedule.models.ScheduledActionType + :ivar start_time: The time which the scheduled action is supposed to start running. Required. + :vartype start_time: ~datetime.datetime + :ivar end_time: The time when the scheduled action is supposed to stop scheduling. + :vartype end_time: ~datetime.datetime + :ivar schedule: The schedule the scheduled action is supposed to follow. Required. + :vartype schedule: ~azure.mgmt.computeschedule.models.ScheduledActionsSchedule + :ivar notification_settings: The notification settings for the scheduled action. Required. + :vartype notification_settings: list[~azure.mgmt.computeschedule.models.NotificationProperties] + :ivar disabled: Tell if the scheduled action is disabled or not. + :vartype disabled: bool + :ivar provisioning_state: The status of the last provisioning operation performed on the + resource. Known values are: "Succeeded", "Failed", "Canceled", and "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.computeschedule.models.ProvisioningState + :ivar resource_notification_settings: The notification settings for the scheduled action at a + resource level. Resource level notification settings are scope to specific resources only and + submitted through attach requests. + :vartype resource_notification_settings: + list[~azure.mgmt.computeschedule.models.NotificationProperties] + """ + + resource_type: Union[str, "_models.ResourceType"] = rest_field( + name="resourceType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of resource the scheduled action is targeting. Required. Known values are: + \"VirtualMachine\" and \"VirtualMachineScaleSet\".""" + action_type: Union[str, "_models.ScheduledActionType"] = rest_field( + name="actionType", visibility=["read", "create", "update", "delete", "query"] + ) + """The action the scheduled action should perform in the resources. Required. Known values are: + \"Start\", \"Deallocate\", and \"Hibernate\".""" + start_time: datetime.datetime = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time which the scheduled action is supposed to start running. Required.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time when the scheduled action is supposed to stop scheduling.""" + schedule: "_models.ScheduledActionsSchedule" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The schedule the scheduled action is supposed to follow. Required.""" + notification_settings: list["_models.NotificationProperties"] = rest_field( + name="notificationSettings", visibility=["read", "create", "update", "delete", "query"] + ) + """The notification settings for the scheduled action. Required.""" + disabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Tell if the scheduled action is disabled or not.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last provisioning operation performed on the resource. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", and \"Deleting\".""" + resource_notification_settings: Optional[list["_models.NotificationProperties"]] = rest_field( + name="resourceNotificationSettings", visibility=["read"] + ) + """The notification settings for the scheduled action at a resource level. Resource level + notification settings are scope to specific resources only and submitted through attach + requests.""" + + @overload + def __init__( + self, + *, + resource_type: Union[str, "_models.ResourceType"], + action_type: Union[str, "_models.ScheduledActionType"], + start_time: datetime.datetime, + schedule: "_models.ScheduledActionsSchedule", + notification_settings: list["_models.NotificationProperties"], + end_time: Optional[datetime.datetime] = None, + disabled: Optional[bool] = None, ) -> None: ... @overload @@ -2258,15 +2652,15 @@ class ScheduledActionsSchedule(_Model): """The time the scheduled action is supposed to run on. Required.""" time_zone: str = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) """The timezone the scheduled time is specified on. Required.""" - requested_week_days: List[Union[str, "_models.WeekDay"]] = rest_field( + requested_week_days: list[Union[str, "_models.WeekDay"]] = rest_field( name="requestedWeekDays", visibility=["read", "create", "update", "delete", "query"] ) """The week days the scheduled action is supposed to run on. Required.""" - requested_months: List[Union[str, "_models.Month"]] = rest_field( + requested_months: list[Union[str, "_models.Month"]] = rest_field( name="requestedMonths", visibility=["read", "create", "update", "delete", "query"] ) """The months the scheduled action is supposed to run on. Required.""" - requested_days_of_the_month: List[int] = rest_field( + requested_days_of_the_month: list[int] = rest_field( name="requestedDaysOfTheMonth", visibility=["read", "create", "update", "delete", "query"] ) """The days of the month the scheduled action is supposed to run on. If empty, it means it will @@ -2288,9 +2682,9 @@ def __init__( *, scheduled_time: datetime.time, time_zone: str, - requested_week_days: List[Union[str, "_models.WeekDay"]], - requested_months: List[Union[str, "_models.Month"]], - requested_days_of_the_month: List[int], + requested_week_days: list[Union[str, "_models.WeekDay"]], + requested_months: list[Union[str, "_models.Month"]], + requested_days_of_the_month: list[int], execution_parameters: Optional["_models.ExecutionParameters"] = None, deadline_type: Optional[Union[str, "_models.DeadlineType"]] = None, ) -> None: ... @@ -2315,7 +2709,7 @@ class ScheduledActionUpdate(_Model): :vartype properties: ~azure.mgmt.computeschedule.models.ScheduledActionUpdateProperties """ - 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.ScheduledActionUpdateProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -2326,7 +2720,7 @@ class ScheduledActionUpdate(_Model): def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.ScheduledActionUpdateProperties"] = None, ) -> None: ... @@ -2384,7 +2778,7 @@ class ScheduledActionUpdateProperties(_Model): visibility=["read", "create", "update", "delete", "query"] ) """The schedule the scheduled action is supposed to follow.""" - notification_settings: Optional[List["_models.NotificationProperties"]] = rest_field( + notification_settings: Optional[list["_models.NotificationProperties"]] = rest_field( name="notificationSettings", visibility=["read", "create", "update", "delete", "query"] ) """The notification settings for the scheduled action.""" @@ -2400,7 +2794,7 @@ def __init__( start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, schedule: Optional["_models.ScheduledActionsSchedule"] = None, - notification_settings: Optional[List["_models.NotificationProperties"]] = None, + notification_settings: Optional[list["_models.NotificationProperties"]] = None, disabled: Optional[bool] = None, ) -> None: ... @@ -2434,7 +2828,7 @@ class StartResourceOperationResponse(_Model): """The type of resources used in the start request eg virtual machines. Required.""" location: str = rest_field(visibility=["read", "create"]) """The location of the start request eg westus. Required.""" - results: Optional[List["_models.ResourceOperation"]] = rest_field( + results: Optional[list["_models.ResourceOperation"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The results from the start request if no errors exist.""" @@ -2446,7 +2840,7 @@ def __init__( description: str, type: str, location: str, - results: Optional[List["_models.ResourceOperation"]] = None, + results: Optional[list["_models.ResourceOperation"]] = None, ) -> None: ... @overload @@ -2460,7 +2854,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SubmitDeallocateRequest(_Model): +class SubmitDeallocateContent(_Model): """The deallocate request for resources. :ivar schedule: The schedule for the request. Required. @@ -2505,7 +2899,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SubmitHibernateRequest(_Model): +class SubmitHibernateContent(_Model): """This is the request for hibernate. :ivar schedule: The schedule for the request. Required. @@ -2550,7 +2944,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SubmitStartRequest(_Model): +class SubmitStartContent(_Model): """This is the request for start. :ivar schedule: The schedule for the request. Required. @@ -2660,3 +3054,108 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + + +class VmSizeProfile(_Model): + """A VM size profile with a name and rank for flex VM creation. + + :ivar name: The name of the VM size, eg Standard_D2ads_v5. Required. + :vartype name: str + :ivar rank: The rank of this VM size in the priority order. Required. + :vartype rank: int + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the VM size, eg Standard_D2ads_v5. Required.""" + rank: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The rank of this VM size in the priority order. Required.""" + + @overload + def __init__( + self, + *, + name: str, + rank: int, + ) -> 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 ZoneAllocationPolicy(_Model): + """The zone allocation policy for distributing VMs across availability zones. + + :ivar distribution_strategy: The distribution strategy for zone allocation. Known values are: + "BestEffortSingleZone", "Prioritized", "BestEffortBalanced", and "StrictBalanced". + :vartype distribution_strategy: str or ~azure.mgmt.computeschedule.models.DistributionStrategy + :ivar zone_preferences: The zone preferences for allocation priority. + :vartype zone_preferences: list[~azure.mgmt.computeschedule.models.ZonePreference] + """ + + distribution_strategy: Optional[Union[str, "_models.DistributionStrategy"]] = rest_field( + name="distributionStrategy", visibility=["read", "create", "update", "delete", "query"] + ) + """The distribution strategy for zone allocation. Known values are: \"BestEffortSingleZone\", + \"Prioritized\", \"BestEffortBalanced\", and \"StrictBalanced\".""" + zone_preferences: Optional[list["_models.ZonePreference"]] = rest_field( + name="zonePreferences", visibility=["read", "create", "update", "delete", "query"] + ) + """The zone preferences for allocation priority.""" + + @overload + def __init__( + self, + *, + distribution_strategy: Optional[Union[str, "_models.DistributionStrategy"]] = None, + zone_preferences: Optional[list["_models.ZonePreference"]] = 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 ZonePreference(_Model): + """A zone preference with a zone identifier and rank. + + :ivar zone: The zone identifier. Required. + :vartype zone: str + :ivar rank: The rank of this zone in the priority order. Required. + :vartype rank: int + """ + + zone: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The zone identifier. Required.""" + rank: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The rank of this zone in the priority order. Required.""" + + @overload + def __init__( + self, + *, + zone: str, + rank: int, + ) -> 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) diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_patch.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_patch.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/_operations.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/_operations.py index 2870e059a014..ab6bb30e1f56 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/_operations.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/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, 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 @@ -39,8 +39,9 @@ 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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +73,7 @@ def build_scheduled_actions_virtual_machines_submit_deallocate_request( # pylin _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +103,7 @@ def build_scheduled_actions_virtual_machines_submit_hibernate_request( # pylint _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +133,7 @@ def build_scheduled_actions_virtual_machines_submit_start_request( # pylint: di _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +163,7 @@ def build_scheduled_actions_virtual_machines_execute_deallocate_request( # pyli _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +193,7 @@ def build_scheduled_actions_virtual_machines_execute_hibernate_request( # pylin _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +223,7 @@ def build_scheduled_actions_virtual_machines_execute_start_request( # pylint: d _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,6 +246,36 @@ def build_scheduled_actions_virtual_machines_execute_start_request( # pylint: d return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_scheduled_actions_virtual_machines_execute_create_flex_request( # pylint: disable=name-too-long + locationparameter: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _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", "2026-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteCreateFlex" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationparameter": _SERIALIZER.url("locationparameter", locationparameter, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_scheduled_actions_virtual_machines_execute_create_request( # pylint: disable=name-too-long locationparameter: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: @@ -252,7 +283,7 @@ def build_scheduled_actions_virtual_machines_execute_create_request( # pylint: _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +313,7 @@ def build_scheduled_actions_virtual_machines_execute_delete_request( # pylint: _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +343,7 @@ def build_scheduled_actions_virtual_machines_get_operation_status_request( # py _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +373,7 @@ def build_scheduled_actions_virtual_machines_cancel_operations_request( # pylin _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -372,7 +403,7 @@ def build_scheduled_actions_virtual_machines_get_operation_errors_request( # py _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -401,7 +432,7 @@ def build_scheduled_actions_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -430,7 +461,7 @@ def build_scheduled_actions_create_or_update_request( # pylint: disable=name-to _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -461,7 +492,7 @@ def build_scheduled_actions_update_request( _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -488,12 +519,9 @@ def build_scheduled_actions_update_request( def build_scheduled_actions_delete_request( resource_group_name: str, scheduled_action_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-04-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}" path_format_arguments = { @@ -507,10 +535,7 @@ def build_scheduled_actions_delete_request( # 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_scheduled_actions_list_by_resource_group_request( # pylint: disable=name-too-long @@ -519,7 +544,7 @@ def build_scheduled_actions_list_by_resource_group_request( # pylint: disable=n _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +571,7 @@ def build_scheduled_actions_list_by_subscription_request( # pylint: disable=nam _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -572,7 +597,7 @@ def build_scheduled_actions_list_resources_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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -601,7 +626,7 @@ def build_scheduled_actions_attach_resources_request( # pylint: disable=name-to _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -632,7 +657,7 @@ def build_scheduled_actions_detach_resources_request( # pylint: disable=name-to _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -663,7 +688,7 @@ def build_scheduled_actions_patch_resources_request( # pylint: disable=name-too _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -690,12 +715,9 @@ def build_scheduled_actions_patch_resources_request( # pylint: disable=name-too def build_scheduled_actions_disable_request( resource_group_name: str, scheduled_action_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-04-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/disable" path_format_arguments = { @@ -709,21 +731,15 @@ def build_scheduled_actions_disable_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) def build_scheduled_actions_enable_request( resource_group_name: str, scheduled_action_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-04-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/enable" path_format_arguments = { @@ -737,10 +753,7 @@ def build_scheduled_actions_enable_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) def build_scheduled_actions_cancel_next_occurrence_request( # pylint: disable=name-too-long @@ -750,7 +763,7 @@ def build_scheduled_actions_cancel_next_occurrence_request( # pylint: disable=n _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -780,7 +793,7 @@ def build_scheduled_actions_trigger_manual_occurrence_request( # pylint: disabl _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -808,7 +821,7 @@ def build_scheduled_action_extension_list_by_vms_request( # pylint: disable=nam _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -834,7 +847,7 @@ def build_occurrences_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -863,7 +876,7 @@ def build_occurrences_list_by_scheduled_action_request( # pylint: disable=name- _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -891,7 +904,7 @@ def build_occurrences_list_resources_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -921,7 +934,7 @@ def build_occurrences_cancel_request( _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -953,7 +966,7 @@ def build_occurrences_delay_request( _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -984,7 +997,7 @@ def build_occurrence_extension_list_occurrence_by_vms_request( # pylint: disabl _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-04-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1081,7 +1094,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) @@ -1097,7 +1113,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 @@ -1126,7 +1145,7 @@ def __init__(self, *args, **kwargs) -> None: def virtual_machines_submit_deallocate( self, locationparameter: str, - request_body: _models.SubmitDeallocateRequest, + request_body: _models.SubmitDeallocateContent, *, content_type: str = "application/json", **kwargs: Any @@ -1137,7 +1156,7 @@ def virtual_machines_submit_deallocate( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.SubmitDeallocateRequest + :type request_body: ~azure.mgmt.computeschedule.models.SubmitDeallocateContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1191,7 +1210,7 @@ def virtual_machines_submit_deallocate( def virtual_machines_submit_deallocate( self, locationparameter: str, - request_body: Union[_models.SubmitDeallocateRequest, JSON, IO[bytes]], + request_body: Union[_models.SubmitDeallocateContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: """VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines @@ -1199,9 +1218,9 @@ def virtual_machines_submit_deallocate( :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: SubmitDeallocateRequest, + :param request_body: The request body. Is one of the following types: SubmitDeallocateContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.SubmitDeallocateRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.SubmitDeallocateContent or JSON or IO[bytes] :return: DeallocateResourceOperationResponse. The DeallocateResourceOperationResponse is compatible with MutableMapping @@ -1243,6 +1262,7 @@ def virtual_machines_submit_deallocate( } _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 @@ -1257,11 +1277,14 @@ def virtual_machines_submit_deallocate( 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.DeallocateResourceOperationResponse, response.json()) @@ -1274,7 +1297,7 @@ def virtual_machines_submit_deallocate( def virtual_machines_submit_hibernate( self, locationparameter: str, - request_body: _models.SubmitHibernateRequest, + request_body: _models.SubmitHibernateContent, *, content_type: str = "application/json", **kwargs: Any @@ -1285,7 +1308,7 @@ def virtual_machines_submit_hibernate( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.SubmitHibernateRequest + :type request_body: ~azure.mgmt.computeschedule.models.SubmitHibernateContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1339,7 +1362,7 @@ def virtual_machines_submit_hibernate( def virtual_machines_submit_hibernate( self, locationparameter: str, - request_body: Union[_models.SubmitHibernateRequest, JSON, IO[bytes]], + request_body: Union[_models.SubmitHibernateContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.HibernateResourceOperationResponse: """VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at @@ -1347,9 +1370,9 @@ def virtual_machines_submit_hibernate( :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: SubmitHibernateRequest, + :param request_body: The request body. Is one of the following types: SubmitHibernateContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.SubmitHibernateRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.SubmitHibernateContent or JSON or IO[bytes] :return: HibernateResourceOperationResponse. The HibernateResourceOperationResponse is compatible with MutableMapping @@ -1391,6 +1414,7 @@ def virtual_machines_submit_hibernate( } _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 @@ -1405,11 +1429,14 @@ def virtual_machines_submit_hibernate( 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.HibernateResourceOperationResponse, response.json()) @@ -1422,7 +1449,7 @@ def virtual_machines_submit_hibernate( def virtual_machines_submit_start( self, locationparameter: str, - request_body: _models.SubmitStartRequest, + request_body: _models.SubmitStartContent, *, content_type: str = "application/json", **kwargs: Any @@ -1433,7 +1460,7 @@ def virtual_machines_submit_start( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.SubmitStartRequest + :type request_body: ~azure.mgmt.computeschedule.models.SubmitStartContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1485,16 +1512,16 @@ def virtual_machines_submit_start( @distributed_trace def virtual_machines_submit_start( - self, locationparameter: str, request_body: Union[_models.SubmitStartRequest, JSON, IO[bytes]], **kwargs: Any + self, locationparameter: str, request_body: Union[_models.SubmitStartContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.StartResourceOperationResponse: """VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: SubmitStartRequest, JSON, + :param request_body: The request body. Is one of the following types: SubmitStartContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.SubmitStartRequest or JSON or IO[bytes] + :type request_body: ~azure.mgmt.computeschedule.models.SubmitStartContent or JSON or IO[bytes] :return: StartResourceOperationResponse. The StartResourceOperationResponse is compatible with MutableMapping :rtype: ~azure.mgmt.computeschedule.models.StartResourceOperationResponse @@ -1535,6 +1562,7 @@ def virtual_machines_submit_start( } _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 @@ -1549,11 +1577,14 @@ def virtual_machines_submit_start( 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.StartResourceOperationResponse, response.json()) @@ -1566,7 +1597,7 @@ def virtual_machines_submit_start( def virtual_machines_execute_deallocate( self, locationparameter: str, - request_body: _models.ExecuteDeallocateRequest, + request_body: _models.ExecuteDeallocateContent, *, content_type: str = "application/json", **kwargs: Any @@ -1577,7 +1608,7 @@ def virtual_machines_execute_deallocate( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeallocateRequest + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeallocateContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1631,7 +1662,7 @@ def virtual_machines_execute_deallocate( def virtual_machines_execute_deallocate( self, locationparameter: str, - request_body: Union[_models.ExecuteDeallocateRequest, JSON, IO[bytes]], + request_body: Union[_models.ExecuteDeallocateContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: """VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, @@ -1639,9 +1670,9 @@ def virtual_machines_execute_deallocate( :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: ExecuteDeallocateRequest, + :param request_body: The request body. Is one of the following types: ExecuteDeallocateContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeallocateRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeallocateContent or JSON or IO[bytes] :return: DeallocateResourceOperationResponse. The DeallocateResourceOperationResponse is compatible with MutableMapping @@ -1683,6 +1714,7 @@ def virtual_machines_execute_deallocate( } _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 @@ -1697,11 +1729,14 @@ def virtual_machines_execute_deallocate( 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.DeallocateResourceOperationResponse, response.json()) @@ -1714,7 +1749,7 @@ def virtual_machines_execute_deallocate( def virtual_machines_execute_hibernate( self, locationparameter: str, - request_body: _models.ExecuteHibernateRequest, + request_body: _models.ExecuteHibernateContent, *, content_type: str = "application/json", **kwargs: Any @@ -1725,7 +1760,7 @@ def virtual_machines_execute_hibernate( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteHibernateRequest + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteHibernateContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1779,7 +1814,7 @@ def virtual_machines_execute_hibernate( def virtual_machines_execute_hibernate( self, locationparameter: str, - request_body: Union[_models.ExecuteHibernateRequest, JSON, IO[bytes]], + request_body: Union[_models.ExecuteHibernateContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.HibernateResourceOperationResponse: """VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, @@ -1787,9 +1822,9 @@ def virtual_machines_execute_hibernate( :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: ExecuteHibernateRequest, + :param request_body: The request body. Is one of the following types: ExecuteHibernateContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteHibernateRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteHibernateContent or JSON or IO[bytes] :return: HibernateResourceOperationResponse. The HibernateResourceOperationResponse is compatible with MutableMapping @@ -1831,6 +1866,7 @@ def virtual_machines_execute_hibernate( } _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 @@ -1845,11 +1881,14 @@ def virtual_machines_execute_hibernate( 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.HibernateResourceOperationResponse, response.json()) @@ -1862,7 +1901,7 @@ def virtual_machines_execute_hibernate( def virtual_machines_execute_start( self, locationparameter: str, - request_body: _models.ExecuteStartRequest, + request_body: _models.ExecuteStartContent, *, content_type: str = "application/json", **kwargs: Any @@ -1873,7 +1912,7 @@ def virtual_machines_execute_start( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteStartRequest + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteStartContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1925,16 +1964,16 @@ def virtual_machines_execute_start( @distributed_trace def virtual_machines_execute_start( - self, locationparameter: str, request_body: Union[_models.ExecuteStartRequest, JSON, IO[bytes]], **kwargs: Any + self, locationparameter: str, request_body: Union[_models.ExecuteStartContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.StartResourceOperationResponse: """VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: ExecuteStartRequest, + :param request_body: The request body. Is one of the following types: ExecuteStartContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteStartRequest or JSON or IO[bytes] + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteStartContent or JSON or IO[bytes] :return: StartResourceOperationResponse. The StartResourceOperationResponse is compatible with MutableMapping :rtype: ~azure.mgmt.computeschedule.models.StartResourceOperationResponse @@ -1975,6 +2014,7 @@ def virtual_machines_execute_start( } _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 @@ -1989,11 +2029,14 @@ def virtual_machines_execute_start( 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.StartResourceOperationResponse, response.json()) @@ -2002,22 +2045,177 @@ def virtual_machines_execute_start( return deserialized # type: ignore + @overload + def virtual_machines_execute_create_flex( + self, + locationparameter: str, + body: _models.ExecuteCreateFlexRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CreateFlexResourceOperationResponse: + """VirtualMachinesExecuteCreateFlex: Execute create operation for a batch of virtual machines with + flex properties, this operation is triggered as soon as Computeschedule receives it. + + :param locationparameter: The location name. Required. + :type locationparameter: str + :param body: The request body. Required. + :type body: ~azure.mgmt.computeschedule.models.ExecuteCreateFlexRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CreateFlexResourceOperationResponse. The CreateFlexResourceOperationResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.computeschedule.models.CreateFlexResourceOperationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def virtual_machines_execute_create_flex( + self, locationparameter: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CreateFlexResourceOperationResponse: + """VirtualMachinesExecuteCreateFlex: Execute create operation for a batch of virtual machines with + flex properties, this operation is triggered as soon as Computeschedule receives it. + + :param locationparameter: The location name. Required. + :type locationparameter: str + :param body: The request body. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CreateFlexResourceOperationResponse. The CreateFlexResourceOperationResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.computeschedule.models.CreateFlexResourceOperationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def virtual_machines_execute_create_flex( + self, locationparameter: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CreateFlexResourceOperationResponse: + """VirtualMachinesExecuteCreateFlex: Execute create operation for a batch of virtual machines with + flex properties, this operation is triggered as soon as Computeschedule receives it. + + :param locationparameter: The location name. Required. + :type locationparameter: str + :param body: The request body. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CreateFlexResourceOperationResponse. The CreateFlexResourceOperationResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.computeschedule.models.CreateFlexResourceOperationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-03-01-preview", + params_added_on={ + "2026-03-01-preview": ["api_version", "subscription_id", "locationparameter", "content_type", "accept"] + }, + api_versions_list=["2026-03-01-preview"], + ) + def virtual_machines_execute_create_flex( + self, locationparameter: str, body: Union[_models.ExecuteCreateFlexRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.CreateFlexResourceOperationResponse: + """VirtualMachinesExecuteCreateFlex: Execute create operation for a batch of virtual machines with + flex properties, this operation is triggered as soon as Computeschedule receives it. + + :param locationparameter: The location name. Required. + :type locationparameter: str + :param body: The request body. Is one of the following types: ExecuteCreateFlexRequest, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.computeschedule.models.ExecuteCreateFlexRequest or JSON or IO[bytes] + :return: CreateFlexResourceOperationResponse. The CreateFlexResourceOperationResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.computeschedule.models.CreateFlexResourceOperationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CreateFlexResourceOperationResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_scheduled_actions_virtual_machines_execute_create_flex_request( + locationparameter=locationparameter, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _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 + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CreateFlexResourceOperationResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @overload def virtual_machines_execute_create( self, locationparameter: str, - request_body: _models.ExecuteCreateRequest, + request_body: _models.ExecuteCreateContent, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateResourceOperationResponse: - """VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteCreate: Execute create operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteCreateRequest + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteCreateContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2031,8 +2229,8 @@ def virtual_machines_execute_create( def virtual_machines_execute_create( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateResourceOperationResponse: - """VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteCreate: Execute create operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -2051,8 +2249,8 @@ def virtual_machines_execute_create( def virtual_machines_execute_create( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateResourceOperationResponse: - """VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteCreate: Execute create operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -2073,19 +2271,19 @@ def virtual_machines_execute_create( params_added_on={ "2025-05-01": ["api_version", "subscription_id", "locationparameter", "content_type", "accept"] }, - api_versions_list=["2025-05-01", "2025-04-15-preview"], + api_versions_list=["2025-05-01", "2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def virtual_machines_execute_create( - self, locationparameter: str, request_body: Union[_models.ExecuteCreateRequest, JSON, IO[bytes]], **kwargs: Any + self, locationparameter: str, request_body: Union[_models.ExecuteCreateContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.CreateResourceOperationResponse: - """VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteCreate: Execute create operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: ExecuteCreateRequest, + :param request_body: The request body. Is one of the following types: ExecuteCreateContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteCreateRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteCreateContent or JSON or IO[bytes] :return: CreateResourceOperationResponse. The CreateResourceOperationResponse is compatible with MutableMapping @@ -2127,6 +2325,7 @@ def virtual_machines_execute_create( } _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 @@ -2141,11 +2340,14 @@ def virtual_machines_execute_create( 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.CreateResourceOperationResponse, response.json()) @@ -2158,18 +2360,18 @@ def virtual_machines_execute_create( def virtual_machines_execute_delete( self, locationparameter: str, - request_body: _models.ExecuteDeleteRequest, + request_body: _models.ExecuteDeleteContent, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeleteResourceOperationResponse: - """VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteDelete: Execute delete operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeleteRequest + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeleteContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2183,8 +2385,8 @@ def virtual_machines_execute_delete( def virtual_machines_execute_delete( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeleteResourceOperationResponse: - """VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteDelete: Execute delete operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -2203,8 +2405,8 @@ def virtual_machines_execute_delete( def virtual_machines_execute_delete( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeleteResourceOperationResponse: - """VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteDelete: Execute delete operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -2225,19 +2427,19 @@ def virtual_machines_execute_delete( params_added_on={ "2025-05-01": ["api_version", "subscription_id", "locationparameter", "content_type", "accept"] }, - api_versions_list=["2025-05-01", "2025-04-15-preview"], + api_versions_list=["2025-05-01", "2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def virtual_machines_execute_delete( - self, locationparameter: str, request_body: Union[_models.ExecuteDeleteRequest, JSON, IO[bytes]], **kwargs: Any + self, locationparameter: str, request_body: Union[_models.ExecuteDeleteContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.DeleteResourceOperationResponse: - """VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this - operation is triggered as soon as Computeschedule receives it. + """[PRIVATE PREVIEW]: VirtualMachinesExecuteDelete: Execute delete operation for a batch of + virtual machines, this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: ExecuteDeleteRequest, + :param request_body: The request body. Is one of the following types: ExecuteDeleteContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeleteRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.ExecuteDeleteContent or JSON or IO[bytes] :return: DeleteResourceOperationResponse. The DeleteResourceOperationResponse is compatible with MutableMapping @@ -2279,6 +2481,7 @@ def virtual_machines_execute_delete( } _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 @@ -2293,11 +2496,14 @@ def virtual_machines_execute_delete( 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.DeleteResourceOperationResponse, response.json()) @@ -2310,7 +2516,7 @@ def virtual_machines_execute_delete( def virtual_machines_get_operation_status( self, locationparameter: str, - request_body: _models.GetOperationStatusRequest, + request_body: _models.GetOperationStatusContent, *, content_type: str = "application/json", **kwargs: Any @@ -2321,7 +2527,7 @@ def virtual_machines_get_operation_status( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.GetOperationStatusRequest + :type request_body: ~azure.mgmt.computeschedule.models.GetOperationStatusContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2375,7 +2581,7 @@ def virtual_machines_get_operation_status( def virtual_machines_get_operation_status( self, locationparameter: str, - request_body: Union[_models.GetOperationStatusRequest, JSON, IO[bytes]], + request_body: Union[_models.GetOperationStatusContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.GetOperationStatusResponse: """VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on @@ -2384,8 +2590,8 @@ def virtual_machines_get_operation_status( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Is one of the following types: - GetOperationStatusRequest, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.GetOperationStatusRequest or JSON or + GetOperationStatusContent, JSON, IO[bytes] Required. + :type request_body: ~azure.mgmt.computeschedule.models.GetOperationStatusContent or JSON or IO[bytes] :return: GetOperationStatusResponse. The GetOperationStatusResponse is compatible with MutableMapping @@ -2427,6 +2633,7 @@ def virtual_machines_get_operation_status( } _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 @@ -2441,11 +2648,14 @@ def virtual_machines_get_operation_status( 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.GetOperationStatusResponse, response.json()) @@ -2458,7 +2668,7 @@ def virtual_machines_get_operation_status( def virtual_machines_cancel_operations( self, locationparameter: str, - request_body: _models.CancelOperationsRequest, + request_body: _models.CancelOperationsContent, *, content_type: str = "application/json", **kwargs: Any @@ -2469,7 +2679,7 @@ def virtual_machines_cancel_operations( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.CancelOperationsRequest + :type request_body: ~azure.mgmt.computeschedule.models.CancelOperationsContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2523,7 +2733,7 @@ def virtual_machines_cancel_operations( def virtual_machines_cancel_operations( self, locationparameter: str, - request_body: Union[_models.CancelOperationsRequest, JSON, IO[bytes]], + request_body: Union[_models.CancelOperationsContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.CancelOperationsResponse: """VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) @@ -2531,9 +2741,9 @@ def virtual_machines_cancel_operations( :param locationparameter: The location name. Required. :type locationparameter: str - :param request_body: The request body. Is one of the following types: CancelOperationsRequest, + :param request_body: The request body. Is one of the following types: CancelOperationsContent, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.CancelOperationsRequest or JSON or + :type request_body: ~azure.mgmt.computeschedule.models.CancelOperationsContent or JSON or IO[bytes] :return: CancelOperationsResponse. The CancelOperationsResponse is compatible with MutableMapping @@ -2575,6 +2785,7 @@ def virtual_machines_cancel_operations( } _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 @@ -2589,11 +2800,14 @@ def virtual_machines_cancel_operations( 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.CancelOperationsResponse, response.json()) @@ -2606,7 +2820,7 @@ def virtual_machines_cancel_operations( def virtual_machines_get_operation_errors( self, locationparameter: str, - request_body: _models.GetOperationErrorsRequest, + request_body: _models.GetOperationErrorsContent, *, content_type: str = "application/json", **kwargs: Any @@ -2617,7 +2831,7 @@ def virtual_machines_get_operation_errors( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Required. - :type request_body: ~azure.mgmt.computeschedule.models.GetOperationErrorsRequest + :type request_body: ~azure.mgmt.computeschedule.models.GetOperationErrorsContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2671,7 +2885,7 @@ def virtual_machines_get_operation_errors( def virtual_machines_get_operation_errors( self, locationparameter: str, - request_body: Union[_models.GetOperationErrorsRequest, JSON, IO[bytes]], + request_body: Union[_models.GetOperationErrorsContent, JSON, IO[bytes]], **kwargs: Any ) -> _models.GetOperationErrorsResponse: """VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors @@ -2680,8 +2894,8 @@ def virtual_machines_get_operation_errors( :param locationparameter: The location name. Required. :type locationparameter: str :param request_body: The request body. Is one of the following types: - GetOperationErrorsRequest, JSON, IO[bytes] Required. - :type request_body: ~azure.mgmt.computeschedule.models.GetOperationErrorsRequest or JSON or + GetOperationErrorsContent, JSON, IO[bytes] Required. + :type request_body: ~azure.mgmt.computeschedule.models.GetOperationErrorsContent or JSON or IO[bytes] :return: GetOperationErrorsResponse. The GetOperationErrorsResponse is compatible with MutableMapping @@ -2723,6 +2937,7 @@ def virtual_machines_get_operation_errors( } _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 @@ -2737,11 +2952,14 @@ def virtual_machines_get_operation_errors( 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.GetOperationErrorsResponse, response.json()) @@ -2762,7 +2980,7 @@ def virtual_machines_get_operation_errors( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def get(self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any) -> _models.ScheduledAction: """Get a ScheduledAction. @@ -2802,6 +3020,7 @@ def get(self, resource_group_name: str, scheduled_action_name: str, **kwargs: An } _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 @@ -2816,11 +3035,14 @@ def get(self, resource_group_name: str, scheduled_action_name: str, **kwargs: An 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.ScheduledAction, response.json()) @@ -2841,7 +3063,7 @@ def get(self, resource_group_name: str, scheduled_action_name: str, **kwargs: An "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def _create_or_update_initial( self, @@ -2886,6 +3108,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 @@ -2899,7 +3122,10 @@ 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 = {} @@ -2909,7 +3135,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3013,7 +3239,7 @@ def begin_create_or_update( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def begin_create_or_update( self, @@ -3183,7 +3409,7 @@ def update( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def update( self, @@ -3242,6 +3468,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 @@ -3256,11 +3483,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.ScheduledAction, response.json()) @@ -3272,15 +3502,9 @@ def update( @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={ - "2025-04-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduled_action_name", - "accept", - ] + "2025-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "scheduled_action_name"] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def _delete_initial(self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3309,6 +3533,7 @@ def _delete_initial(self, resource_group_name: str, scheduled_action_name: str, } _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 @@ -3322,7 +3547,10 @@ def _delete_initial(self, resource_group_name: str, scheduled_action_name: str, 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 = {} @@ -3330,7 +3558,7 @@ def _delete_initial(self, resource_group_name: str, scheduled_action_name: str, 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 @@ -3341,15 +3569,9 @@ def _delete_initial(self, resource_group_name: str, scheduled_action_name: str, @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={ - "2025-04-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduled_action_name", - "accept", - ] + "2025-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "scheduled_action_name"] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def begin_delete(self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any) -> LROPoller[None]: """Delete a ScheduledAction. @@ -3411,7 +3633,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={"2025-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.ScheduledAction"]: """List ScheduledAction resources by resource group. @@ -3477,7 +3699,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ScheduledAction], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ScheduledAction], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3493,7 +3718,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 @@ -3504,7 +3732,7 @@ def get_next(next_link=None): @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={"2025-04-15-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.ScheduledAction"]: """List ScheduledAction resources by subscription ID. @@ -3566,7 +3794,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ScheduledAction], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ScheduledAction], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3582,7 +3813,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 @@ -3601,7 +3835,7 @@ def get_next(next_link=None): "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_resources( self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any @@ -3673,7 +3907,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ScheduledActionResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ScheduledActionResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3689,7 +3926,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 @@ -3793,7 +4033,7 @@ def attach_resources( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def attach_resources( self, @@ -3853,6 +4093,7 @@ def attach_resources( } _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 @@ -3867,11 +4108,14 @@ def attach_resources( 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.RecurringActionsResourceOperationResult, response.json()) @@ -3977,7 +4221,7 @@ def detach_resources( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def detach_resources( self, @@ -4037,6 +4281,7 @@ def detach_resources( } _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 @@ -4051,11 +4296,14 @@ def detach_resources( 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.RecurringActionsResourceOperationResult, response.json()) @@ -4161,7 +4409,7 @@ def patch_resources( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def patch_resources( self, @@ -4221,6 +4469,7 @@ def patch_resources( } _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 @@ -4235,11 +4484,14 @@ def patch_resources( 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.RecurringActionsResourceOperationResult, response.json()) @@ -4252,15 +4504,9 @@ def patch_resources( @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={ - "2025-04-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduled_action_name", - "accept", - ] + "2025-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "scheduled_action_name"] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def disable( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any @@ -4311,7 +4557,10 @@ def disable( # pylint: disable=inconsistent-return-statements 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) if cls: @@ -4321,15 +4570,9 @@ def disable( # pylint: disable=inconsistent-return-statements @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={ - "2025-04-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduled_action_name", - "accept", - ] + "2025-04-15-preview": ["api_version", "subscription_id", "resource_group_name", "scheduled_action_name"] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def enable( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any @@ -4380,7 +4623,10 @@ def enable( # pylint: disable=inconsistent-return-statements 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) if cls: @@ -4483,7 +4729,7 @@ def cancel_next_occurrence( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def cancel_next_occurrence( self, @@ -4543,6 +4789,7 @@ def cancel_next_occurrence( } _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 @@ -4557,11 +4804,14 @@ def cancel_next_occurrence( 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.RecurringActionsResourceOperationResult, response.json()) @@ -4582,7 +4832,7 @@ def cancel_next_occurrence( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def trigger_manual_occurrence( self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any @@ -4624,6 +4874,7 @@ def trigger_manual_occurrence( } _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 @@ -4638,11 +4889,14 @@ def trigger_manual_occurrence( 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.Occurrence, response.json()) @@ -4673,7 +4927,7 @@ def __init__(self, *args, **kwargs) -> None: @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={"2025-04-15-preview": ["api_version", "resource_uri", "accept"]}, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_by_vms(self, resource_uri: str, **kwargs: Any) -> ItemPaged["_models.ScheduledActionResources"]: """List ScheduledActionResources resources by parent. @@ -4739,7 +4993,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ScheduledActionResources], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ScheduledActionResources], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4755,7 +5012,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 @@ -4793,7 +5053,7 @@ def __init__(self, *args, **kwargs) -> None: "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def get( self, resource_group_name: str, scheduled_action_name: str, occurrence_id: str, **kwargs: Any @@ -4838,6 +5098,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 @@ -4852,11 +5113,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.Occurrence, response.json()) @@ -4877,7 +5141,7 @@ def get( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_by_scheduled_action( self, resource_group_name: str, scheduled_action_name: str, **kwargs: Any @@ -4948,7 +5212,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Occurrence], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Occurrence], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4964,7 +5231,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 @@ -4984,7 +5254,7 @@ def get_next(next_link=None): "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_resources( self, resource_group_name: str, scheduled_action_name: str, occurrence_id: str, **kwargs: Any @@ -5058,7 +5328,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.OccurrenceResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.OccurrenceResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5074,7 +5347,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 @@ -5188,7 +5464,7 @@ def cancel( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def cancel( self, @@ -5252,6 +5528,7 @@ def cancel( } _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 @@ -5266,11 +5543,14 @@ def cancel( 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.RecurringActionsResourceOperationResult, response.json()) @@ -5292,7 +5572,7 @@ def cancel( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def _delay_initial( self, @@ -5339,6 +5619,7 @@ def _delay_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 @@ -5352,7 +5633,10 @@ def _delay_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 = {} @@ -5360,7 +5644,7 @@ def _delay_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 @@ -5477,7 +5761,7 @@ def begin_delay( "accept", ] }, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def begin_delay( self, @@ -5584,7 +5868,7 @@ def __init__(self, *args, **kwargs) -> None: @api_version_validation( method_added_on="2025-04-15-preview", params_added_on={"2025-04-15-preview": ["api_version", "resource_uri", "accept"]}, - api_versions_list=["2025-04-15-preview"], + api_versions_list=["2025-04-15-preview", "2026-01-01-preview", "2026-03-01-preview"], ) def list_occurrence_by_vms( self, resource_uri: str, **kwargs: Any @@ -5652,7 +5936,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.OccurrenceExtensionResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.OccurrenceExtensionResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5668,7 +5955,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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/_patch.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/_patch.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/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/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrence_extension_list_occurrence_by_vms_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrence_extension_list_occurrence_by_vms_maximum_set_gen.py index a51b9b06f920..2f2c154bf89c 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrence_extension_list_occurrence_by_vms_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrence_extension_list_occurrence_by_vms_maximum_set_gen.py @@ -31,12 +31,12 @@ def main(): ) response = client.occurrence_extension.list_occurrence_by_vms( - resource_uri="sazvpabfud", + resource_uri="rgdhjh", ) for item in response: print(item) -# x-ms-original-file: 2025-04-15-preview/OccurrenceExtension_ListOccurrenceByVms_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/OccurrenceExtension_ListOccurrenceByVms_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_cancel_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_cancel_maximum_set_gen.py index f6b5193cb306..b59a94431647 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_cancel_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_cancel_maximum_set_gen.py @@ -33,17 +33,17 @@ def main(): response = client.occurrences.cancel( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", - occurrence_id="CB26D7CB-3E27-465F-99C8-EAF7A4118245", + scheduled_action_name="scheduled-action-01", + occurrence_id="11111111-1111-1111-1111-111111111111", body={ "resourceIds": [ - "/subscriptions/CB26D7CB-3E27-465F-99C8-EAF7A4118245/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/myVm" + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rgcomputeschedule/providers/Microsoft.Compute/virtualMachines/vm1" ] }, ) print(response) -# x-ms-original-file: 2025-04-15-preview/Occurrences_Cancel_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/Occurrences_Cancel_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_delay_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_delay_maximum_set_gen.py index 639d94540759..9609e35c0573 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_delay_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_delay_maximum_set_gen.py @@ -33,18 +33,18 @@ def main(): response = client.occurrences.begin_delay( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", - occurrence_id="CB26D7CB-3E27-465F-99C8-EAF7A4118245", + scheduled_action_name="scheduled-action-01", + occurrence_id="11111111-1111-1111-1111-111111111111", body={ - "delay": "2025-05-22T17:00:00.000-07:00", + "delay": "2026-03-12T02:39:48.148Z", "resourceIds": [ - "/subscriptions/CB26D7CB-3E27-465F-99C8-EAF7A4118245/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/myVm" + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rgcomputeschedule/providers/Microsoft.Compute/virtualMachines/vm1" ], }, ).result() print(response) -# x-ms-original-file: 2025-04-15-preview/Occurrences_Delay_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/Occurrences_Delay_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_get_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_get_maximum_set_gen.py index c6770e4dea75..e89998df61ea 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_get_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_get_maximum_set_gen.py @@ -32,12 +32,12 @@ def main(): response = client.occurrences.get( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", - occurrence_id="67b5bada-4772-43fc-8dbb-402476d98a45", + scheduled_action_name="scheduled-action-01", + occurrence_id="11111111-1111-1111-1111-111111111111", ) print(response) -# x-ms-original-file: 2025-04-15-preview/Occurrences_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/Occurrences_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_list_by_scheduled_action_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_list_by_scheduled_action_maximum_set_gen.py index d885bb502904..fae2a607cee0 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_list_by_scheduled_action_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_list_by_scheduled_action_maximum_set_gen.py @@ -32,12 +32,12 @@ def main(): response = client.occurrences.list_by_scheduled_action( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", + scheduled_action_name="scheduled-action-01", ) for item in response: print(item) -# x-ms-original-file: 2025-04-15-preview/Occurrences_ListByScheduledAction_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/Occurrences_ListByScheduledAction_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_list_resources_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_list_resources_maximum_set_gen.py index 4b880c4a836d..42d5253434b9 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_list_resources_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/occurrences_list_resources_maximum_set_gen.py @@ -32,13 +32,13 @@ def main(): response = client.occurrences.list_resources( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", - occurrence_id="CB26D7CB-3E27-465F-99C8-EAF7A4118245", + scheduled_action_name="scheduled-action-01", + occurrence_id="11111111-1111-1111-1111-111111111111", ) for item in response: print(item) -# x-ms-original-file: 2025-04-15-preview/Occurrences_ListResources_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/Occurrences_ListResources_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_maximum_set_gen.py index cb2f4f5b229c..c082e146e29a 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_maximum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-04-15-preview/Operations_List_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/Operations_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_minimum_set_gen.py index 3099972b7689..29e0d7217957 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_minimum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_minimum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-04-15-preview/Operations_List_MinimumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/Operations_List_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_action_extension_list_by_vms_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_action_extension_list_by_vms_maximum_set_gen.py index 819e73e72c7e..909b52973c8c 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_action_extension_list_by_vms_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_action_extension_list_by_vms_maximum_set_gen.py @@ -31,12 +31,12 @@ def main(): ) response = client.scheduled_action_extension.list_by_vms( - resource_uri="sazvpabfud", + resource_uri="rgdhjh", ) for item in response: print(item) -# x-ms-original-file: 2025-04-15-preview/ScheduledActionExtension_ListByVms_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActionExtension_ListByVms_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_action_extension_list_by_vms_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_action_extension_list_by_vms_minimum_set_gen.py deleted file mode 100644 index 99c0bbb8af78..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_action_extension_list_by_vms_minimum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_action_extension_list_by_vms_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_action_extension.list_by_vms( - resource_uri="sazvpabfud", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2025-04-15-preview/ScheduledActionExtension_ListByVms_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_attach_resources_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_attach_resources_maximum_set_gen.py index 622a45e61347..d83860ed5997 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_attach_resources_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_attach_resources_maximum_set_gen.py @@ -33,13 +33,13 @@ def main(): response = client.scheduled_actions.attach_resources( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", + scheduled_action_name="scheduled-action-01", body={ "resources": [ { "notificationSettings": [ { - "destination": "wbhryycyolvnypjxzlawwvb", + "destination": "zaaoabozbhyuhejwsrennfsxowp", "disabled": True, "language": "en-us", "type": "Email", @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_AttachResources_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_AttachResources_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_cancel_next_occurrence_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_cancel_next_occurrence_maximum_set_gen.py index 0d84237bd4dd..0a933a14b914 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_cancel_next_occurrence_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_cancel_next_occurrence_maximum_set_gen.py @@ -33,16 +33,16 @@ def main(): response = client.scheduled_actions.cancel_next_occurrence( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", + scheduled_action_name="scheduled-action-01", body={ "resourceIds": [ - "/subscriptions/1d04e8f1-ee04-4056-b0b2-718f5bb45b04/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/myVm" + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rgcomputeschedule/providers/Microsoft.Compute/virtualMachines/vm1" ] }, ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_CancelNextOccurrence_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_CancelNextOccurrence_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_create_or_update_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_create_or_update_maximum_set_gen.py index 1c7140e9a912..4548eb95fa56 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_create_or_update_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_create_or_update_maximum_set_gen.py @@ -32,37 +32,42 @@ def main(): response = client.scheduled_actions.begin_create_or_update( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", + scheduled_action_name="scheduled-action-01", resource={ - "location": "vmuhgdgipeypkcv", + "location": "hwhsvnvuwsjwu", "properties": { "actionType": "Start", "disabled": True, - "endTime": "2025-04-17T00:23:55.286Z", + "endTime": "2026-03-12T02:39:45.062Z", "notificationSettings": [ - {"destination": "wbhryycyolvnypjxzlawwvb", "disabled": True, "language": "en-us", "type": "Email"} + { + "destination": "zaaoabozbhyuhejwsrennfsxowp", + "disabled": True, + "language": "en-us", + "type": "Email", + } ], "resourceType": "VirtualMachine", "schedule": { "deadlineType": "Unknown", "executionParameters": { "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 17, "retryWindowInMinutes": 29}, + "retryPolicy": {"onFailureAction": "Unknown", "retryCount": 19, "retryWindowInMinutes": 3}, }, - "requestedDaysOfTheMonth": [15], + "requestedDaysOfTheMonth": [18], "requestedMonths": ["January"], "requestedWeekDays": ["Monday"], - "scheduledTime": "19:00:00", - "timeZone": "g", + "scheduledTime": "12:00:00", + "timeZone": "ywgarwvwqegtdsdvv", }, - "startTime": "2025-04-17T00:23:55.281Z", + "startTime": "2026-03-12T02:39:45.061Z", }, - "tags": {"key2102": "obwsqwdydpkscnzceopxgkrhrxtdhv"}, + "tags": {"key1458": "ahuv"}, }, ).result() print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_CreateOrUpdate_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_delete_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_delete_maximum_set_gen.py index 019d3a4a2a14..2be905b9f3fb 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_delete_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_delete_maximum_set_gen.py @@ -32,10 +32,10 @@ def main(): client.scheduled_actions.begin_delete( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", + scheduled_action_name="scheduled-action-01", ).result() -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_detach_resources_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_detach_resources_maximum_set_gen.py index bcce65f22225..bd2e3366b18b 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_detach_resources_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_detach_resources_maximum_set_gen.py @@ -33,16 +33,16 @@ def main(): response = client.scheduled_actions.detach_resources( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", + scheduled_action_name="scheduled-action-01", body={ "resources": [ - "/subscriptions/1d04e8f1-ee04-4056-b0b2-718f5bb45b04/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/myVm" + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rgcomputeschedule/providers/Microsoft.Compute/virtualMachines/vm1" ] }, ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_DetachResources_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_DetachResources_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_disable_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_disable_maximum_set_gen.py index c305f87ef96e..07360e1b74ab 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_disable_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_disable_maximum_set_gen.py @@ -32,10 +32,10 @@ def main(): client.scheduled_actions.disable( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", + scheduled_action_name="scheduled-action-01", ) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_Disable_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_Disable_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_enable_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_enable_maximum_set_gen.py index 31e965817627..17b137f1090a 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_enable_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_enable_maximum_set_gen.py @@ -32,10 +32,10 @@ def main(): client.scheduled_actions.enable( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", + scheduled_action_name="scheduled-action-01", ) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_Enable_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_Enable_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_get_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_get_maximum_set_gen.py index 3ff9af924144..908176db2cb7 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_get_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_get_maximum_set_gen.py @@ -32,11 +32,11 @@ def main(): response = client.scheduled_actions.get( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", + scheduled_action_name="scheduled-action-01", ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_resource_group_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_resource_group_maximum_set_gen.py index 49adce916214..10792b9de174 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_resource_group_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_resource_group_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_ListByResourceGroup_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_resource_group_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_resource_group_minimum_set_gen.py deleted file mode 100644 index 4dea2dd92aca..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_resource_group_minimum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_list_by_resource_group_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.list_by_resource_group( - resource_group_name="rgcomputeschedule", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_ListByResourceGroup_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_subscription_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_subscription_maximum_set_gen.py index 3ffcbc524815..467ea90c0cf1 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_subscription_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_subscription_maximum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_ListBySubscription_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_subscription_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_subscription_minimum_set_gen.py deleted file mode 100644 index f7c010e4eefe..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_by_subscription_minimum_set_gen.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_list_by_subscription_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_ListBySubscription_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_resources_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_resources_maximum_set_gen.py index 2aca1d4df5e7..091ab1834ac6 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_resources_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_list_resources_maximum_set_gen.py @@ -32,12 +32,12 @@ def main(): response = client.scheduled_actions.list_resources( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", + scheduled_action_name="scheduled-action-01", ) for item in response: print(item) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_ListResources_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_ListResources_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_patch_resources_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_patch_resources_maximum_set_gen.py index 17f2032a785b..955e3ca7801c 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_patch_resources_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_patch_resources_maximum_set_gen.py @@ -33,13 +33,13 @@ def main(): response = client.scheduled_actions.patch_resources( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", + scheduled_action_name="scheduled-action-01", body={ "resources": [ { "notificationSettings": [ { - "destination": "wbhryycyolvnypjxzlawwvb", + "destination": "zaaoabozbhyuhejwsrennfsxowp", "disabled": True, "language": "en-us", "type": "Email", @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_PatchResources_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_PatchResources_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_trigger_manual_occurrence_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_trigger_manual_occurrence_maximum_set_gen.py index f06fa6ac31f3..a3aaa3186e34 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_trigger_manual_occurrence_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_trigger_manual_occurrence_maximum_set_gen.py @@ -32,11 +32,11 @@ def main(): response = client.scheduled_actions.trigger_manual_occurrence( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", + scheduled_action_name="scheduled-action-01", ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_TriggerManualOccurrence_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_TriggerManualOccurrence_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_update_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_update_maximum_set_gen.py index c24ac0f4dcee..534a58d1a10b 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_update_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_update_maximum_set_gen.py @@ -32,36 +32,41 @@ def main(): response = client.scheduled_actions.update( resource_group_name="rgcomputeschedule", - scheduled_action_name="myScheduledAction", + scheduled_action_name="scheduled-action-01", properties={ "properties": { "actionType": "Start", "disabled": True, - "endTime": "2025-04-17T00:23:58.149Z", + "endTime": "2026-03-12T02:39:45.818Z", "notificationSettings": [ - {"destination": "wbhryycyolvnypjxzlawwvb", "disabled": True, "language": "en-us", "type": "Email"} + { + "destination": "zaaoabozbhyuhejwsrennfsxowp", + "disabled": True, + "language": "en-us", + "type": "Email", + } ], "resourceType": "VirtualMachine", "schedule": { "deadlineType": "Unknown", "executionParameters": { "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 17, "retryWindowInMinutes": 29}, + "retryPolicy": {"onFailureAction": "Unknown", "retryCount": 19, "retryWindowInMinutes": 3}, }, - "requestedDaysOfTheMonth": [15], + "requestedDaysOfTheMonth": [18], "requestedMonths": ["January"], "requestedWeekDays": ["Monday"], - "scheduledTime": "19:00:00", - "timeZone": "bni", + "scheduledTime": "12:00:00", + "timeZone": "gythvwybzwqubqtmatezbxj", }, - "startTime": "2025-04-17T00:23:58.149Z", + "startTime": "2026-03-12T02:39:45.818Z", }, - "tags": {"key9989": "tryjidk"}, + "tags": {"key100": "nxa"}, }, ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_Update_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_maximum_set_gen.py index 0c78560952ed..3e949ee0f4d9 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_maximum_set_gen.py @@ -31,15 +31,12 @@ def main(): ) response = client.scheduled_actions.virtual_machines_cancel_operations( - locationparameter="nivsvluajruxhmsfgmxjnl", - request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", - "operationIds": ["b211f086-4b91-4686-a453-2f5c012e4d80"], - }, + locationparameter="msbzqfwhqmtrxafwwh", + request_body={"correlationid": "xqlibhgsczjzsbjvc", "operationIds": ["xgnpiititgkgsewft"]}, ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesCancelOperations_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_VirtualMachinesCancelOperations_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_minimum_set_gen.py deleted file mode 100644 index 1b3ed9fa485a..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_minimum_set_gen.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_cancel_operations_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_cancel_operations( - locationparameter="fhdunfivmjiltaiakwhhwdgemfcld", - request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", - "operationIds": ["b211f086-4b91-4686-a453-2f5c012e4d80"], - }, - ) - print(response) - - -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesCancelOperations_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_delete_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_create_flex_maximum_set_gen.py similarity index 51% rename from sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_delete_minimum_set_gen.py rename to sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_create_flex_maximum_set_gen.py index 2fb624eab049..c0ff6b46ee52 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_delete_minimum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_create_flex_maximum_set_gen.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -16,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-computeschedule # USAGE - python scheduled_actions_virtual_machines_execute_delete_minimum_set_gen.py + python scheduled_actions_virtual_machines_execute_create_flex_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,21 +30,34 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.scheduled_actions.virtual_machines_execute_delete( - locationparameter="east", - request_body={ - "executionParameters": {}, - "resources": { - "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", - ] + response = client.scheduled_actions.virtual_machines_execute_create_flex( + locationparameter="bnadpwmpjyfduxue", + body={ + "correlationid": "dnncbbqrhnrwcfqrathnexdpcryo", + "executionParameters": { + "optimizationPreference": "Cost", + "retryPolicy": {"onFailureAction": "Unknown", "retryCount": 19, "retryWindowInMinutes": 3}, + }, + "resourceConfigParameters": { + "baseProfile": {}, + "flexProperties": { + "osType": "Windows", + "priorityProfile": {"allocationStrategy": "LowestPrice", "type": "Regular"}, + "vmSizeProfiles": [{"name": "bmzylbvz", "rank": 24}, {"name": "bmzylbvz", "rank": 24}], + "zoneAllocationPolicy": { + "distributionStrategy": "BestEffortSingleZone", + "zonePreferences": [{"rank": 21, "zone": "kmcvkimwmqwrhfznrqs"}], + }, + }, + "resourceCount": 24, + "resourceOverrides": [{}], + "resourcePrefix": "irskthgchddyuddpqaxlw", }, }, ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesExecuteDelete_MinimumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_VirtualMachinesExecuteCreateFlex_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_create_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_create_maximum_set_gen.py index a6ac45721b83..416ccf783820 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_create_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_create_maximum_set_gen.py @@ -31,82 +31,24 @@ def main(): ) response = client.scheduled_actions.virtual_machines_execute_create( - locationparameter="oslhbouzgevzpeydssyelhw", + locationparameter="tcvpodlxbyg", request_body={ - "correlationid": "dfe927c5-16a6-40b7-a0f7-8524975ed642", - "executionParameters": {"retryPolicy": {"retryCount": 5, "retryWindowInMinutes": 40}}, + "correlationid": "pkm", + "executionParameters": { + "optimizationPreference": "Cost", + "retryPolicy": {"onFailureAction": "Unknown", "retryCount": 19, "retryWindowInMinutes": 3}, + }, "resourceConfigParameters": { - "baseProfile": { - "computeApiVersion": "2024-07-01", - "hardwareProfile": {"name": "F1"}, - "provisioningState": 0, - "resourcegroupName": "RG5ABF491C-3164-42A6-8CB5-BF3CB53B018B", - "storageProfile": {"osDisk": {"osType": 0}}, - "vmExtensions": [ - { - "autoUpgradeMinorVersion": True, - "enableAutomaticUpgrade": True, - "protectedSettings": "SomeDecryptedSecretValue", - "provisioningState": 0, - "publisher": "Microsoft.Azure.Monitor", - "type": "AzureMonitorLinuxAgent", - "typeHandlerVersion": "1.0", - }, - {"name": "myExtensionName"}, - ], - }, - "resourceCount": 2, - "resourceOverrides": [ - { - "location": "LocalDev", - "name": "myFleet_523", - "properties": { - "hardwareProfile": {"vmSize": "Standard_F1s"}, - "osProfile": { - "adminPassword": "SomeDecryptedSecretValue", - "adminUsername": "adminUser", - "computerName": "myFleet000000", - "windowsConfiguration": { - "additionalUnattendContent": [ - {"content": "", "passName": "someValue"}, - {"content": "SomeDecryptedSecretValue", "passName": "someOtherValue"}, - ] - }, - }, - "priority": 0, - "provisioningState": 0, - }, - "zones": ["1"], - }, - { - "location": "LocalDev", - "name": "myFleet_524", - "properties": { - "hardwareProfile": {"vmSize": "Standard_G1s"}, - "osProfile": { - "adminPassword": "SomeDecryptedSecretValue", - "adminUsername": "adminUser", - "computerName": "myFleet000000", - "windowsConfiguration": { - "additionalUnattendContent": [ - {"content": "", "passName": "someValue"}, - {"content": "SomeDecryptedSecretValue", "passName": "someOtherValue"}, - ] - }, - }, - "priority": 0, - "provisioningState": 0, - }, - "zones": ["2"], - }, - ], - "resourcePrefix": "TL1", + "baseProfile": {}, + "resourceCount": 19, + "resourceOverrides": [{}], + "resourcePrefix": "ilgcqhoqrpwfkprxok", }, }, ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesExecuteCreate_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_VirtualMachinesExecuteCreate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_create_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_create_minimum_set_gen.py deleted file mode 100644 index 1d9849f6fbd1..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_create_minimum_set_gen.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_execute_create_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_execute_create( - locationparameter="useast", - request_body={ - "executionParameters": {}, - "resourceConfigParameters": { - "baseProfile": { - "computeApiVersion": "2024-07-01", - "hardwareProfile": {"name": "F1"}, - "provisioningState": 0, - "resourcegroupName": "RG5ABF491C-3164-42A6-8CB5-BF3CB53B018B", - "storageProfile": {"osDisk": {"osType": 0}}, - "vmExtensions": [ - { - "autoUpgradeMinorVersion": True, - "enableAutomaticUpgrade": True, - "protectedSettings": "SomeDecryptedSecretValue", - "provisioningState": 0, - "publisher": "Microsoft.Azure.Monitor", - "type": "AzureMonitorLinuxAgent", - "typeHandlerVersion": "1.0", - }, - {"name": "myExtensionName"}, - ], - }, - "resourceCount": 2, - "resourceOverrides": [ - { - "location": "LocalDev", - "name": "myFleet_523", - "properties": { - "hardwareProfile": {"vmSize": "Standard_F1s"}, - "osProfile": { - "adminPassword": "SomeDecryptedSecretValue", - "adminUsername": "adminUser", - "computerName": "myFleet000000", - "windowsConfiguration": { - "additionalUnattendContent": [ - {"content": "", "passName": "someValue"}, - {"content": "SomeDecryptedSecretValue", "passName": "someOtherValue"}, - ] - }, - }, - "priority": 0, - "provisioningState": 0, - }, - "zones": ["1"], - }, - { - "location": "LocalDev", - "name": "myFleet_524", - "properties": { - "hardwareProfile": {"vmSize": "Standard_G1s"}, - "osProfile": { - "adminPassword": "SomeDecryptedSecretValue", - "adminUsername": "adminUser", - "computerName": "myFleet000000", - "windowsConfiguration": { - "additionalUnattendContent": [ - {"content": "", "passName": "someValue"}, - {"content": "SomeDecryptedSecretValue", "passName": "someOtherValue"}, - ] - }, - }, - "priority": 0, - "provisioningState": 0, - }, - "zones": ["2"], - }, - ], - }, - }, - ) - print(response) - - -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesExecuteCreate_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_maximum_set_gen.py index a6cc9c6d60b2..5e70dbda3bf9 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_maximum_set_gen.py @@ -32,16 +32,16 @@ def main(): ) response = client.scheduled_actions.virtual_machines_execute_deallocate( - locationparameter="ykcaptgboliddcfyaiuimj", + locationparameter="tobscvse", request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", + "correlationid": "ruwskrvse", "executionParameters": { "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 17, "retryWindowInMinutes": 29}, + "retryPolicy": {"onFailureAction": "Unknown", "retryCount": 19, "retryWindowInMinutes": 3}, }, "resources": { "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rgcomputeschedule/providers/Microsoft.Compute/virtualMachines/vm1" ] }, }, @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_minimum_set_gen.py deleted file mode 100644 index f381345964dc..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_minimum_set_gen.py +++ /dev/null @@ -1,51 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_execute_deallocate_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_execute_deallocate( - locationparameter="qqfrkswrovcice", - request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", - "executionParameters": {}, - "resources": { - "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" - ] - }, - }, - ) - print(response) - - -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesExecuteDeallocate_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_delete_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_delete_maximum_set_gen.py index b9a18086e232..8aaf42949bf0 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_delete_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_delete_maximum_set_gen.py @@ -32,15 +32,17 @@ def main(): ) response = client.scheduled_actions.virtual_machines_execute_delete( - locationparameter="east", + locationparameter="swchjs", request_body={ - "correlationid": "dfe927c5-16a6-40b7-a0f7-8524975ed642", - "executionParameters": {"retryPolicy": {"retryCount": 2, "retryWindowInMinutes": 4}}, - "forceDeletion": False, + "correlationid": "upxtzubhqqzhk", + "executionParameters": { + "optimizationPreference": "Cost", + "retryPolicy": {"onFailureAction": "Unknown", "retryCount": 19, "retryWindowInMinutes": 3}, + }, + "forceDeletion": True, "resources": { "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rgcomputeschedule/providers/Microsoft.Compute/virtualMachines/vm1" ] }, }, @@ -48,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesExecuteDelete_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_VirtualMachinesExecuteDelete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_maximum_set_gen.py index ee60e97506fa..5c591c9aed09 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_maximum_set_gen.py @@ -32,16 +32,16 @@ def main(): ) response = client.scheduled_actions.virtual_machines_execute_hibernate( - locationparameter="gztd", + locationparameter="zydcprtgybcyilgugfwtfp", request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", + "correlationid": "miqcvaudnngdedocspkthnoo", "executionParameters": { "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 17, "retryWindowInMinutes": 29}, + "retryPolicy": {"onFailureAction": "Unknown", "retryCount": 19, "retryWindowInMinutes": 3}, }, "resources": { "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rgcomputeschedule/providers/Microsoft.Compute/virtualMachines/vm1" ] }, }, @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_minimum_set_gen.py deleted file mode 100644 index d50175329eab..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_minimum_set_gen.py +++ /dev/null @@ -1,51 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_execute_hibernate_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_execute_hibernate( - locationparameter="xtmm", - request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", - "executionParameters": {}, - "resources": { - "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" - ] - }, - }, - ) - print(response) - - -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesExecuteHibernate_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_maximum_set_gen.py index cebea483d2ac..cce80e8432ca 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_maximum_set_gen.py @@ -32,16 +32,16 @@ def main(): ) response = client.scheduled_actions.virtual_machines_execute_start( - locationparameter="qk", + locationparameter="vpcshwavxibrshqepqktfyu", request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", + "correlationid": "fmjvelcuicsoqykbyercnrkda", "executionParameters": { "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 17, "retryWindowInMinutes": 29}, + "retryPolicy": {"onFailureAction": "Unknown", "retryCount": 19, "retryWindowInMinutes": 3}, }, "resources": { "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rgcomputeschedule/providers/Microsoft.Compute/virtualMachines/vm1" ] }, }, @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesExecuteStart_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_VirtualMachinesExecuteStart_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_minimum_set_gen.py deleted file mode 100644 index 4af55d830334..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_minimum_set_gen.py +++ /dev/null @@ -1,51 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_execute_start_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_execute_start( - locationparameter="fbdewllahrteoavajbomjc", - request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", - "executionParameters": {}, - "resources": { - "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" - ] - }, - }, - ) - print(response) - - -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesExecuteStart_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_maximum_set_gen.py index 1cf21ed0bf05..8c942f3d198a 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_maximum_set_gen.py @@ -31,12 +31,12 @@ def main(): ) response = client.scheduled_actions.virtual_machines_get_operation_errors( - locationparameter="ennweqswbghorrgzbet", - request_body={"operationIds": ["ksufjznokhsbowdupyt"]}, + locationparameter="hvevnodfnj", + request_body={"operationIds": ["enrmeatzaw"]}, ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_minimum_set_gen.py index 02c7b7046108..0300982e02ce 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_minimum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_minimum_set_gen.py @@ -31,12 +31,12 @@ def main(): ) response = client.scheduled_actions.virtual_machines_get_operation_errors( - locationparameter="gcdqwzmxtcn", - request_body={"operationIds": ["ksufjznokhsbowdupyt"]}, + locationparameter="vkkri", + request_body={"operationIds": ["enrmeatzaw"]}, ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MinimumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_maximum_set_gen.py index a509eb35aa99..27b88f354847 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_maximum_set_gen.py @@ -31,15 +31,12 @@ def main(): ) response = client.scheduled_actions.virtual_machines_get_operation_status( - locationparameter="ntfcikxsmthfkdhdcjpevmydzu", - request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", - "operationIds": ["b211f086-4b91-4686-a453-2f5c012e4d80"], - }, + locationparameter="gcbtdawfspg", + request_body={"correlationid": "hzpmcjplnbokebrbxrtuvxpp", "operationIds": ["ehesndkmbcncsvkqvxwkbmidmaxhx"]}, ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_minimum_set_gen.py deleted file mode 100644 index f19210d8dd8d..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_minimum_set_gen.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_get_operation_status_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_get_operation_status( - locationparameter="ykvvjfoopmkwznctgaiblzvea", - request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", - "operationIds": ["duhqnwosjzexcfwfhryvy"], - }, - ) - print(response) - - -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesGetOperationStatus_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_maximum_set_gen.py index a120479fe8d2..c9af13ce43f3 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_maximum_set_gen.py @@ -32,28 +32,30 @@ def main(): ) response = client.scheduled_actions.virtual_machines_submit_deallocate( - locationparameter="ycipx", + locationparameter="wtkfymadciksjsvamowmbiqdltdzw", request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", + "correlationid": "rsi", "executionParameters": { "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 17, "retryWindowInMinutes": 29}, + "retryPolicy": {"onFailureAction": "Unknown", "retryCount": 19, "retryWindowInMinutes": 3}, }, "resources": { "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rgcomputeschedule/providers/Microsoft.Compute/virtualMachines/vm1" ] }, "schedule": { - "deadLine": "2025-04-17T00:23:56.803Z", + "deadLine": "2026-03-12T02:39:44.444Z", + "deadline": "2026-03-12T02:39:44.444Z", "deadlineType": "Unknown", - "timeZone": "aigbjdnldtzkteqi", + "timeZone": "feiohhavpmmjrf", + "timezone": "ehbjytlhnykfkjxujca", }, }, ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesSubmitDeallocate_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_VirtualMachinesSubmitDeallocate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_minimum_set_gen.py deleted file mode 100644 index cd06538c3010..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_minimum_set_gen.py +++ /dev/null @@ -1,56 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_submit_deallocate_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_submit_deallocate( - locationparameter="zrcmkxsbuxsxxulky", - request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", - "executionParameters": {}, - "resources": { - "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" - ] - }, - "schedule": { - "deadLine": "2025-04-17T00:23:56.803Z", - "deadlineType": "Unknown", - "timeZone": "aigbjdnldtzkteqi", - }, - }, - ) - print(response) - - -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesSubmitDeallocate_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_maximum_set_gen.py index 379ac508095b..69fdd8313a97 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_maximum_set_gen.py @@ -32,28 +32,30 @@ def main(): ) response = client.scheduled_actions.virtual_machines_submit_hibernate( - locationparameter="rhadyapnyvmobwg", + locationparameter="aoewv", request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", + "correlationid": "lgpkqjojane", "executionParameters": { "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 17, "retryWindowInMinutes": 29}, + "retryPolicy": {"onFailureAction": "Unknown", "retryCount": 19, "retryWindowInMinutes": 3}, }, "resources": { "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rgcomputeschedule/providers/Microsoft.Compute/virtualMachines/vm1" ] }, "schedule": { - "deadLine": "2025-04-17T00:23:56.803Z", + "deadLine": "2026-03-12T02:39:44.444Z", + "deadline": "2026-03-12T02:39:44.444Z", "deadlineType": "Unknown", - "timeZone": "aigbjdnldtzkteqi", + "timeZone": "feiohhavpmmjrf", + "timezone": "ehbjytlhnykfkjxujca", }, }, ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesSubmitHibernate_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_VirtualMachinesSubmitHibernate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_minimum_set_gen.py deleted file mode 100644 index 38f04dbecd3d..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_minimum_set_gen.py +++ /dev/null @@ -1,56 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_submit_hibernate_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_submit_hibernate( - locationparameter="zuevcqpgdohzbjodhachtr", - request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", - "executionParameters": {}, - "resources": { - "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" - ] - }, - "schedule": { - "deadLine": "2025-04-17T00:23:56.803Z", - "deadlineType": "Unknown", - "timeZone": "aigbjdnldtzkteqi", - }, - }, - ) - print(response) - - -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesSubmitHibernate_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_maximum_set_gen.py index 5881ca438c87..dda6194c593c 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_maximum_set_gen.py @@ -32,28 +32,30 @@ def main(): ) response = client.scheduled_actions.virtual_machines_submit_start( - locationparameter="pxtvvk", + locationparameter="cabm", request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", + "correlationid": "ttlsvgmsykwowrajtmnztcm", "executionParameters": { "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 17, "retryWindowInMinutes": 29}, + "retryPolicy": {"onFailureAction": "Unknown", "retryCount": 19, "retryWindowInMinutes": 3}, }, "resources": { "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rgcomputeschedule/providers/Microsoft.Compute/virtualMachines/vm1" ] }, "schedule": { - "deadLine": "2025-04-17T00:23:56.803Z", + "deadLine": "2026-03-12T02:39:44.444Z", + "deadline": "2026-03-12T02:39:44.444Z", "deadlineType": "Unknown", - "timeZone": "aigbjdnldtzkteqi", + "timeZone": "feiohhavpmmjrf", + "timezone": "ehbjytlhnykfkjxujca", }, }, ) print(response) -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesSubmitStart_MaximumSet_Gen.json +# x-ms-original-file: 2026-03-01-preview/ScheduledActions_VirtualMachinesSubmitStart_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_minimum_set_gen.py deleted file mode 100644 index 66a438457765..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_minimum_set_gen.py +++ /dev/null @@ -1,56 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_submit_start_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_submit_start( - locationparameter="ufrcsuw", - request_body={ - "correlationid": "b211f086-4b91-4686-a453-2f5c012e4d80", - "executionParameters": {}, - "resources": { - "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" - ] - }, - "schedule": { - "deadLine": "2025-04-17T00:23:56.803Z", - "deadlineType": "Unknown", - "timeZone": "aigbjdnldtzkteqi", - }, - }, - ) - print(response) - - -# x-ms-original-file: 2025-04-15-preview/ScheduledActions_VirtualMachinesSubmitStart_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations.py index d56f301fda0d..1f42f4f9c5cd 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations.py @@ -27,7 +27,7 @@ def test_scheduled_actions_virtual_machines_submit_deallocate(self, resource_gro "correlationid": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, "schedule": { @@ -52,7 +52,7 @@ def test_scheduled_actions_virtual_machines_submit_hibernate(self, resource_grou "correlationid": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, "schedule": { @@ -77,7 +77,7 @@ def test_scheduled_actions_virtual_machines_submit_start(self, resource_group): "correlationid": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, "schedule": { @@ -102,7 +102,7 @@ def test_scheduled_actions_virtual_machines_execute_deallocate(self, resource_gr "correlationid": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, }, @@ -120,7 +120,7 @@ def test_scheduled_actions_virtual_machines_execute_hibernate(self, resource_gro "correlationid": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, }, @@ -138,7 +138,7 @@ def test_scheduled_actions_virtual_machines_execute_start(self, resource_group): "correlationid": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, }, @@ -147,6 +147,38 @@ def test_scheduled_actions_virtual_machines_execute_start(self, resource_group): # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_scheduled_actions_virtual_machines_execute_create_flex(self, resource_group): + response = self.client.scheduled_actions.virtual_machines_execute_create_flex( + locationparameter="str", + body={ + "executionParameters": { + "optimizationPreference": "str", + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, + }, + "resourceConfigParameters": { + "flexProperties": { + "osType": "str", + "priorityProfile": {"allocationStrategy": "str", "type": "str"}, + "vmSizeProfiles": [{"name": "str", "rank": 0}], + "zoneAllocationPolicy": { + "distributionStrategy": "str", + "zonePreferences": [{"rank": 0, "zone": "str"}], + }, + }, + "resourceCount": 0, + "baseProfile": {"str": {}}, + "resourceOverrides": [{"str": {}}], + "resourcePrefix": "str", + }, + "correlationid": "str", + }, + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_scheduled_actions_virtual_machines_execute_create(self, resource_group): @@ -155,7 +187,7 @@ def test_scheduled_actions_virtual_machines_execute_create(self, resource_group) request_body={ "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resourceConfigParameters": { "resourceCount": 0, @@ -178,7 +210,7 @@ def test_scheduled_actions_virtual_machines_execute_delete(self, resource_group) request_body={ "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, "correlationid": "str", @@ -258,7 +290,7 @@ def test_scheduled_actions_begin_create_or_update(self, resource_group): "deadlineType": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, }, "startTime": "2020-02-20 00:00:00", @@ -306,7 +338,7 @@ def test_scheduled_actions_update(self, resource_group): "deadlineType": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, }, "startTime": "2020-02-20 00:00:00", diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations_async.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations_async.py index dacc05201dc7..c601c25bbec0 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations_async.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations_async.py @@ -28,7 +28,7 @@ async def test_scheduled_actions_virtual_machines_submit_deallocate(self, resour "correlationid": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, "schedule": { @@ -53,7 +53,7 @@ async def test_scheduled_actions_virtual_machines_submit_hibernate(self, resourc "correlationid": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, "schedule": { @@ -78,7 +78,7 @@ async def test_scheduled_actions_virtual_machines_submit_start(self, resource_gr "correlationid": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, "schedule": { @@ -103,7 +103,7 @@ async def test_scheduled_actions_virtual_machines_execute_deallocate(self, resou "correlationid": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, }, @@ -121,7 +121,7 @@ async def test_scheduled_actions_virtual_machines_execute_hibernate(self, resour "correlationid": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, }, @@ -139,7 +139,7 @@ async def test_scheduled_actions_virtual_machines_execute_start(self, resource_g "correlationid": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, }, @@ -148,6 +148,38 @@ async def test_scheduled_actions_virtual_machines_execute_start(self, resource_g # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_scheduled_actions_virtual_machines_execute_create_flex(self, resource_group): + response = await self.client.scheduled_actions.virtual_machines_execute_create_flex( + locationparameter="str", + body={ + "executionParameters": { + "optimizationPreference": "str", + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, + }, + "resourceConfigParameters": { + "flexProperties": { + "osType": "str", + "priorityProfile": {"allocationStrategy": "str", "type": "str"}, + "vmSizeProfiles": [{"name": "str", "rank": 0}], + "zoneAllocationPolicy": { + "distributionStrategy": "str", + "zonePreferences": [{"rank": 0, "zone": "str"}], + }, + }, + "resourceCount": 0, + "baseProfile": {"str": {}}, + "resourceOverrides": [{"str": {}}], + "resourcePrefix": "str", + }, + "correlationid": "str", + }, + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_scheduled_actions_virtual_machines_execute_create(self, resource_group): @@ -156,7 +188,7 @@ async def test_scheduled_actions_virtual_machines_execute_create(self, resource_ request_body={ "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resourceConfigParameters": { "resourceCount": 0, @@ -179,7 +211,7 @@ async def test_scheduled_actions_virtual_machines_execute_delete(self, resource_ request_body={ "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, "correlationid": "str", @@ -260,7 +292,7 @@ async def test_scheduled_actions_begin_create_or_update(self, resource_group): "deadlineType": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, }, "startTime": "2020-02-20 00:00:00", @@ -309,7 +341,7 @@ async def test_scheduled_actions_update(self, resource_group): "deadlineType": "str", "executionParameters": { "optimizationPreference": "str", - "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, + "retryPolicy": {"onFailureAction": "str", "retryCount": 0, "retryWindowInMinutes": 0}, }, }, "startTime": "2020-02-20 00:00:00", diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/pyproject.toml b/sdk/computeschedule/azure-mgmt-computeschedule/pyproject.toml index 540da07d41af..9d6afac8bd26 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/pyproject.toml +++ b/sdk/computeschedule/azure-mgmt-computeschedule/pyproject.toml @@ -1,6 +1,88 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-computeschedule" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Computeschedule Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.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.computeschedule._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-computeschedule" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Computeschedule Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +exclude_folders = "" +title = "ComputeScheduleMgmtClient" diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/sdk_packaging.toml b/sdk/computeschedule/azure-mgmt-computeschedule/sdk_packaging.toml deleted file mode 100644 index 770639ddf61f..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/sdk_packaging.toml +++ /dev/null @@ -1,12 +0,0 @@ -[packaging] -package_name = "azure-mgmt-computeschedule" -package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "Computeschedule Management" -package_doc_id = "" -is_stable = false -is_arm = true -need_msrestazure = false -need_azuremgmtcore = true -sample_link = "" -exclude_folders = "" -title = "ComputeScheduleMgmtClient" diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/setup.py b/sdk/computeschedule/azure-mgmt-computeschedule/setup.py deleted file mode 100644 index 9272fb177345..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/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-computeschedule" -PACKAGE_PPRINT_NAME = "Computeschedule 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 :: 4 - Beta", - "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.5.0", - ], - python_requires=">=3.9", -) diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/tsp-location.yaml b/sdk/computeschedule/azure-mgmt-computeschedule/tsp-location.yaml index 20b208eb7ab1..21a701aa9fd9 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/tsp-location.yaml +++ b/sdk/computeschedule/azure-mgmt-computeschedule/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/computeschedule/ComputeSchedule.Management -commit: a9b095e39f774899a97d857d92a34c7715dc3f42 +commit: 00f1feade1e5f3aab30ca03b547f77a869f52bf2 repo: Azure/azure-rest-api-specs additionalDirectories: