From 1e4151a39618b6bdc2ddb1f2d81fc7992c03fa63 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sat, 28 Jan 2023 10:06:11 +0000 Subject: [PATCH] CodeGen from PR 22338 in Azure/azure-rest-api-specs Merge ea16ebe05d6c2f1495094b82a65a04213bddcaf3 into 91af1c93c771c12d8b147f122c3519eae087d0ff --- .../azure-mgmt-reservations/_meta.json | 6 +- .../azure/mgmt/reservations/_serialization.py | 87 +- .../azure/mgmt/reservations/_vendor.py | 5 +- .../azure/mgmt/reservations/_version.py | 2 +- .../_azure_reservation_api_operations.py | 124 +- .../_calculate_exchange_operations.py | 4 +- .../_calculate_refund_operations.py | 2 +- .../aio/operations/_exchange_operations.py | 4 +- .../aio/operations/_operation_operations.py | 2 +- .../aio/operations/_quota_operations.py | 12 +- .../aio/operations/_reservation_operations.py | 110 +- .../_reservation_order_operations.py | 18 +- .../_return_operations_operations.py | 210 ++- .../mgmt/reservations/models/__init__.py | 20 + .../models/_azure_reservation_api_enums.py | 28 +- .../mgmt/reservations/models/_models_py3.py | 1374 ++++++++++++----- .../_azure_reservation_api_operations.py | 132 +- .../_calculate_exchange_operations.py | 6 +- .../_calculate_refund_operations.py | 4 +- .../operations/_exchange_operations.py | 6 +- .../operations/_operation_operations.py | 4 +- .../operations/_quota_operations.py | 12 +- .../operations/_reservation_operations.py | 139 +- .../_reservation_order_operations.py | 28 +- .../_return_operations_operations.py | 218 ++- .../generated_samples/archive.py | 2 +- .../generated_samples/calculate_exchange.py | 17 +- .../generated_samples/calculate_refund.py | 2 +- .../calculate_reservation_order.py | 2 +- .../change_directory_reservation_order.py | 2 +- .../generated_samples/exchange.py | 2 +- .../get_applied_reservations.py | 2 +- .../generated_samples/get_available_scope.py | 2 +- .../generated_samples/get_catalog.py | 5 +- .../generated_samples/get_operations.py | 2 +- .../get_reservation_details.py | 4 +- .../get_reservation_order_details.py | 2 +- ...er_details_with_expand_plan_information.py | 2 +- .../get_reservation_orders.py | 2 +- .../get_reservation_revisions.py | 4 +- .../generated_samples/get_reservations.py | 2 +- .../get_reservations_from_order.py | 2 +- .../generated_samples/merge_reservations.py | 2 +- .../purchase_reservation_order.py | 2 +- .../generated_samples/return.py | 8 +- .../generated_samples/split_reservation.py | 2 +- .../generated_samples/unarchive.py | 2 +- .../generated_samples/update_reservation.py | 2 +- 48 files changed, 1779 insertions(+), 852 deletions(-) diff --git a/sdk/reservations/azure-mgmt-reservations/_meta.json b/sdk/reservations/azure-mgmt-reservations/_meta.json index 4d9514cc53933..91c559c2e6d96 100644 --- a/sdk/reservations/azure-mgmt-reservations/_meta.json +++ b/sdk/reservations/azure-mgmt-reservations/_meta.json @@ -1,11 +1,11 @@ { - "commit": "89a9bf17524904e7670f0fd2d62ac882ca00d85c", + "commit": "a43daf35540f31bf100b403b2ed0ca3574c454ae", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.7", + "@autorest/python@6.2.16", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/reservations/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/reservations/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.2.16 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/reservations/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_serialization.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_serialization.py index 2c170e28dbca2..f17c068e833e8 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_serialization.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_serialization.py @@ -38,7 +38,22 @@ import re import sys import codecs -from typing import Optional, Union, AnyStr, IO, Mapping +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) try: from urllib import quote # type: ignore @@ -48,12 +63,14 @@ import isodate # type: ignore -from typing import Dict, Any, cast - from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + class RawDeserializer: @@ -277,8 +294,8 @@ class Model(object): _attribute_map: Dict[str, Dict[str, Any]] = {} _validation: Dict[str, Dict[str, Any]] = {} - def __init__(self, **kwargs): - self.additional_properties = {} + def __init__(self, **kwargs: Any) -> None: + self.additional_properties: Dict[str, Any] = {} for k in kwargs: if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -287,25 +304,25 @@ def __init__(self, **kwargs): else: setattr(self, k, kwargs[k]) - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" return not self.__eq__(other) - def __str__(self): + def __str__(self) -> str: return str(self.__dict__) @classmethod - def enable_additional_properties_sending(cls): + def enable_additional_properties_sending(cls) -> None: cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} @classmethod - def is_xml_model(cls): + def is_xml_model(cls) -> bool: try: cls._xml_map # type: ignore except AttributeError: @@ -322,7 +339,7 @@ def _create_xml_node(cls): return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - def serialize(self, keep_readonly=False, **kwargs): + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: """Return the JSON that would be sent to azure from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -336,8 +353,13 @@ def serialize(self, keep_readonly=False, **kwargs): serializer = Serializer(self._infer_class_models()) return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) - def as_dict(self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs): - """Return a dict that can be JSONify using json.dump. + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: @@ -384,7 +406,7 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls, data, content_type=None): + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. @@ -396,7 +418,12 @@ def deserialize(cls, data, content_type=None): return deserializer(cls.__name__, data, content_type=content_type) @classmethod - def from_dict(cls, data, key_extractors=None, content_type=None): + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: """Parse a dict using given key extractor return a model. By default consider key @@ -409,8 +436,8 @@ def from_dict(cls, data, key_extractors=None, content_type=None): :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( - [ + deserializer.key_extractors = ( # type: ignore + [ # type: ignore attribute_key_case_insensitive_extractor, rest_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, @@ -518,7 +545,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -534,7 +561,7 @@ def __init__(self, classes=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -626,8 +653,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized.append(local_node) # type: ignore else: # JSON for k in reversed(keys): # type: ignore - unflattened = {k: new_attr} - new_attr = unflattened + new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized @@ -656,8 +682,8 @@ def body(self, data, data_type, **kwargs): """ # Just in case this is a dict - internal_data_type = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type, None) + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: @@ -777,6 +803,8 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: + if data is AzureCoreNull: + return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -1161,7 +1189,8 @@ def rest_key_extractor(attr, attr_desc, data): working_data = data while "." in key: - dict_keys = _FLATTEN.split(key) + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1332,7 +1361,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1352,7 +1381,7 @@ def __init__(self, classes=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1471,7 +1500,7 @@ def _classify_target(self, target, data): Once classification has been determined, initialize object. :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. """ if target is None: return None, None @@ -1486,7 +1515,7 @@ def _classify_target(self, target, data): target = target._classify(data, self.dependencies) except AttributeError: pass # Target is not a Model, no classify - return target, target.__class__.__name__ + return target, target.__class__.__name__ # type: ignore def failsafe_deserialize(self, target_obj, data, content_type=None): """Ignores any errors encountered in deserialization, @@ -1496,7 +1525,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): a deserialization error. :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. """ try: diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_vendor.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_vendor.py index c5bb55a49a2ba..9123ccb875bcc 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_vendor.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_vendor.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import TYPE_CHECKING +from typing import List, TYPE_CHECKING, cast from azure.core.pipeline.transport import HttpRequest @@ -33,7 +33,8 @@ def _format_url_section(template, **kwargs): try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_version.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_version.py index 67a252e2565e1..e5754a47ce68f 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_version.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.2.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_azure_reservation_api_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_azure_reservation_api_operations.py index 2374bf3143b05..b695c4fd9e739 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_azure_reservation_api_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_azure_reservation_api_operations.py @@ -7,8 +7,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -20,6 +21,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat @@ -41,8 +43,8 @@ class AzureReservationAPIOperationsMixin(AzureReservationAPIMixinABC): - @distributed_trace_async - async def get_catalog( + @distributed_trace + def get_catalog( self, subscription_id: str, reserved_resource_type: Optional[str] = None, @@ -50,8 +52,11 @@ async def get_catalog( publisher_id: Optional[str] = None, offer_id: Optional[str] = None, plan_id: Optional[str] = None, + filter: Optional[str] = None, + skip: Optional[float] = None, + take: Optional[float] = None, **kwargs: Any - ) -> List[_models.Catalog]: + ) -> AsyncIterable["_models.Catalog"]: """Get the regions and skus that are available for RI purchase for the specified Azure subscription. @@ -64,7 +69,7 @@ async def get_catalog( Default value is None. :type reserved_resource_type: str :param location: Filters the skus based on the location specified in this parameter. This can - be an azure region or global. Default value is None. + be an Azure region or global. Default value is None. :type location: str :param publisher_id: Publisher id used to get the third party products. Default value is None. :type publisher_id: str @@ -72,11 +77,25 @@ async def get_catalog( :type offer_id: str :param plan_id: Plan id used to get the third party products. Default value is None. :type plan_id: str + :param filter: May be used to filter by Catalog properties. The filter supports 'eq', 'or', and + 'and'. Default value is None. + :type filter: str + :param skip: The number of reservations to skip from the list before returning results. Default + value is None. + :type skip: float + :param take: To number of reservations to return. Default value is None. + :type take: float :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of Catalog or the result of cls(response) - :rtype: list[~azure.mgmt.reservations.models.Catalog] + :return: An iterator like instance of either Catalog or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.reservations.models.Catalog] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + cls: ClsType[_models.CatalogsResult] = kwargs.pop("cls", None) + error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -85,44 +104,57 @@ async def get_catalog( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) - cls: ClsType[List[_models.Catalog]] = kwargs.pop("cls", None) - - request = build_get_catalog_request( - subscription_id=subscription_id, - reserved_resource_type=reserved_resource_type, - location=location, - publisher_id=publisher_id, - offer_id=offer_id, - plan_id=plan_id, - api_version=api_version, - template_url=self.get_catalog.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("[Catalog]", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + def prepare_request(next_link=None): + if not next_link: + + request = build_get_catalog_request( + subscription_id=subscription_id, + reserved_resource_type=reserved_resource_type, + location=location, + publisher_id=publisher_id, + offer_id=offer_id, + plan_id=plan_id, + filter=filter, + skip=skip, + take=take, + api_version=api_version, + template_url=self.get_catalog.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + request = HttpRequest("GET", next_link) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("CatalogsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) get_catalog.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs"} @@ -151,7 +183,7 @@ async def get_applied_reservation_list(self, subscription_id: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.AppliedReservations] = kwargs.pop("cls", None) request = build_get_applied_reservation_list_request( diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_calculate_exchange_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_calculate_exchange_operations.py index 4e2de954214e8..8bbacc2ec04ec 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_calculate_exchange_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_calculate_exchange_operations.py @@ -72,7 +72,7 @@ async def _post_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.CalculateExchangeOperationResultResponse]] = kwargs.pop("cls", None) @@ -213,7 +213,7 @@ async def begin_post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CalculateExchangeOperationResultResponse] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_calculate_refund_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_calculate_refund_operations.py index 320e903f5b1bf..25409ef2cf3c5 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_calculate_refund_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_calculate_refund_operations.py @@ -135,7 +135,7 @@ async def post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CalculateRefundResponse] = kwargs.pop("cls", None) diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_exchange_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_exchange_operations.py index c1ed17a888164..8d714f8a09881 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_exchange_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_exchange_operations.py @@ -72,7 +72,7 @@ async def _post_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ExchangeOperationResultResponse]] = kwargs.pop("cls", None) @@ -213,7 +213,7 @@ async def begin_post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExchangeOperationResultResponse] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_operation_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_operation_operations.py index f4210f7aa582b..10336203e2553 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_operation_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_operation_operations.py @@ -72,7 +72,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationResponse"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_quota_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_quota_operations.py index b21514c4f4882..c17b51d91b238 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_quota_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_quota_operations.py @@ -226,7 +226,7 @@ async def begin_create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> Union[AsyncLROPoller[_models.CurrentQuotaLimitBase], AsyncLROPoller[_models.QuotaRequestSubmitResponse201]]: + ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: """Create or update the quota (service limits) of a resource to the requested value. Steps: @@ -280,7 +280,7 @@ async def begin_create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> Union[AsyncLROPoller[_models.CurrentQuotaLimitBase], AsyncLROPoller[_models.QuotaRequestSubmitResponse201]]: + ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: """Create or update the quota (service limits) of a resource to the requested value. Steps: @@ -332,7 +332,7 @@ async def begin_create_or_update( resource_name: str, create_quota_request: Union[_models.CurrentQuotaLimitBase, IO], **kwargs: Any - ) -> Union[AsyncLROPoller[_models.CurrentQuotaLimitBase], AsyncLROPoller[_models.QuotaRequestSubmitResponse201]]: + ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: """Create or update the quota (service limits) of a resource to the requested value. Steps: @@ -515,7 +515,7 @@ async def begin_update( *, content_type: str = "application/json", **kwargs: Any - ) -> Union[AsyncLROPoller[_models.CurrentQuotaLimitBase], AsyncLROPoller[_models.QuotaRequestSubmitResponse201]]: + ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: """Update the quota (service limits) of this resource to the requested value. • To get the quota information for specific resource, send a GET request. • To increase the quota, update the limit field from the GET response to a new value. @@ -566,7 +566,7 @@ async def begin_update( *, content_type: str = "application/json", **kwargs: Any - ) -> Union[AsyncLROPoller[_models.CurrentQuotaLimitBase], AsyncLROPoller[_models.QuotaRequestSubmitResponse201]]: + ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: """Update the quota (service limits) of this resource to the requested value. • To get the quota information for specific resource, send a GET request. • To increase the quota, update the limit field from the GET response to a new value. @@ -615,7 +615,7 @@ async def begin_update( resource_name: str, create_quota_request: Union[_models.CurrentQuotaLimitBase, IO], **kwargs: Any - ) -> Union[AsyncLROPoller[_models.CurrentQuotaLimitBase], AsyncLROPoller[_models.QuotaRequestSubmitResponse201]]: + ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: """Update the quota (service limits) of this resource to the requested value. • To get the quota information for specific resource, send a GET request. • To increase the quota, update the limit field from the GET response to a new value. diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_reservation_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_reservation_operations.py index 3c502a570f923..5bf8999c8b608 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_reservation_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_reservation_operations.py @@ -89,7 +89,7 @@ async def _available_scopes_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AvailableScopeProperties] = kwargs.pop("cls", None) @@ -149,13 +149,13 @@ async def begin_available_scopes( ) -> AsyncLROPoller[_models.AvailableScopeProperties]: """Get Available Scopes for ``Reservation``. - Get Available Scopes for ``Reservation``. + Check whether the scopes from request is valid for ``Reservation``. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str - :param body: Required. + :param body: Scopes to be checked for eligibility. Required. :type body: ~azure.mgmt.reservations.models.AvailableScopeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -187,13 +187,13 @@ async def begin_available_scopes( ) -> AsyncLROPoller[_models.AvailableScopeProperties]: """Get Available Scopes for ``Reservation``. - Get Available Scopes for ``Reservation``. + Check whether the scopes from request is valid for ``Reservation``. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str - :param body: Required. + :param body: Scopes to be checked for eligibility. Required. :type body: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -223,13 +223,14 @@ async def begin_available_scopes( ) -> AsyncLROPoller[_models.AvailableScopeProperties]: """Get Available Scopes for ``Reservation``. - Get Available Scopes for ``Reservation``. + Check whether the scopes from request is valid for ``Reservation``. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str - :param body: Is either a model type or a IO type. Required. + :param body: Scopes to be checked for eligibility. Is either a model type or a IO type. + Required. :type body: ~azure.mgmt.reservations.models.AvailableScopeRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -251,7 +252,7 @@ async def begin_available_scopes( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AvailableScopeProperties] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -310,7 +311,7 @@ async def _split_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[List[_models.ReservationResponse]]] = kwargs.pop("cls", None) @@ -347,11 +348,16 @@ async def _split_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("[ReservationResponse]", pipeline_response) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized @@ -455,7 +461,7 @@ async def begin_split( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[List[_models.ReservationResponse]] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -513,7 +519,7 @@ async def _merge_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[List[_models.ReservationResponse]]] = kwargs.pop("cls", None) @@ -550,11 +556,16 @@ async def _merge_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("[ReservationResponse]", pipeline_response) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized @@ -661,7 +672,7 @@ async def begin_merge( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[List[_models.ReservationResponse]] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -722,7 +733,7 @@ def list(self, reservation_order_id: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.ReservationList] = kwargs.pop("cls", None) error_map = { @@ -781,16 +792,16 @@ async def get_next(next_link=None): @distributed_trace_async async def get( - self, reservation_id: str, reservation_order_id: str, expand: Optional[str] = None, **kwargs: Any + self, reservation_order_id: str, reservation_id: str, expand: Optional[str] = None, **kwargs: Any ) -> _models.ReservationResponse: """Get ``Reservation`` details. Get specific ``Reservation`` details. - :param reservation_id: Id of the Reservation Item. Required. - :type reservation_id: str :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str + :param reservation_id: Id of the reservation item. Required. + :type reservation_id: str :param expand: Supported value of this query is renewProperties. Default value is None. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -809,12 +820,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.ReservationResponse] = kwargs.pop("cls", None) request = build_get_request( - reservation_id=reservation_id, reservation_order_id=reservation_order_id, + reservation_id=reservation_id, expand=expand, api_version=api_version, template_url=self.get.metadata["url"], @@ -860,7 +871,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ReservationResponse]] = kwargs.pop("cls", None) @@ -898,11 +909,19 @@ async def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("ReservationResponse", pipeline_response) + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized @@ -926,7 +945,7 @@ async def begin_update( :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str :param parameters: Information needed to patch a reservation item. Required. :type parameters: ~azure.mgmt.reservations.models.Patch @@ -963,7 +982,7 @@ async def begin_update( :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str :param parameters: Information needed to patch a reservation item. Required. :type parameters: IO @@ -994,7 +1013,7 @@ async def begin_update( :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str :param parameters: Information needed to patch a reservation item. Is either a model type or a IO type. Required. @@ -1018,7 +1037,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ReservationResponse] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1045,7 +1064,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1073,7 +1095,7 @@ async def archive( # pylint: disable=inconsistent-return-statements :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) @@ -1091,7 +1113,7 @@ async def archive( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_archive_request( @@ -1129,11 +1151,11 @@ async def unarchive( # pylint: disable=inconsistent-return-statements ) -> None: """Unarchive a ``Reservation``. - Unarchiving a ``Reservation`` moves it to the state it was before archiving. + Restores a ``Reservation`` to the state it was before archiving. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) @@ -1151,7 +1173,7 @@ async def unarchive( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_unarchive_request( @@ -1185,16 +1207,16 @@ async def unarchive( # pylint: disable=inconsistent-return-statements @distributed_trace def list_revisions( - self, reservation_id: str, reservation_order_id: str, **kwargs: Any + self, reservation_order_id: str, reservation_id: str, **kwargs: Any ) -> AsyncIterable["_models.ReservationResponse"]: """Get ``Reservation`` revisions. List of all the revisions for the ``Reservation``. - :param reservation_id: Id of the Reservation Item. Required. - :type reservation_id: str :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str + :param reservation_id: Id of the reservation item. Required. + :type reservation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReservationResponse or the result of cls(response) :rtype: @@ -1204,7 +1226,7 @@ def list_revisions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.ReservationList] = kwargs.pop("cls", None) error_map = { @@ -1219,8 +1241,8 @@ def prepare_request(next_link=None): if not next_link: request = build_list_revisions_request( - reservation_id=reservation_id, reservation_order_id=reservation_order_id, + reservation_id=reservation_id, api_version=api_version, template_url=self.list_revisions.metadata["url"], headers=_headers, @@ -1281,9 +1303,9 @@ def list_all( :param filter: May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, properties/{appliedScopeType, archived, displayName, - displayProvisioningState, effectiveDateTime, expiryDate, provisioningState, quantity, renew, - reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState}. Default - value is None. + displayProvisioningState, effectiveDateTime, expiryDate, expiryDateTime, provisioningState, + quantity, renew, reservedResourceType, term, userFriendlyAppliedScopeType, + userFriendlyRenewState}. Default value is None. :type filter: str :param orderby: May be used to sort order by reservation properties. Default value is None. :type orderby: str @@ -1306,7 +1328,7 @@ def list_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.ReservationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_reservation_order_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_reservation_order_operations.py index 866c12d8fd67a..b9b8db867ab84 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_reservation_order_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_reservation_order_operations.py @@ -134,7 +134,7 @@ async def calculate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CalculatePriceResponse] = kwargs.pop("cls", None) @@ -194,7 +194,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ReservationOrderResponse _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.ReservationOrderList] = kwargs.pop("cls", None) error_map = { @@ -264,7 +264,7 @@ async def _purchase_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ReservationOrderResponse] = kwargs.pop("cls", None) @@ -300,14 +300,18 @@ async def _purchase_initial( error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("ReservationOrderResponse", pipeline_response) if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("ReservationOrderResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -411,7 +415,7 @@ async def begin_purchase( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ReservationOrderResponse] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -483,7 +487,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.ReservationOrderResponse] = kwargs.pop("cls", None) request = build_get_request( @@ -599,7 +603,7 @@ async def change_directory( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ChangeDirectoryResponse] = kwargs.pop("cls", None) diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_return_operations_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_return_operations_operations.py index 8b1ad1c5f397f..0b82c6c62bea7 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_return_operations_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/aio/operations/_return_operations_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -19,10 +19,12 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models from ..._vendor import _convert_request @@ -56,18 +58,80 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + async def _post_initial( + self, reservation_order_id: str, body: Union[_models.RefundRequest, IO], **kwargs: Any + ) -> _models.RefundResponse: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RefundResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + _json = self._serialize.body(body, "RefundRequest") + + request = build_post_request( + reservation_order_id=reservation_order_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._post_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("RefundResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _post_initial.metadata = {"url": "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return"} + @overload - async def post( + async def begin_post( self, reservation_order_id: str, body: _models.RefundRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RefundResponse: + ) -> AsyncLROPoller[_models.RefundResponse]: """Return a reservation. - Return a reservation. + Return a reservation and get refund information. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str @@ -77,18 +141,26 @@ async def post( Default value is "application/json". :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: RefundResponse or the result of cls(response) - :rtype: ~azure.mgmt.reservations.models.RefundResponse + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RefundResponse or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.reservations.models.RefundResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def post( + async def begin_post( self, reservation_order_id: str, body: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RefundResponse: + ) -> AsyncLROPoller[_models.RefundResponse]: """Return a reservation. - Return a reservation. + Return a reservation and get refund information. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str @@ -98,18 +170,26 @@ async def post( Default value is "application/json". :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: RefundResponse or the result of cls(response) - :rtype: ~azure.mgmt.reservations.models.RefundResponse + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RefundResponse or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.reservations.models.RefundResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def post( + async def begin_post( self, reservation_order_id: str, body: Union[_models.RefundRequest, IO], **kwargs: Any - ) -> _models.RefundResponse: + ) -> AsyncLROPoller[_models.RefundResponse]: """Return a reservation. - Return a reservation. + Return a reservation and get refund information. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str @@ -120,65 +200,65 @@ async def post( Default value is None. :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: RefundResponse or the result of cls(response) - :rtype: ~azure.mgmt.reservations.models.RefundResponse + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RefundResponse or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.reservations.models.RefundResponse] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.RefundResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._post_initial( + reservation_order_id=reservation_order_id, + body=body, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body - else: - _json = self._serialize.body(body, "RefundRequest") - - request = build_post_request( - reservation_order_id=reservation_order_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.post.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response = pipeline_response.http_response + deserialized = self._deserialize("RefundResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("RefundResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - post.metadata = {"url": "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return"} + begin_post.metadata = {"url": "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return"} diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py index 113332cc06076..1d4db29e5dbc4 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py @@ -26,9 +26,11 @@ from ._models_py3 import CalculateRefundResponse from ._models_py3 import Catalog from ._models_py3 import CatalogMsrp +from ._models_py3 import CatalogsResult from ._models_py3 import ChangeDirectoryRequest from ._models_py3 import ChangeDirectoryResponse from ._models_py3 import ChangeDirectoryResult +from ._models_py3 import Commitment from ._models_py3 import CreateGenericQuotaRequestParameters from ._models_py3 import CurrentQuotaLimit from ._models_py3 import CurrentQuotaLimitBase @@ -53,6 +55,7 @@ from ._models_py3 import PatchPropertiesRenewProperties from ._models_py3 import PaymentDetail from ._models_py3 import Price +from ._models_py3 import ProxyResource from ._models_py3 import PurchaseRequest from ._models_py3 import PurchaseRequestPropertiesReservedResourceProperties from ._models_py3 import QuotaLimits @@ -93,7 +96,11 @@ from ._models_py3 import ReservationsListResult from ._models_py3 import ReservationsProperties from ._models_py3 import ReservationsPropertiesUtilization +from ._models_py3 import Resource from ._models_py3 import ResourceName +from ._models_py3 import SavingsPlanPurchaseRequest +from ._models_py3 import SavingsPlanToPurchaseCalculateExchange +from ._models_py3 import SavingsPlanToPurchaseExchange from ._models_py3 import ScopeProperties from ._models_py3 import ServiceError from ._models_py3 import ServiceErrorDetail @@ -107,7 +114,9 @@ from ._models_py3 import SystemData from ._azure_reservation_api_enums import AppliedScopeType +from ._azure_reservation_api_enums import BillingPlan from ._azure_reservation_api_enums import CalculateExchangeOperationResultStatus +from ._azure_reservation_api_enums import CommitmentGrain from ._azure_reservation_api_enums import CreatedByType from ._azure_reservation_api_enums import DisplayProvisioningState from ._azure_reservation_api_enums import ErrorResponseCode @@ -123,6 +132,7 @@ from ._azure_reservation_api_enums import ReservationTerm from ._azure_reservation_api_enums import ReservedResourceType from ._azure_reservation_api_enums import ResourceType +from ._azure_reservation_api_enums import SavingsPlanTerm from ._azure_reservation_api_enums import UserFriendlyAppliedScopeType from ._azure_reservation_api_enums import UserFriendlyRenewState from ._patch import __all__ as _patch_all @@ -150,9 +160,11 @@ "CalculateRefundResponse", "Catalog", "CatalogMsrp", + "CatalogsResult", "ChangeDirectoryRequest", "ChangeDirectoryResponse", "ChangeDirectoryResult", + "Commitment", "CreateGenericQuotaRequestParameters", "CurrentQuotaLimit", "CurrentQuotaLimitBase", @@ -177,6 +189,7 @@ "PatchPropertiesRenewProperties", "PaymentDetail", "Price", + "ProxyResource", "PurchaseRequest", "PurchaseRequestPropertiesReservedResourceProperties", "QuotaLimits", @@ -217,7 +230,11 @@ "ReservationsListResult", "ReservationsProperties", "ReservationsPropertiesUtilization", + "Resource", "ResourceName", + "SavingsPlanPurchaseRequest", + "SavingsPlanToPurchaseCalculateExchange", + "SavingsPlanToPurchaseExchange", "ScopeProperties", "ServiceError", "ServiceErrorDetail", @@ -230,7 +247,9 @@ "SubscriptionScopeProperties", "SystemData", "AppliedScopeType", + "BillingPlan", "CalculateExchangeOperationResultStatus", + "CommitmentGrain", "CreatedByType", "DisplayProvisioningState", "ErrorResponseCode", @@ -246,6 +265,7 @@ "ReservationTerm", "ReservedResourceType", "ResourceType", + "SavingsPlanTerm", "UserFriendlyAppliedScopeType", "UserFriendlyRenewState", ] diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_azure_reservation_api_enums.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_azure_reservation_api_enums.py index 839cd4d2708f6..a384a39710881 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_azure_reservation_api_enums.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_azure_reservation_api_enums.py @@ -15,6 +15,13 @@ class AppliedScopeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SINGLE = "Single" SHARED = "Shared" + MANAGEMENT_GROUP = "ManagementGroup" + + +class BillingPlan(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.""" + + P1_M = "P1M" class CalculateExchangeOperationResultStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -26,6 +33,12 @@ class CalculateExchangeOperationResultStatus(str, Enum, metaclass=CaseInsensitiv PENDING = "Pending" +class CommitmentGrain(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Commitment grain.""" + + HOURLY = "Hourly" + + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of identity that created the resource.""" @@ -36,7 +49,7 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class DisplayProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Represent the current display state of the Reservation.""" + """Represent the current display state of the reservation.""" SUCCEEDED = "Succeeded" EXPIRING = "Expiring" @@ -45,10 +58,12 @@ class DisplayProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): PROCESSING = "Processing" CANCELLED = "Cancelled" FAILED = "Failed" + WARNING = "Warning" + NO_BENEFIT = "NoBenefit" class ErrorResponseCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ErrorResponseCode.""" + """Error code describing the reason that service is not able to process the incoming request.""" NOT_SPECIFIED = "NotSpecified" INTERNAL_SERVER_ERROR = "InternalServerError" @@ -229,7 +244,7 @@ class ReservationStatusCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): class ReservationTerm(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Represent the term of Reservation.""" + """Represent the term of reservation.""" P1_Y = "P1Y" P3_Y = "P3Y" @@ -277,6 +292,13 @@ class ResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SERVICE_SPECIFIC = "serviceSpecific" +class SavingsPlanTerm(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represent savings plan term in ISO 8601 format.""" + + P1_Y = "P1Y" + P3_Y = "P3Y" + + class UserFriendlyAppliedScopeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The applied scope type.""" diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models_py3.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models_py3.py index 14b02b2ccb954..139b6eeb7976c 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models_py3.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models_py3.py @@ -29,7 +29,7 @@ class AppliedReservationList(_serialization.Model): - """AppliedReservationList. + """Paginated list of applied reservations. :ivar value: :vartype value: list[str] @@ -42,7 +42,7 @@ class AppliedReservationList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List[str]] = None, next_link: Optional[str] = None, **kwargs): + def __init__(self, *, value: Optional[List[str]] = None, next_link: Optional[str] = None, **kwargs: Any) -> None: """ :keyword value: :paramtype value: list[str] @@ -55,7 +55,7 @@ def __init__(self, *, value: Optional[List[str]] = None, next_link: Optional[str class AppliedReservations(_serialization.Model): - """AppliedReservations. + """The response for applied reservations api. Variables are only populated by the server, and will be ignored when sending a request. @@ -65,7 +65,7 @@ class AppliedReservations(_serialization.Model): :vartype name: str :ivar type: Type of resource. "Microsoft.Capacity/AppliedReservations". :vartype type: str - :ivar reservation_order_ids: + :ivar reservation_order_ids: Paginated list of applied reservations. :vartype reservation_order_ids: ~azure.mgmt.reservations.models.AppliedReservationList """ @@ -82,9 +82,11 @@ class AppliedReservations(_serialization.Model): "reservation_order_ids": {"key": "properties.reservationOrderIds", "type": "AppliedReservationList"}, } - def __init__(self, *, reservation_order_ids: Optional["_models.AppliedReservationList"] = None, **kwargs): + def __init__( + self, *, reservation_order_ids: Optional["_models.AppliedReservationList"] = None, **kwargs: Any + ) -> None: """ - :keyword reservation_order_ids: + :keyword reservation_order_ids: Paginated list of applied reservations. :paramtype reservation_order_ids: ~azure.mgmt.reservations.models.AppliedReservationList """ super().__init__(**kwargs) @@ -95,20 +97,27 @@ def __init__(self, *, reservation_order_ids: Optional["_models.AppliedReservatio class AppliedScopeProperties(_serialization.Model): - """AppliedScopeProperties. + """Properties specific to applied scope type. Not required if not applicable. Required and need to + provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup. - :ivar tenant_id: Tenant ID of the applied scope type. + :ivar tenant_id: Tenant ID where the savings plan should apply benefit. :vartype tenant_id: str - :ivar management_group_id: Management group ID of the format - /providers/Microsoft.Management/managementGroups/{managementGroupId}. + :ivar management_group_id: Fully-qualified identifier of the management group where the benefit + must be applied. :vartype management_group_id: str - :ivar display_name: Management group display name. + :ivar subscription_id: Fully-qualified identifier of the subscription. + :vartype subscription_id: str + :ivar resource_group_id: Fully-qualified identifier of the resource group. + :vartype resource_group_id: str + :ivar display_name: Display name. :vartype display_name: str """ _attribute_map = { "tenant_id": {"key": "tenantId", "type": "str"}, "management_group_id": {"key": "managementGroupId", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group_id": {"key": "resourceGroupId", "type": "str"}, "display_name": {"key": "displayName", "type": "str"}, } @@ -117,28 +126,36 @@ def __init__( *, tenant_id: Optional[str] = None, management_group_id: Optional[str] = None, + subscription_id: Optional[str] = None, + resource_group_id: Optional[str] = None, display_name: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ - :keyword tenant_id: Tenant ID of the applied scope type. + :keyword tenant_id: Tenant ID where the savings plan should apply benefit. :paramtype tenant_id: str - :keyword management_group_id: Management group ID of the format - /providers/Microsoft.Management/managementGroups/{managementGroupId}. + :keyword management_group_id: Fully-qualified identifier of the management group where the + benefit must be applied. :paramtype management_group_id: str - :keyword display_name: Management group display name. + :keyword subscription_id: Fully-qualified identifier of the subscription. + :paramtype subscription_id: str + :keyword resource_group_id: Fully-qualified identifier of the resource group. + :paramtype resource_group_id: str + :keyword display_name: Display name. :paramtype display_name: str """ super().__init__(**kwargs) self.tenant_id = tenant_id self.management_group_id = management_group_id + self.subscription_id = subscription_id + self.resource_group_id = resource_group_id self.display_name = display_name class AvailableScopeProperties(_serialization.Model): - """AvailableScopeProperties. + """The response of available scope api containing scopes and their eligibilities. - :ivar properties: + :ivar properties: The scopes checked by the available scope api. :vartype properties: ~azure.mgmt.reservations.models.SubscriptionScopeProperties """ @@ -146,9 +163,9 @@ class AvailableScopeProperties(_serialization.Model): "properties": {"key": "properties", "type": "SubscriptionScopeProperties"}, } - def __init__(self, *, properties: Optional["_models.SubscriptionScopeProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.SubscriptionScopeProperties"] = None, **kwargs: Any) -> None: """ - :keyword properties: + :keyword properties: The scopes checked by the available scope api. :paramtype properties: ~azure.mgmt.reservations.models.SubscriptionScopeProperties """ super().__init__(**kwargs) @@ -166,7 +183,9 @@ class AvailableScopeRequest(_serialization.Model): "properties": {"key": "properties", "type": "AvailableScopeRequestProperties"}, } - def __init__(self, *, properties: Optional["_models.AvailableScopeRequestProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["_models.AvailableScopeRequestProperties"] = None, **kwargs: Any + ) -> None: """ :keyword properties: Available scope request properties. :paramtype properties: ~azure.mgmt.reservations.models.AvailableScopeRequestProperties @@ -186,7 +205,7 @@ class AvailableScopeRequestProperties(_serialization.Model): "scopes": {"key": "scopes", "type": "[str]"}, } - def __init__(self, *, scopes: Optional[List[str]] = None, **kwargs): + def __init__(self, *, scopes: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword scopes: :paramtype scopes: list[str] @@ -198,11 +217,14 @@ def __init__(self, *, scopes: Optional[List[str]] = None, **kwargs): class BillingInformation(_serialization.Model): """billing information. - :ivar billing_currency_total_paid_amount: + :ivar billing_currency_total_paid_amount: Pricing information containing the amount and the + currency code. :vartype billing_currency_total_paid_amount: ~azure.mgmt.reservations.models.Price - :ivar billing_currency_prorated_amount: + :ivar billing_currency_prorated_amount: Pricing information containing the amount and the + currency code. :vartype billing_currency_prorated_amount: ~azure.mgmt.reservations.models.Price - :ivar billing_currency_remaining_commitment_amount: + :ivar billing_currency_remaining_commitment_amount: Pricing information containing the amount + and the currency code. :vartype billing_currency_remaining_commitment_amount: ~azure.mgmt.reservations.models.Price """ @@ -221,14 +243,17 @@ def __init__( billing_currency_total_paid_amount: Optional["_models.Price"] = None, billing_currency_prorated_amount: Optional["_models.Price"] = None, billing_currency_remaining_commitment_amount: Optional["_models.Price"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ - :keyword billing_currency_total_paid_amount: + :keyword billing_currency_total_paid_amount: Pricing information containing the amount and the + currency code. :paramtype billing_currency_total_paid_amount: ~azure.mgmt.reservations.models.Price - :keyword billing_currency_prorated_amount: + :keyword billing_currency_prorated_amount: Pricing information containing the amount and the + currency code. :paramtype billing_currency_prorated_amount: ~azure.mgmt.reservations.models.Price - :keyword billing_currency_remaining_commitment_amount: + :keyword billing_currency_remaining_commitment_amount: Pricing information containing the + amount and the currency code. :paramtype billing_currency_remaining_commitment_amount: ~azure.mgmt.reservations.models.Price """ super().__init__(**kwargs) @@ -270,8 +295,8 @@ def __init__( status: Optional[Union[str, "_models.CalculateExchangeOperationResultStatus"]] = None, properties: Optional["_models.CalculateExchangeResponseProperties"] = None, error: Optional["_models.OperationResultError"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: It should match what is used to GET the operation result. :paramtype id: str @@ -306,7 +331,9 @@ class CalculateExchangeRequest(_serialization.Model): "properties": {"key": "properties", "type": "CalculateExchangeRequestProperties"}, } - def __init__(self, *, properties: Optional["_models.CalculateExchangeRequestProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["_models.CalculateExchangeRequestProperties"] = None, **kwargs: Any + ) -> None: """ :keyword properties: Calculate exchange request properties. :paramtype properties: ~azure.mgmt.reservations.models.CalculateExchangeRequestProperties @@ -320,12 +347,17 @@ class CalculateExchangeRequestProperties(_serialization.Model): :ivar reservations_to_purchase: List of reservations that are being purchased in this exchange. :vartype reservations_to_purchase: list[~azure.mgmt.reservations.models.PurchaseRequest] + :ivar savings_plans_to_purchase: List of savings plans that are being purchased in this + exchange. + :vartype savings_plans_to_purchase: + list[~azure.mgmt.reservations.models.SavingsPlanPurchaseRequest] :ivar reservations_to_exchange: List of reservations that are being returned in this exchange. :vartype reservations_to_exchange: list[~azure.mgmt.reservations.models.ReservationToReturn] """ _attribute_map = { "reservations_to_purchase": {"key": "reservationsToPurchase", "type": "[PurchaseRequest]"}, + "savings_plans_to_purchase": {"key": "savingsPlansToPurchase", "type": "[SavingsPlanPurchaseRequest]"}, "reservations_to_exchange": {"key": "reservationsToExchange", "type": "[ReservationToReturn]"}, } @@ -333,19 +365,25 @@ def __init__( self, *, reservations_to_purchase: Optional[List["_models.PurchaseRequest"]] = None, + savings_plans_to_purchase: Optional[List["_models.SavingsPlanPurchaseRequest"]] = None, reservations_to_exchange: Optional[List["_models.ReservationToReturn"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword reservations_to_purchase: List of reservations that are being purchased in this exchange. :paramtype reservations_to_purchase: list[~azure.mgmt.reservations.models.PurchaseRequest] + :keyword savings_plans_to_purchase: List of savings plans that are being purchased in this + exchange. + :paramtype savings_plans_to_purchase: + list[~azure.mgmt.reservations.models.SavingsPlanPurchaseRequest] :keyword reservations_to_exchange: List of reservations that are being returned in this exchange. :paramtype reservations_to_exchange: list[~azure.mgmt.reservations.models.ReservationToReturn] """ super().__init__(**kwargs) self.reservations_to_purchase = reservations_to_purchase + self.savings_plans_to_purchase = savings_plans_to_purchase self.reservations_to_exchange = reservations_to_exchange @@ -354,15 +392,18 @@ class CalculateExchangeResponseProperties(_serialization.Model): :ivar session_id: Exchange session identifier. :vartype session_id: str - :ivar net_payable: + :ivar net_payable: Pricing information containing the amount and the currency code. :vartype net_payable: ~azure.mgmt.reservations.models.Price - :ivar refunds_total: + :ivar refunds_total: Pricing information containing the amount and the currency code. :vartype refunds_total: ~azure.mgmt.reservations.models.Price - :ivar purchases_total: + :ivar purchases_total: Pricing information containing the amount and the currency code. :vartype purchases_total: ~azure.mgmt.reservations.models.Price :ivar reservations_to_purchase: Details of the reservations being purchased. :vartype reservations_to_purchase: list[~azure.mgmt.reservations.models.ReservationToPurchaseCalculateExchange] + :ivar savings_plans_to_purchase: Details of the savings plans being purchased. + :vartype savings_plans_to_purchase: + list[~azure.mgmt.reservations.models.SavingsPlanToPurchaseCalculateExchange] :ivar reservations_to_exchange: Details of the reservations being returned. :vartype reservations_to_exchange: list[~azure.mgmt.reservations.models.ReservationToExchange] :ivar policy_result: Exchange policy errors. @@ -378,6 +419,10 @@ class CalculateExchangeResponseProperties(_serialization.Model): "key": "reservationsToPurchase", "type": "[ReservationToPurchaseCalculateExchange]", }, + "savings_plans_to_purchase": { + "key": "savingsPlansToPurchase", + "type": "[SavingsPlanToPurchaseCalculateExchange]", + }, "reservations_to_exchange": {"key": "reservationsToExchange", "type": "[ReservationToExchange]"}, "policy_result": {"key": "policyResult", "type": "ExchangePolicyErrors"}, } @@ -390,22 +435,26 @@ def __init__( refunds_total: Optional["_models.Price"] = None, purchases_total: Optional["_models.Price"] = None, reservations_to_purchase: Optional[List["_models.ReservationToPurchaseCalculateExchange"]] = None, + savings_plans_to_purchase: Optional[List["_models.SavingsPlanToPurchaseCalculateExchange"]] = None, reservations_to_exchange: Optional[List["_models.ReservationToExchange"]] = None, policy_result: Optional["_models.ExchangePolicyErrors"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword session_id: Exchange session identifier. :paramtype session_id: str - :keyword net_payable: + :keyword net_payable: Pricing information containing the amount and the currency code. :paramtype net_payable: ~azure.mgmt.reservations.models.Price - :keyword refunds_total: + :keyword refunds_total: Pricing information containing the amount and the currency code. :paramtype refunds_total: ~azure.mgmt.reservations.models.Price - :keyword purchases_total: + :keyword purchases_total: Pricing information containing the amount and the currency code. :paramtype purchases_total: ~azure.mgmt.reservations.models.Price :keyword reservations_to_purchase: Details of the reservations being purchased. :paramtype reservations_to_purchase: list[~azure.mgmt.reservations.models.ReservationToPurchaseCalculateExchange] + :keyword savings_plans_to_purchase: Details of the savings plans being purchased. + :paramtype savings_plans_to_purchase: + list[~azure.mgmt.reservations.models.SavingsPlanToPurchaseCalculateExchange] :keyword reservations_to_exchange: Details of the reservations being returned. :paramtype reservations_to_exchange: list[~azure.mgmt.reservations.models.ReservationToExchange] @@ -418,14 +467,15 @@ def __init__( self.refunds_total = refunds_total self.purchases_total = purchases_total self.reservations_to_purchase = reservations_to_purchase + self.savings_plans_to_purchase = savings_plans_to_purchase self.reservations_to_exchange = reservations_to_exchange self.policy_result = policy_result class CalculatePriceResponse(_serialization.Model): - """CalculatePriceResponse. + """The response of calculate price for reservation. - :ivar properties: + :ivar properties: Properties for calculate price response. :vartype properties: ~azure.mgmt.reservations.models.CalculatePriceResponseProperties """ @@ -433,9 +483,11 @@ class CalculatePriceResponse(_serialization.Model): "properties": {"key": "properties", "type": "CalculatePriceResponseProperties"}, } - def __init__(self, *, properties: Optional["_models.CalculatePriceResponseProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["_models.CalculatePriceResponseProperties"] = None, **kwargs: Any + ) -> None: """ - :keyword properties: + :keyword properties: Properties for calculate price response. :paramtype properties: ~azure.mgmt.reservations.models.CalculatePriceResponseProperties """ super().__init__(**kwargs) @@ -443,7 +495,7 @@ def __init__(self, *, properties: Optional["_models.CalculatePriceResponseProper class CalculatePriceResponseProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """CalculatePriceResponseProperties. + """Properties for calculate price response. :ivar billing_currency_total: Currency and amount that customer will be charged in customer's local currency. Tax is not included. @@ -463,9 +515,9 @@ class CalculatePriceResponseProperties(_serialization.Model): # pylint: disable :ivar reservation_order_id: GUID that represents reservation order that can be placed after calculating price. :vartype reservation_order_id: str - :ivar sku_title: Title of SKU that is being purchased. + :ivar sku_title: Title of sku that is being purchased. :vartype sku_title: str - :ivar sku_description: Description of SKU that is being purchased. + :ivar sku_description: Description of sku that is being purchased. :vartype sku_description: str :ivar pricing_currency_total: Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. @@ -509,8 +561,8 @@ def __init__( sku_description: Optional[str] = None, pricing_currency_total: Optional["_models.CalculatePriceResponsePropertiesPricingCurrencyTotal"] = None, payment_schedule: Optional[List["_models.PaymentDetail"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword billing_currency_total: Currency and amount that customer will be charged in customer's local currency. Tax is not included. @@ -530,9 +582,9 @@ def __init__( :keyword reservation_order_id: GUID that represents reservation order that can be placed after calculating price. :paramtype reservation_order_id: str - :keyword sku_title: Title of SKU that is being purchased. + :keyword sku_title: Title of sku that is being purchased. :paramtype sku_title: str - :keyword sku_description: Description of SKU that is being purchased. + :keyword sku_description: Description of sku that is being purchased. :paramtype sku_description: str :keyword pricing_currency_total: Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. @@ -556,7 +608,8 @@ def __init__( class CalculatePriceResponsePropertiesBillingCurrencyTotal(_serialization.Model): - """Currency and amount that customer will be charged in customer's local currency. Tax is not included. + """Currency and amount that customer will be charged in customer's local currency. Tax is not + included. :ivar currency_code: The ISO 4217 3-letter currency code for the currency used by this purchase record. @@ -570,7 +623,7 @@ class CalculatePriceResponsePropertiesBillingCurrencyTotal(_serialization.Model) "amount": {"key": "amount", "type": "float"}, } - def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[float] = None, **kwargs): + def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[float] = None, **kwargs: Any) -> None: """ :keyword currency_code: The ISO 4217 3-letter currency code for the currency used by this purchase record. @@ -584,7 +637,8 @@ def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[floa class CalculatePriceResponsePropertiesPricingCurrencyTotal(_serialization.Model): - """Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. + """Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is + not included. :ivar currency_code: The ISO 4217 3-letter currency code for the currency used by this purchase record. @@ -598,7 +652,7 @@ class CalculatePriceResponsePropertiesPricingCurrencyTotal(_serialization.Model) "amount": {"key": "amount", "type": "float"}, } - def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[float] = None, **kwargs): + def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[float] = None, **kwargs: Any) -> None: """ :keyword currency_code: The ISO 4217 3-letter currency code for the currency used by this purchase record. @@ -612,11 +666,12 @@ def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[floa class CalculateRefundRequest(_serialization.Model): - """CalculateRefundRequest. + """Request containing information needed for calculating refund. :ivar id: Fully qualified identifier of the reservation order being returned. :vartype id: str - :ivar properties: + :ivar properties: Properties needed for calculate refund including the scope and the + reservation to be returned. :vartype properties: ~azure.mgmt.reservations.models.CalculateRefundRequestProperties """ @@ -630,12 +685,13 @@ def __init__( *, id: Optional[str] = None, # pylint: disable=redefined-builtin properties: Optional["_models.CalculateRefundRequestProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Fully qualified identifier of the reservation order being returned. :paramtype id: str - :keyword properties: + :keyword properties: Properties needed for calculate refund including the scope and the + reservation to be returned. :paramtype properties: ~azure.mgmt.reservations.models.CalculateRefundRequestProperties """ super().__init__(**kwargs) @@ -644,7 +700,7 @@ def __init__( class CalculateRefundRequestProperties(_serialization.Model): - """CalculateRefundRequestProperties. + """Properties needed for calculate refund including the scope and the reservation to be returned. :ivar scope: The scope of the refund, e.g. Reservation. :vartype scope: str @@ -662,8 +718,8 @@ def __init__( *, scope: Optional[str] = None, reservation_to_return: Optional["_models.ReservationToReturn"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword scope: The scope of the refund, e.g. Reservation. :paramtype scope: str @@ -676,11 +732,11 @@ def __init__( class CalculateRefundResponse(_serialization.Model): - """CalculateRefundResponse. + """The response of calculate refund containing refund information of reservation. :ivar id: Fully qualified identifier of the reservation being returned. :vartype id: str - :ivar properties: + :ivar properties: The refund properties of reservation. :vartype properties: ~azure.mgmt.reservations.models.RefundResponseProperties """ @@ -694,12 +750,12 @@ def __init__( *, id: Optional[str] = None, # pylint: disable=redefined-builtin properties: Optional["_models.RefundResponseProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Fully qualified identifier of the reservation being returned. :paramtype id: str - :keyword properties: + :keyword properties: The refund properties of reservation. :paramtype properties: ~azure.mgmt.reservations.models.RefundResponseProperties """ super().__init__(**kwargs) @@ -708,15 +764,15 @@ def __init__( class Catalog(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Catalog. + """Product details of a type of resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar resource_type: The type of resource the SKU applies to. + :ivar resource_type: The type of resource the sku applies to. :vartype resource_type: str - :ivar name: The name of SKU. + :ivar name: The name of sku. :vartype name: str - :ivar billing_plans: The billing plan options available for this SKU. + :ivar billing_plans: The billing plan options available for this sku. :vartype billing_plans: dict[str, list[str or ~azure.mgmt.reservations.models.ReservationBillingPlan]] :ivar terms: Available reservation terms for this resource. @@ -725,13 +781,13 @@ class Catalog(_serialization.Model): # pylint: disable=too-many-instance-attrib :vartype locations: list[str] :ivar sku_properties: :vartype sku_properties: list[~azure.mgmt.reservations.models.SkuProperty] - :ivar msrp: Pricing information about the SKU. + :ivar msrp: Pricing information about the sku. :vartype msrp: ~azure.mgmt.reservations.models.CatalogMsrp :ivar restrictions: :vartype restrictions: list[~azure.mgmt.reservations.models.SkuRestriction] - :ivar tier: The tier of this SKU. + :ivar tier: The tier of this sku. :vartype tier: str - :ivar size: The size of this SKU. + :ivar size: The size of this sku. :vartype size: str :ivar capabilities: :vartype capabilities: list[~azure.mgmt.reservations.models.SkuCapability] @@ -765,10 +821,13 @@ class Catalog(_serialization.Model): # pylint: disable=too-many-instance-attrib } def __init__( - self, *, billing_plans: Optional[Dict[str, List[Union[str, "_models.ReservationBillingPlan"]]]] = None, **kwargs - ): + self, + *, + billing_plans: Optional[Dict[str, List[Union[str, "_models.ReservationBillingPlan"]]]] = None, + **kwargs: Any + ) -> None: """ - :keyword billing_plans: The billing plan options available for this SKU. + :keyword billing_plans: The billing plan options available for this sku. :paramtype billing_plans: dict[str, list[str or ~azure.mgmt.reservations.models.ReservationBillingPlan]] """ @@ -787,7 +846,7 @@ def __init__( class CatalogMsrp(_serialization.Model): - """Pricing information about the SKU. + """Pricing information about the sku. :ivar p1_y: Amount in pricing currency. Tax not included. :vartype p1_y: ~azure.mgmt.reservations.models.Price @@ -797,7 +856,7 @@ class CatalogMsrp(_serialization.Model): "p1_y": {"key": "p1Y", "type": "Price"}, } - def __init__(self, *, p1_y: Optional["_models.Price"] = None, **kwargs): + def __init__(self, *, p1_y: Optional["_models.Price"] = None, **kwargs: Any) -> None: """ :keyword p1_y: Amount in pricing currency. Tax not included. :paramtype p1_y: ~azure.mgmt.reservations.models.Price @@ -806,8 +865,43 @@ def __init__(self, *, p1_y: Optional["_models.Price"] = None, **kwargs): self.p1_y = p1_y +class CatalogsResult(_serialization.Model): + """The list of catalogs and pagination information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of catalogs. + :vartype value: list[~azure.mgmt.reservations.models.Catalog] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + :ivar total_items: The total amount of catalog items. + :vartype total_items: int + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Catalog]"}, + "next_link": {"key": "nextLink", "type": "str"}, + "total_items": {"key": "totalItems", "type": "int"}, + } + + def __init__(self, *, total_items: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword total_items: The total amount of catalog items. + :paramtype total_items: int + """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + self.total_items = total_items + + class ChangeDirectoryRequest(_serialization.Model): - """ChangeDirectoryRequest. + """Request body for change directory of a reservation. :ivar destination_tenant_id: Tenant id GUID that reservation order is to be transferred to. :vartype destination_tenant_id: str @@ -817,7 +911,7 @@ class ChangeDirectoryRequest(_serialization.Model): "destination_tenant_id": {"key": "destinationTenantId", "type": "str"}, } - def __init__(self, *, destination_tenant_id: Optional[str] = None, **kwargs): + def __init__(self, *, destination_tenant_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword destination_tenant_id: Tenant id GUID that reservation order is to be transferred to. :paramtype destination_tenant_id: str @@ -845,8 +939,8 @@ def __init__( *, reservation_order: Optional["_models.ChangeDirectoryResult"] = None, reservations: Optional[List["_models.ChangeDirectoryResult"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword reservation_order: Change directory result for reservation order or reservation. :paramtype reservation_order: ~azure.mgmt.reservations.models.ChangeDirectoryResult @@ -886,8 +980,8 @@ def __init__( name: Optional[str] = None, is_succeeded: Optional[bool] = None, error: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Identifier of the reservation order or reservation. :paramtype id: str @@ -906,6 +1000,73 @@ def __init__( self.error = error +class Price(_serialization.Model): + """Pricing information containing the amount and the currency code. + + :ivar currency_code: The ISO 4217 3-letter currency code for the currency used by this purchase + record. + :vartype currency_code: str + :ivar amount: + :vartype amount: float + """ + + _attribute_map = { + "currency_code": {"key": "currencyCode", "type": "str"}, + "amount": {"key": "amount", "type": "float"}, + } + + def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[float] = None, **kwargs: Any) -> None: + """ + :keyword currency_code: The ISO 4217 3-letter currency code for the currency used by this + purchase record. + :paramtype currency_code: str + :keyword amount: + :paramtype amount: float + """ + super().__init__(**kwargs) + self.currency_code = currency_code + self.amount = amount + + +class Commitment(Price): + """Commitment towards the benefit. + + :ivar currency_code: The ISO 4217 3-letter currency code for the currency used by this purchase + record. + :vartype currency_code: str + :ivar amount: + :vartype amount: float + :ivar grain: Commitment grain. "Hourly" + :vartype grain: str or ~azure.mgmt.reservations.models.CommitmentGrain + """ + + _attribute_map = { + "currency_code": {"key": "currencyCode", "type": "str"}, + "amount": {"key": "amount", "type": "float"}, + "grain": {"key": "grain", "type": "str"}, + } + + def __init__( + self, + *, + currency_code: Optional[str] = None, + amount: Optional[float] = None, + grain: Optional[Union[str, "_models.CommitmentGrain"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword currency_code: The ISO 4217 3-letter currency code for the currency used by this + purchase record. + :paramtype currency_code: str + :keyword amount: + :paramtype amount: float + :keyword grain: Commitment grain. "Hourly" + :paramtype grain: str or ~azure.mgmt.reservations.models.CommitmentGrain + """ + super().__init__(currency_code=currency_code, amount=amount, **kwargs) + self.grain = grain + + class CreateGenericQuotaRequestParameters(_serialization.Model): """Quota change requests information. @@ -917,7 +1078,7 @@ class CreateGenericQuotaRequestParameters(_serialization.Model): "value": {"key": "value", "type": "[CurrentQuotaLimitBase]"}, } - def __init__(self, *, value: Optional[List["_models.CurrentQuotaLimitBase"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.CurrentQuotaLimitBase"]] = None, **kwargs: Any) -> None: """ :keyword value: Quota change requests. :paramtype value: list[~azure.mgmt.reservations.models.CurrentQuotaLimitBase] @@ -963,7 +1124,7 @@ class CurrentQuotaLimit(_serialization.Model): "properties": {"key": "quotaInformation.properties", "type": "QuotaProperties"}, } - def __init__(self, *, properties: Optional["_models.QuotaProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.QuotaProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: Quota properties for the resource. :paramtype properties: ~azure.mgmt.reservations.models.QuotaProperties @@ -1005,7 +1166,7 @@ class CurrentQuotaLimitBase(_serialization.Model): "properties": {"key": "properties", "type": "QuotaProperties"}, } - def __init__(self, *, properties: Optional["_models.QuotaProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.QuotaProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: Quota properties for the resource. :paramtype properties: ~azure.mgmt.reservations.models.QuotaProperties @@ -1018,9 +1179,9 @@ def __init__(self, *, properties: Optional["_models.QuotaProperties"] = None, ** class Error(_serialization.Model): - """Error. + """Error information. - :ivar error: + :ivar error: Extended error information including error code and error message. :vartype error: ~azure.mgmt.reservations.models.ExtendedErrorInfo """ @@ -1028,9 +1189,9 @@ class Error(_serialization.Model): "error": {"key": "error", "type": "ExtendedErrorInfo"}, } - def __init__(self, *, error: Optional["_models.ExtendedErrorInfo"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ExtendedErrorInfo"] = None, **kwargs: Any) -> None: """ - :keyword error: + :keyword error: Extended error information including error code and error message. :paramtype error: ~azure.mgmt.reservations.models.ExtendedErrorInfo """ super().__init__(**kwargs) @@ -1062,7 +1223,7 @@ class ErrorDetails(_serialization.Model): "target": {"key": "target", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -1071,7 +1232,8 @@ def __init__(self, **kwargs): class ErrorResponse(_serialization.Model): - """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + """Error response indicates that the service is not able to process the incoming request. The + reason is provided in the error message. :ivar error: The details of the error. :vartype error: ~azure.mgmt.reservations.models.ErrorDetails @@ -1081,7 +1243,7 @@ class ErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDetails"}, } - def __init__(self, *, error: Optional["_models.ErrorDetails"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDetails"] = None, **kwargs: Any) -> None: """ :keyword error: The details of the error. :paramtype error: ~azure.mgmt.reservations.models.ErrorDetails @@ -1101,7 +1263,7 @@ class ExceptionResponse(_serialization.Model): "error": {"key": "error", "type": "ServiceError"}, } - def __init__(self, *, error: Optional["_models.ServiceError"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ServiceError"] = None, **kwargs: Any) -> None: """ :keyword error: The API error details. :paramtype error: ~azure.mgmt.reservations.models.ServiceError @@ -1143,8 +1305,8 @@ def __init__( status: Optional[Union[str, "_models.ExchangeOperationResultStatus"]] = None, properties: Optional["_models.ExchangeResponseProperties"] = None, error: Optional["_models.OperationResultError"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: It should match what is used to GET the operation result. :paramtype id: str @@ -1181,7 +1343,7 @@ class ExchangePolicyError(_serialization.Model): "message": {"key": "message", "type": "str"}, } - def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs): + def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs: Any) -> None: """ :keyword code: :paramtype code: str @@ -1204,7 +1366,7 @@ class ExchangePolicyErrors(_serialization.Model): "policy_errors": {"key": "policyErrors", "type": "[ExchangePolicyError]"}, } - def __init__(self, *, policy_errors: Optional[List["_models.ExchangePolicyError"]] = None, **kwargs): + def __init__(self, *, policy_errors: Optional[List["_models.ExchangePolicyError"]] = None, **kwargs: Any) -> None: """ :keyword policy_errors: Exchange Policy errors. :paramtype policy_errors: list[~azure.mgmt.reservations.models.ExchangePolicyError] @@ -1224,7 +1386,7 @@ class ExchangeRequest(_serialization.Model): "properties": {"key": "properties", "type": "ExchangeRequestProperties"}, } - def __init__(self, *, properties: Optional["_models.ExchangeRequestProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.ExchangeRequestProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: Exchange request properties. :paramtype properties: ~azure.mgmt.reservations.models.ExchangeRequestProperties @@ -1244,7 +1406,7 @@ class ExchangeRequestProperties(_serialization.Model): "session_id": {"key": "sessionId", "type": "str"}, } - def __init__(self, *, session_id: Optional[str] = None, **kwargs): + def __init__(self, *, session_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword session_id: SessionId that was returned by CalculateExchange API. :paramtype session_id: str @@ -1258,15 +1420,18 @@ class ExchangeResponseProperties(_serialization.Model): :ivar session_id: Exchange session identifier. :vartype session_id: str - :ivar net_payable: + :ivar net_payable: Pricing information containing the amount and the currency code. :vartype net_payable: ~azure.mgmt.reservations.models.Price - :ivar refunds_total: + :ivar refunds_total: Pricing information containing the amount and the currency code. :vartype refunds_total: ~azure.mgmt.reservations.models.Price - :ivar purchases_total: + :ivar purchases_total: Pricing information containing the amount and the currency code. :vartype purchases_total: ~azure.mgmt.reservations.models.Price :ivar reservations_to_purchase: Details of the reservations being purchased. :vartype reservations_to_purchase: list[~azure.mgmt.reservations.models.ReservationToPurchaseExchange] + :ivar savings_plans_to_purchase: Details of the savings plans being purchased. + :vartype savings_plans_to_purchase: + list[~azure.mgmt.reservations.models.SavingsPlanToPurchaseExchange] :ivar reservations_to_exchange: Details of the reservations being returned. :vartype reservations_to_exchange: list[~azure.mgmt.reservations.models.ReservationToReturnForExchange] @@ -1280,6 +1445,7 @@ class ExchangeResponseProperties(_serialization.Model): "refunds_total": {"key": "refundsTotal", "type": "Price"}, "purchases_total": {"key": "purchasesTotal", "type": "Price"}, "reservations_to_purchase": {"key": "reservationsToPurchase", "type": "[ReservationToPurchaseExchange]"}, + "savings_plans_to_purchase": {"key": "savingsPlansToPurchase", "type": "[SavingsPlanToPurchaseExchange]"}, "reservations_to_exchange": {"key": "reservationsToExchange", "type": "[ReservationToReturnForExchange]"}, "policy_result": {"key": "policyResult", "type": "ExchangePolicyErrors"}, } @@ -1292,22 +1458,26 @@ def __init__( refunds_total: Optional["_models.Price"] = None, purchases_total: Optional["_models.Price"] = None, reservations_to_purchase: Optional[List["_models.ReservationToPurchaseExchange"]] = None, + savings_plans_to_purchase: Optional[List["_models.SavingsPlanToPurchaseExchange"]] = None, reservations_to_exchange: Optional[List["_models.ReservationToReturnForExchange"]] = None, policy_result: Optional["_models.ExchangePolicyErrors"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword session_id: Exchange session identifier. :paramtype session_id: str - :keyword net_payable: + :keyword net_payable: Pricing information containing the amount and the currency code. :paramtype net_payable: ~azure.mgmt.reservations.models.Price - :keyword refunds_total: + :keyword refunds_total: Pricing information containing the amount and the currency code. :paramtype refunds_total: ~azure.mgmt.reservations.models.Price - :keyword purchases_total: + :keyword purchases_total: Pricing information containing the amount and the currency code. :paramtype purchases_total: ~azure.mgmt.reservations.models.Price :keyword reservations_to_purchase: Details of the reservations being purchased. :paramtype reservations_to_purchase: list[~azure.mgmt.reservations.models.ReservationToPurchaseExchange] + :keyword savings_plans_to_purchase: Details of the savings plans being purchased. + :paramtype savings_plans_to_purchase: + list[~azure.mgmt.reservations.models.SavingsPlanToPurchaseExchange] :keyword reservations_to_exchange: Details of the reservations being returned. :paramtype reservations_to_exchange: list[~azure.mgmt.reservations.models.ReservationToReturnForExchange] @@ -1320,14 +1490,16 @@ def __init__( self.refunds_total = refunds_total self.purchases_total = purchases_total self.reservations_to_purchase = reservations_to_purchase + self.savings_plans_to_purchase = savings_plans_to_purchase self.reservations_to_exchange = reservations_to_exchange self.policy_result = policy_result class ExtendedErrorInfo(_serialization.Model): - """ExtendedErrorInfo. + """Extended error information including error code and error message. - :ivar code: Known values are: "NotSpecified", "InternalServerError", "ServerTimeout", + :ivar code: Error code describing the reason that service is not able to process the incoming + request. Known values are: "NotSpecified", "InternalServerError", "ServerTimeout", "AuthorizationFailed", "BadRequest", "ClientCertificateThumbprintNotSet", "InvalidRequestContent", "OperationFailed", "HttpMethodNotSupported", "InvalidRequestUri", "MissingTenantId", "InvalidTenantId", "InvalidReservationOrderId", "InvalidReservationId", @@ -1358,10 +1530,15 @@ class ExtendedErrorInfo(_serialization.Model): } def __init__( - self, *, code: Optional[Union[str, "_models.ErrorResponseCode"]] = None, message: Optional[str] = None, **kwargs - ): + self, + *, + code: Optional[Union[str, "_models.ErrorResponseCode"]] = None, + message: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword code: Known values are: "NotSpecified", "InternalServerError", "ServerTimeout", + :keyword code: Error code describing the reason that service is not able to process the + incoming request. Known values are: "NotSpecified", "InternalServerError", "ServerTimeout", "AuthorizationFailed", "BadRequest", "ClientCertificateThumbprintNotSet", "InvalidRequestContent", "OperationFailed", "HttpMethodNotSupported", "InvalidRequestUri", "MissingTenantId", "InvalidTenantId", "InvalidReservationOrderId", "InvalidReservationId", @@ -1410,8 +1587,8 @@ def __init__( *, status_code: Optional[Union[str, "_models.ReservationStatusCode"]] = None, message: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status_code: Known values are: "None", "Pending", "Processing", "Active", "PurchaseError", "PaymentInstrumentError", "Split", "Merged", "Expired", and "Succeeded". @@ -1425,7 +1602,7 @@ def __init__( class MergeRequest(_serialization.Model): - """MergeRequest. + """The request for reservation merge. :ivar sources: Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. @@ -1436,7 +1613,7 @@ class MergeRequest(_serialization.Model): "sources": {"key": "properties.sources", "type": "[str]"}, } - def __init__(self, *, sources: Optional[List[str]] = None, **kwargs): + def __init__(self, *, sources: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword sources: Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. @@ -1447,7 +1624,7 @@ def __init__(self, *, sources: Optional[List[str]] = None, **kwargs): class OperationDisplay(_serialization.Model): - """OperationDisplay. + """Information about an operation. :ivar provider: :vartype provider: str @@ -1473,8 +1650,8 @@ def __init__( resource: Optional[str] = None, operation: Optional[str] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword provider: :paramtype provider: str @@ -1493,7 +1670,7 @@ def __init__( class OperationList(_serialization.Model): - """OperationList. + """Paginated list of operations. :ivar value: :vartype value: list[~azure.mgmt.reservations.models.OperationResponse] @@ -1507,8 +1684,12 @@ class OperationList(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.OperationResponse"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.OperationResponse"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: :paramtype value: list[~azure.mgmt.reservations.models.OperationResponse] @@ -1521,7 +1702,7 @@ def __init__( class OperationResponse(_serialization.Model): - """OperationResponse. + """The response containing operation information. :ivar name: Name of the operation. :vartype name: str @@ -1551,8 +1732,8 @@ def __init__( display: Optional["_models.OperationDisplay"] = None, origin: Optional[str] = None, properties: Optional[JSON] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Name of the operation. :paramtype name: str @@ -1590,7 +1771,7 @@ class OperationResultError(_serialization.Model): "message": {"key": "message", "type": "str"}, } - def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs): + def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs: Any) -> None: """ :keyword code: Required if status == failed or status == cancelled. If status == failed, provide an invariant error code used for error troubleshooting, aggregation, and analysis. @@ -1606,33 +1787,43 @@ def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, class Patch(_serialization.Model): - """Patch. + """The request for reservation patch. - :ivar applied_scope_type: Type of the Applied Scope. Known values are: "Single" and "Shared". + :ivar applied_scope_type: Type of the Applied Scope. Known values are: "Single", "Shared", and + "ManagementGroup". :vartype applied_scope_type: str or ~azure.mgmt.reservations.models.AppliedScopeType :ivar applied_scopes: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. :vartype applied_scopes: list[str] + :ivar applied_scope_properties: Properties specific to applied scope type. Not required if not + applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is + ManagementGroup. + :vartype applied_scope_properties: ~azure.mgmt.reservations.models.AppliedScopeProperties :ivar instance_flexibility: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. Known values are: "On" and "Off". :vartype instance_flexibility: str or ~azure.mgmt.reservations.models.InstanceFlexibility - :ivar name: Name of the Reservation. + :ivar name: Display name of the reservation. :vartype name: str :ivar renew: Setting this to true will automatically purchase a new reservation on the expiration date time. :vartype renew: bool :ivar renew_properties: :vartype renew_properties: ~azure.mgmt.reservations.models.PatchPropertiesRenewProperties + :ivar review_date_time: This is the date-time when the Azure hybrid benefit needs to be + reviewed. + :vartype review_date_time: ~datetime.datetime """ _attribute_map = { "applied_scope_type": {"key": "properties.appliedScopeType", "type": "str"}, "applied_scopes": {"key": "properties.appliedScopes", "type": "[str]"}, + "applied_scope_properties": {"key": "properties.appliedScopeProperties", "type": "AppliedScopeProperties"}, "instance_flexibility": {"key": "properties.instanceFlexibility", "type": "str"}, "name": {"key": "properties.name", "type": "str"}, "renew": {"key": "properties.renew", "type": "bool"}, "renew_properties": {"key": "properties.renewProperties", "type": "PatchPropertiesRenewProperties"}, + "review_date_time": {"key": "properties.reviewDateTime", "type": "iso-8601"}, } def __init__( @@ -1640,44 +1831,55 @@ def __init__( *, applied_scope_type: Optional[Union[str, "_models.AppliedScopeType"]] = None, applied_scopes: Optional[List[str]] = None, + applied_scope_properties: Optional["_models.AppliedScopeProperties"] = None, instance_flexibility: Optional[Union[str, "_models.InstanceFlexibility"]] = None, name: Optional[str] = None, renew: bool = False, renew_properties: Optional["_models.PatchPropertiesRenewProperties"] = None, - **kwargs - ): + review_date_time: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: """ - :keyword applied_scope_type: Type of the Applied Scope. Known values are: "Single" and - "Shared". + :keyword applied_scope_type: Type of the Applied Scope. Known values are: "Single", "Shared", + and "ManagementGroup". :paramtype applied_scope_type: str or ~azure.mgmt.reservations.models.AppliedScopeType :keyword applied_scopes: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. :paramtype applied_scopes: list[str] + :keyword applied_scope_properties: Properties specific to applied scope type. Not required if + not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType + is ManagementGroup. + :paramtype applied_scope_properties: ~azure.mgmt.reservations.models.AppliedScopeProperties :keyword instance_flexibility: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. Known values are: "On" and "Off". :paramtype instance_flexibility: str or ~azure.mgmt.reservations.models.InstanceFlexibility - :keyword name: Name of the Reservation. + :keyword name: Display name of the reservation. :paramtype name: str :keyword renew: Setting this to true will automatically purchase a new reservation on the expiration date time. :paramtype renew: bool :keyword renew_properties: :paramtype renew_properties: ~azure.mgmt.reservations.models.PatchPropertiesRenewProperties + :keyword review_date_time: This is the date-time when the Azure hybrid benefit needs to be + reviewed. + :paramtype review_date_time: ~datetime.datetime """ super().__init__(**kwargs) self.applied_scope_type = applied_scope_type self.applied_scopes = applied_scopes + self.applied_scope_properties = applied_scope_properties self.instance_flexibility = instance_flexibility self.name = name self.renew = renew self.renew_properties = renew_properties + self.review_date_time = review_date_time class PatchPropertiesRenewProperties(_serialization.Model): """PatchPropertiesRenewProperties. - :ivar purchase_properties: + :ivar purchase_properties: The request for reservation purchase. :vartype purchase_properties: ~azure.mgmt.reservations.models.PurchaseRequest """ @@ -1685,9 +1887,9 @@ class PatchPropertiesRenewProperties(_serialization.Model): "purchase_properties": {"key": "purchaseProperties", "type": "PurchaseRequest"}, } - def __init__(self, *, purchase_properties: Optional["_models.PurchaseRequest"] = None, **kwargs): + def __init__(self, *, purchase_properties: Optional["_models.PurchaseRequest"] = None, **kwargs: Any) -> None: """ - :keyword purchase_properties: + :keyword purchase_properties: The request for reservation purchase. :paramtype purchase_properties: ~azure.mgmt.reservations.models.PurchaseRequest """ super().__init__(**kwargs) @@ -1735,8 +1937,8 @@ def __init__( billing_account: Optional[str] = None, status: Optional[Union[str, "_models.PaymentStatus"]] = None, extended_status_info: Optional["_models.ExtendedStatusInfo"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword due_date: Date when the payment needs to be done. :paramtype due_date: ~datetime.date @@ -1765,40 +1967,91 @@ def __init__( self.extended_status_info = extended_status_info -class Price(_serialization.Model): - """Price. +class Resource(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. - :ivar currency_code: The ISO 4217 3-letter currency code for the currency used by this purchase - record. - :vartype currency_code: str - :ivar amount: - :vartype amount: float + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.reservations.models.SystemData """ + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + _attribute_map = { - "currency_code": {"key": "currencyCode", "type": "str"}, - "amount": {"key": "amount", "type": "float"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[float] = None, **kwargs): - """ - :keyword currency_code: The ISO 4217 3-letter currency code for the currency used by this - purchase record. - :paramtype currency_code: str - :keyword amount: - :paramtype amount: float - """ + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.reservations.models.SystemData + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.currency_code = currency_code - self.amount = amount class PurchaseRequest(_serialization.Model): # pylint: disable=too-many-instance-attributes - """PurchaseRequest. + """The request for reservation purchase. - :ivar sku: + :ivar sku: The name of sku. :vartype sku: ~azure.mgmt.reservations.models.SkuName - :ivar location: The Azure Region where the reserved resource lives. + :ivar location: The Azure region where the reserved resource lives. :vartype location: str :ivar reserved_resource_type: The type of the resource that is being reserved. Known values are: "VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", @@ -1807,21 +2060,27 @@ class PurchaseRequest(_serialization.Model): # pylint: disable=too-many-instanc "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", and "VirtualMachineSoftware". :vartype reserved_resource_type: str or ~azure.mgmt.reservations.models.ReservedResourceType - :ivar billing_scope_id: Subscription that will be charged for purchasing Reservation. + :ivar billing_scope_id: Subscription that will be charged for purchasing reservation or savings + plan. :vartype billing_scope_id: str - :ivar term: Represent the term of Reservation. Known values are: "P1Y", "P3Y", and "P5Y". + :ivar term: Represent the term of reservation. Known values are: "P1Y", "P3Y", and "P5Y". :vartype term: str or ~azure.mgmt.reservations.models.ReservationTerm :ivar billing_plan: Represent the billing plans. Known values are: "Upfront" and "Monthly". :vartype billing_plan: str or ~azure.mgmt.reservations.models.ReservationBillingPlan - :ivar quantity: Quantity of the SKUs that are part of the Reservation. + :ivar quantity: Quantity of the skus that are part of the reservation. :vartype quantity: int - :ivar display_name: Friendly name of the Reservation. + :ivar display_name: Friendly name of the reservation. :vartype display_name: str - :ivar applied_scope_type: Type of the Applied Scope. Known values are: "Single" and "Shared". + :ivar applied_scope_type: Type of the Applied Scope. Known values are: "Single", "Shared", and + "ManagementGroup". :vartype applied_scope_type: str or ~azure.mgmt.reservations.models.AppliedScopeType :ivar applied_scopes: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. :vartype applied_scopes: list[str] + :ivar applied_scope_properties: Properties specific to applied scope type. Not required if not + applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is + ManagementGroup. + :vartype applied_scope_properties: ~azure.mgmt.reservations.models.AppliedScopeProperties :ivar renew: Setting this to true will automatically purchase a new reservation on the expiration date time. :vartype renew: bool @@ -1829,6 +2088,9 @@ class PurchaseRequest(_serialization.Model): # pylint: disable=too-many-instanc required if not applicable. :vartype reserved_resource_properties: ~azure.mgmt.reservations.models.PurchaseRequestPropertiesReservedResourceProperties + :ivar review_date_time: This is the date-time when the Azure hybrid benefit needs to be + reviewed. + :vartype review_date_time: ~datetime.datetime """ _attribute_map = { @@ -1842,11 +2104,13 @@ class PurchaseRequest(_serialization.Model): # pylint: disable=too-many-instanc "display_name": {"key": "properties.displayName", "type": "str"}, "applied_scope_type": {"key": "properties.appliedScopeType", "type": "str"}, "applied_scopes": {"key": "properties.appliedScopes", "type": "[str]"}, + "applied_scope_properties": {"key": "properties.appliedScopeProperties", "type": "AppliedScopeProperties"}, "renew": {"key": "properties.renew", "type": "bool"}, "reserved_resource_properties": { "key": "properties.reservedResourceProperties", "type": "PurchaseRequestPropertiesReservedResourceProperties", }, + "review_date_time": {"key": "properties.reviewDateTime", "type": "iso-8601"}, } def __init__( @@ -1862,14 +2126,16 @@ def __init__( display_name: Optional[str] = None, applied_scope_type: Optional[Union[str, "_models.AppliedScopeType"]] = None, applied_scopes: Optional[List[str]] = None, + applied_scope_properties: Optional["_models.AppliedScopeProperties"] = None, renew: bool = False, reserved_resource_properties: Optional["_models.PurchaseRequestPropertiesReservedResourceProperties"] = None, - **kwargs - ): + review_date_time: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: """ - :keyword sku: + :keyword sku: The name of sku. :paramtype sku: ~azure.mgmt.reservations.models.SkuName - :keyword location: The Azure Region where the reserved resource lives. + :keyword location: The Azure region where the reserved resource lives. :paramtype location: str :keyword reserved_resource_type: The type of the resource that is being reserved. Known values are: "VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", @@ -1878,22 +2144,27 @@ def __init__( "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", and "VirtualMachineSoftware". :paramtype reserved_resource_type: str or ~azure.mgmt.reservations.models.ReservedResourceType - :keyword billing_scope_id: Subscription that will be charged for purchasing Reservation. + :keyword billing_scope_id: Subscription that will be charged for purchasing reservation or + savings plan. :paramtype billing_scope_id: str - :keyword term: Represent the term of Reservation. Known values are: "P1Y", "P3Y", and "P5Y". + :keyword term: Represent the term of reservation. Known values are: "P1Y", "P3Y", and "P5Y". :paramtype term: str or ~azure.mgmt.reservations.models.ReservationTerm :keyword billing_plan: Represent the billing plans. Known values are: "Upfront" and "Monthly". :paramtype billing_plan: str or ~azure.mgmt.reservations.models.ReservationBillingPlan - :keyword quantity: Quantity of the SKUs that are part of the Reservation. + :keyword quantity: Quantity of the skus that are part of the reservation. :paramtype quantity: int - :keyword display_name: Friendly name of the Reservation. + :keyword display_name: Friendly name of the reservation. :paramtype display_name: str - :keyword applied_scope_type: Type of the Applied Scope. Known values are: "Single" and - "Shared". + :keyword applied_scope_type: Type of the Applied Scope. Known values are: "Single", "Shared", + and "ManagementGroup". :paramtype applied_scope_type: str or ~azure.mgmt.reservations.models.AppliedScopeType :keyword applied_scopes: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. :paramtype applied_scopes: list[str] + :keyword applied_scope_properties: Properties specific to applied scope type. Not required if + not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType + is ManagementGroup. + :paramtype applied_scope_properties: ~azure.mgmt.reservations.models.AppliedScopeProperties :keyword renew: Setting this to true will automatically purchase a new reservation on the expiration date time. :paramtype renew: bool @@ -1901,6 +2172,9 @@ def __init__( required if not applicable. :paramtype reserved_resource_properties: ~azure.mgmt.reservations.models.PurchaseRequestPropertiesReservedResourceProperties + :keyword review_date_time: This is the date-time when the Azure hybrid benefit needs to be + reviewed. + :paramtype review_date_time: ~datetime.datetime """ super().__init__(**kwargs) self.sku = sku @@ -1913,8 +2187,10 @@ def __init__( self.display_name = display_name self.applied_scope_type = applied_scope_type self.applied_scopes = applied_scopes + self.applied_scope_properties = applied_scope_properties self.renew = renew self.reserved_resource_properties = reserved_resource_properties + self.review_date_time = review_date_time class PurchaseRequestPropertiesReservedResourceProperties(_serialization.Model): @@ -1930,7 +2206,9 @@ class PurchaseRequestPropertiesReservedResourceProperties(_serialization.Model): "instance_flexibility": {"key": "instanceFlexibility", "type": "str"}, } - def __init__(self, *, instance_flexibility: Optional[Union[str, "_models.InstanceFlexibility"]] = None, **kwargs): + def __init__( + self, *, instance_flexibility: Optional[Union[str, "_models.InstanceFlexibility"]] = None, **kwargs: Any + ) -> None: """ :keyword instance_flexibility: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. Known @@ -1961,8 +2239,8 @@ def __init__( *, value: Optional[List["_models.CurrentQuotaLimitBase"]] = None, next_link: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: List of quotas (service limits). :paramtype value: list[~azure.mgmt.reservations.models.CurrentQuotaLimitBase] @@ -1991,8 +2269,12 @@ class QuotaLimitsResponse(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.CurrentQuotaLimit"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.CurrentQuotaLimit"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: List of quotas with the quota request status. :paramtype value: list[~azure.mgmt.reservations.models.CurrentQuotaLimit] @@ -2054,8 +2336,8 @@ def __init__( name: Optional["_models.ResourceName"] = None, resource_type: Optional[Union[str, "_models.ResourceType"]] = None, properties: Optional[JSON] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword limit: Quota properties. :paramtype limit: int @@ -2127,8 +2409,8 @@ def __init__( *, provisioning_state: Optional[Union[str, "_models.QuotaRequestState"]] = None, value: Optional[List["_models.SubRequest"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword provisioning_state: The quota request status. Known values are: "Accepted", "Invalid", "Succeeded", "Failed", and "InProgress". @@ -2162,8 +2444,12 @@ class QuotaRequestDetailsList(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.QuotaRequestDetails"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.QuotaRequestDetails"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: The quota requests. :paramtype value: list[~azure.mgmt.reservations.models.QuotaRequestDetails] @@ -2230,7 +2516,7 @@ class QuotaRequestOneResourceSubmitResponse(_serialization.Model): "properties": {"key": "properties.properties.properties", "type": "QuotaProperties"}, } - def __init__(self, *, properties: Optional["_models.QuotaProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.QuotaProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: Quota properties for the resource. :paramtype properties: ~azure.mgmt.reservations.models.QuotaProperties @@ -2282,8 +2568,8 @@ def __init__( *, provisioning_state: Optional[Union[str, "_models.QuotaRequestState"]] = None, value: Optional[List["_models.SubRequest"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword provisioning_state: The quota request status. Known values are: "Accepted", "Invalid", "Succeeded", "Failed", and "InProgress". @@ -2326,7 +2612,7 @@ class QuotaRequestSubmitResponse(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, properties: Optional["_models.QuotaRequestProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.QuotaRequestProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: The quota request details. :paramtype properties: ~azure.mgmt.reservations.models.QuotaRequestProperties @@ -2372,7 +2658,7 @@ class QuotaRequestSubmitResponse201(_serialization.Model): "message": {"key": "properties.message", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -2392,11 +2678,14 @@ class RefundBillingInformation(_serialization.Model): :vartype completed_transactions: int :ivar total_transactions: The number of total transactions in this reservation's payment. :vartype total_transactions: int - :ivar billing_currency_total_paid_amount: + :ivar billing_currency_total_paid_amount: Pricing information containing the amount and the + currency code. :vartype billing_currency_total_paid_amount: ~azure.mgmt.reservations.models.Price - :ivar billing_currency_prorated_amount: + :ivar billing_currency_prorated_amount: Pricing information containing the amount and the + currency code. :vartype billing_currency_prorated_amount: ~azure.mgmt.reservations.models.Price - :ivar billing_currency_remaining_commitment_amount: + :ivar billing_currency_remaining_commitment_amount: Pricing information containing the amount + and the currency code. :vartype billing_currency_remaining_commitment_amount: ~azure.mgmt.reservations.models.Price """ @@ -2421,8 +2710,8 @@ def __init__( billing_currency_total_paid_amount: Optional["_models.Price"] = None, billing_currency_prorated_amount: Optional["_models.Price"] = None, billing_currency_remaining_commitment_amount: Optional["_models.Price"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword billing_plan: Represent the billing plans. Known values are: "Upfront" and "Monthly". :paramtype billing_plan: str or ~azure.mgmt.reservations.models.ReservationBillingPlan @@ -2431,11 +2720,14 @@ def __init__( :paramtype completed_transactions: int :keyword total_transactions: The number of total transactions in this reservation's payment. :paramtype total_transactions: int - :keyword billing_currency_total_paid_amount: + :keyword billing_currency_total_paid_amount: Pricing information containing the amount and the + currency code. :paramtype billing_currency_total_paid_amount: ~azure.mgmt.reservations.models.Price - :keyword billing_currency_prorated_amount: + :keyword billing_currency_prorated_amount: Pricing information containing the amount and the + currency code. :paramtype billing_currency_prorated_amount: ~azure.mgmt.reservations.models.Price - :keyword billing_currency_remaining_commitment_amount: + :keyword billing_currency_remaining_commitment_amount: Pricing information containing the + amount and the currency code. :paramtype billing_currency_remaining_commitment_amount: ~azure.mgmt.reservations.models.Price """ super().__init__(**kwargs) @@ -2450,7 +2742,8 @@ def __init__( class RefundPolicyError(_serialization.Model): """error details. - :ivar code: Known values are: "NotSpecified", "InternalServerError", "ServerTimeout", + :ivar code: Error code describing the reason that service is not able to process the incoming + request. Known values are: "NotSpecified", "InternalServerError", "ServerTimeout", "AuthorizationFailed", "BadRequest", "ClientCertificateThumbprintNotSet", "InvalidRequestContent", "OperationFailed", "HttpMethodNotSupported", "InvalidRequestUri", "MissingTenantId", "InvalidTenantId", "InvalidReservationOrderId", "InvalidReservationId", @@ -2481,10 +2774,15 @@ class RefundPolicyError(_serialization.Model): } def __init__( - self, *, code: Optional[Union[str, "_models.ErrorResponseCode"]] = None, message: Optional[str] = None, **kwargs - ): + self, + *, + code: Optional[Union[str, "_models.ErrorResponseCode"]] = None, + message: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword code: Known values are: "NotSpecified", "InternalServerError", "ServerTimeout", + :keyword code: Error code describing the reason that service is not able to process the + incoming request. Known values are: "NotSpecified", "InternalServerError", "ServerTimeout", "AuthorizationFailed", "BadRequest", "ClientCertificateThumbprintNotSet", "InvalidRequestContent", "OperationFailed", "HttpMethodNotSupported", "InvalidRequestUri", "MissingTenantId", "InvalidTenantId", "InvalidReservationOrderId", "InvalidReservationId", @@ -2524,7 +2822,7 @@ class RefundPolicyResult(_serialization.Model): "properties": {"key": "properties", "type": "RefundPolicyResultProperty"}, } - def __init__(self, *, properties: Optional["_models.RefundPolicyResultProperty"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.RefundPolicyResultProperty"] = None, **kwargs: Any) -> None: """ :keyword properties: Refund policy result property. :paramtype properties: ~azure.mgmt.reservations.models.RefundPolicyResultProperty @@ -2536,9 +2834,9 @@ def __init__(self, *, properties: Optional["_models.RefundPolicyResultProperty"] class RefundPolicyResultProperty(_serialization.Model): """Refund policy result property. - :ivar consumed_refunds_total: + :ivar consumed_refunds_total: Pricing information containing the amount and the currency code. :vartype consumed_refunds_total: ~azure.mgmt.reservations.models.Price - :ivar max_refund_limit: + :ivar max_refund_limit: Pricing information containing the amount and the currency code. :vartype max_refund_limit: ~azure.mgmt.reservations.models.Price :ivar policy_errors: Refund Policy errors. :vartype policy_errors: list[~azure.mgmt.reservations.models.RefundPolicyError] @@ -2556,12 +2854,13 @@ def __init__( consumed_refunds_total: Optional["_models.Price"] = None, max_refund_limit: Optional["_models.Price"] = None, policy_errors: Optional[List["_models.RefundPolicyError"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ - :keyword consumed_refunds_total: + :keyword consumed_refunds_total: Pricing information containing the amount and the currency + code. :paramtype consumed_refunds_total: ~azure.mgmt.reservations.models.Price - :keyword max_refund_limit: + :keyword max_refund_limit: Pricing information containing the amount and the currency code. :paramtype max_refund_limit: ~azure.mgmt.reservations.models.Price :keyword policy_errors: Refund Policy errors. :paramtype policy_errors: list[~azure.mgmt.reservations.models.RefundPolicyError] @@ -2573,9 +2872,10 @@ def __init__( class RefundRequest(_serialization.Model): - """RefundRequest. + """Request containing information needed for returning reservation. - :ivar properties: + :ivar properties: Properties needed for refund request including the session id from calculate + refund, the scope, the reservation to be returned and the return reason. :vartype properties: ~azure.mgmt.reservations.models.RefundRequestProperties """ @@ -2583,9 +2883,10 @@ class RefundRequest(_serialization.Model): "properties": {"key": "properties", "type": "RefundRequestProperties"}, } - def __init__(self, *, properties: Optional["_models.RefundRequestProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.RefundRequestProperties"] = None, **kwargs: Any) -> None: """ - :keyword properties: + :keyword properties: Properties needed for refund request including the session id from + calculate refund, the scope, the reservation to be returned and the return reason. :paramtype properties: ~azure.mgmt.reservations.models.RefundRequestProperties """ super().__init__(**kwargs) @@ -2593,7 +2894,8 @@ def __init__(self, *, properties: Optional["_models.RefundRequestProperties"] = class RefundRequestProperties(_serialization.Model): - """RefundRequestProperties. + """Properties needed for refund request including the session id from calculate refund, the scope, + the reservation to be returned and the return reason. :ivar session_id: SessionId that was returned by CalculateRefund API. :vartype session_id: str @@ -2619,8 +2921,8 @@ def __init__( scope: Optional[str] = None, reservation_to_return: Optional["_models.ReservationToReturn"] = None, return_reason: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword session_id: SessionId that was returned by CalculateRefund API. :paramtype session_id: str @@ -2639,11 +2941,11 @@ def __init__( class RefundResponse(_serialization.Model): - """RefundResponse. + """The response of refund request containing refund information of reservation. :ivar id: Fully qualified identifier of the reservation being returned. :vartype id: str - :ivar properties: + :ivar properties: The refund properties of reservation. :vartype properties: ~azure.mgmt.reservations.models.RefundResponseProperties """ @@ -2657,12 +2959,12 @@ def __init__( *, id: Optional[str] = None, # pylint: disable=redefined-builtin properties: Optional["_models.RefundResponseProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Fully qualified identifier of the reservation being returned. :paramtype id: str - :keyword properties: + :keyword properties: The refund properties of reservation. :paramtype properties: ~azure.mgmt.reservations.models.RefundResponseProperties """ super().__init__(**kwargs) @@ -2671,15 +2973,15 @@ def __init__( class RefundResponseProperties(_serialization.Model): - """RefundResponseProperties. + """The refund properties of reservation. :ivar session_id: Refund session identifier. :vartype session_id: str :ivar quantity: Quantity to be returned. :vartype quantity: int - :ivar billing_refund_amount: + :ivar billing_refund_amount: Pricing information containing the amount and the currency code. :vartype billing_refund_amount: ~azure.mgmt.reservations.models.Price - :ivar pricing_refund_amount: + :ivar pricing_refund_amount: Pricing information containing the amount and the currency code. :vartype pricing_refund_amount: ~azure.mgmt.reservations.models.Price :ivar policy_result: Refund policy result. :vartype policy_result: ~azure.mgmt.reservations.models.RefundPolicyResult @@ -2705,16 +3007,18 @@ def __init__( pricing_refund_amount: Optional["_models.Price"] = None, policy_result: Optional["_models.RefundPolicyResult"] = None, billing_information: Optional["_models.RefundBillingInformation"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword session_id: Refund session identifier. :paramtype session_id: str :keyword quantity: Quantity to be returned. :paramtype quantity: int - :keyword billing_refund_amount: + :keyword billing_refund_amount: Pricing information containing the amount and the currency + code. :paramtype billing_refund_amount: ~azure.mgmt.reservations.models.Price - :keyword pricing_refund_amount: + :keyword pricing_refund_amount: Pricing information containing the amount and the currency + code. :paramtype pricing_refund_amount: ~azure.mgmt.reservations.models.Price :keyword policy_result: Refund policy result. :paramtype policy_result: ~azure.mgmt.reservations.models.RefundPolicyResult @@ -2731,9 +3035,9 @@ def __init__( class RenewPropertiesResponse(_serialization.Model): - """RenewPropertiesResponse. + """The renew properties for a reservation. - :ivar purchase_properties: + :ivar purchase_properties: The request for reservation purchase. :vartype purchase_properties: ~azure.mgmt.reservations.models.PurchaseRequest :ivar pricing_currency_total: Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked price 30 days before expiry. @@ -2763,10 +3067,10 @@ def __init__( purchase_properties: Optional["_models.PurchaseRequest"] = None, pricing_currency_total: Optional["_models.RenewPropertiesResponsePricingCurrencyTotal"] = None, billing_currency_total: Optional["_models.RenewPropertiesResponseBillingCurrencyTotal"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ - :keyword purchase_properties: + :keyword purchase_properties: The request for reservation purchase. :paramtype purchase_properties: ~azure.mgmt.reservations.models.PurchaseRequest :keyword pricing_currency_total: Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked price 30 days before expiry. @@ -2784,7 +3088,8 @@ def __init__( class RenewPropertiesResponseBillingCurrencyTotal(_serialization.Model): - """Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included. + """Currency and amount that customer will be charged in customer's local currency for renewal + purchase. Tax is not included. :ivar currency_code: The ISO 4217 3-letter currency code for the currency used by this purchase record. @@ -2798,7 +3103,7 @@ class RenewPropertiesResponseBillingCurrencyTotal(_serialization.Model): "amount": {"key": "amount", "type": "float"}, } - def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[float] = None, **kwargs): + def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[float] = None, **kwargs: Any) -> None: """ :keyword currency_code: The ISO 4217 3-letter currency code for the currency used by this purchase record. @@ -2812,7 +3117,8 @@ def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[floa class RenewPropertiesResponsePricingCurrencyTotal(_serialization.Model): - """Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked price 30 days before expiry. + """Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is + not included. This is locked price 30 days before expiry. :ivar currency_code: The ISO 4217 3-letter currency code for the currency used by this purchase record. @@ -2826,7 +3132,7 @@ class RenewPropertiesResponsePricingCurrencyTotal(_serialization.Model): "amount": {"key": "amount", "type": "float"}, } - def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[float] = None, **kwargs): + def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[float] = None, **kwargs: Any) -> None: """ :keyword currency_code: The ISO 4217 3-letter currency code for the currency used by this purchase record. @@ -2840,7 +3146,7 @@ def __init__(self, *, currency_code: Optional[str] = None, amount: Optional[floa class ReservationList(_serialization.Model): - """ReservationList. + """List of ``Reservation``\ s. :ivar value: :vartype value: list[~azure.mgmt.reservations.models.ReservationResponse] @@ -2854,8 +3160,12 @@ class ReservationList(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.ReservationResponse"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.ReservationResponse"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: :paramtype value: list[~azure.mgmt.reservations.models.ReservationResponse] @@ -2868,14 +3178,14 @@ def __init__( class ReservationMergeProperties(_serialization.Model): - """ReservationMergeProperties. + """Properties of reservation merge. - :ivar merge_destination: Reservation Resource Id Created due to the merge. Format of the - resource Id is + :ivar merge_destination: Reservation resource id Created due to the merge. Format of the + resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :vartype merge_destination: str - :ivar merge_sources: Resource Ids of the Source Reservation's merged to form this Reservation. - Format of the resource Id is + :ivar merge_sources: Resource ids of the source reservation's merged to form this reservation. + Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :vartype merge_sources: list[str] """ @@ -2885,14 +3195,16 @@ class ReservationMergeProperties(_serialization.Model): "merge_sources": {"key": "mergeSources", "type": "[str]"}, } - def __init__(self, *, merge_destination: Optional[str] = None, merge_sources: Optional[List[str]] = None, **kwargs): + def __init__( + self, *, merge_destination: Optional[str] = None, merge_sources: Optional[List[str]] = None, **kwargs: Any + ) -> None: """ - :keyword merge_destination: Reservation Resource Id Created due to the merge. Format of the - resource Id is + :keyword merge_destination: Reservation resource id Created due to the merge. Format of the + resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :paramtype merge_destination: str - :keyword merge_sources: Resource Ids of the Source Reservation's merged to form this - Reservation. Format of the resource Id is + :keyword merge_sources: Resource ids of the source reservation's merged to form this + reservation. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :paramtype merge_sources: list[str] """ @@ -2929,8 +3241,8 @@ def __init__( start_date: Optional[datetime.date] = None, next_payment_due_date: Optional[datetime.date] = None, transactions: Optional[List["_models.PaymentDetail"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword pricing_currency_total: Amount of money to be paid for the Order. Tax is not included. :paramtype pricing_currency_total: ~azure.mgmt.reservations.models.Price @@ -2950,7 +3262,7 @@ def __init__( class ReservationOrderList(_serialization.Model): - """ReservationOrderList. + """List of ``ReservationOrder``\ s. :ivar value: :vartype value: list[~azure.mgmt.reservations.models.ReservationOrderResponse] @@ -2968,8 +3280,8 @@ def __init__( *, value: Optional[List["_models.ReservationOrderResponse"]] = None, next_link: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: :paramtype value: list[~azure.mgmt.reservations.models.ReservationOrderResponse] @@ -2982,7 +3294,7 @@ def __init__( class ReservationOrderResponse(_serialization.Model): # pylint: disable=too-many-instance-attributes - """ReservationOrderResponse. + """Details of a reservation order being returned. Variables are only populated by the server, and will be ignored when sending a request. @@ -3003,13 +3315,15 @@ class ReservationOrderResponse(_serialization.Model): # pylint: disable=too-man :vartype request_date_time: ~datetime.datetime :ivar created_date_time: This is the DateTime when the reservation was created. :vartype created_date_time: ~datetime.datetime - :ivar expiry_date: This is the date when the Reservation will expire. + :ivar expiry_date: This is the date when the reservation will expire. :vartype expiry_date: ~datetime.date + :ivar expiry_date_time: This is the date-time when the reservation will expire. + :vartype expiry_date_time: ~datetime.datetime :ivar benefit_start_time: This is the DateTime when the reservation benefit started. :vartype benefit_start_time: ~datetime.datetime - :ivar original_quantity: Total Quantity of the SKUs purchased in the Reservation. + :ivar original_quantity: Total Quantity of the skus purchased in the reservation. :vartype original_quantity: int - :ivar term: Represent the term of Reservation. Known values are: "P1Y", "P3Y", and "P5Y". + :ivar term: Represent the term of reservation. Known values are: "P1Y", "P3Y", and "P5Y". :vartype term: str or ~azure.mgmt.reservations.models.ReservationTerm :ivar provisioning_state: Current state of the reservation. Known values are: "Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", @@ -3023,6 +3337,9 @@ class ReservationOrderResponse(_serialization.Model): # pylint: disable=too-man ~azure.mgmt.reservations.models.ReservationOrderBillingPlanInformation :ivar reservations: :vartype reservations: list[~azure.mgmt.reservations.models.ReservationResponse] + :ivar review_date_time: This is the date-time when the Azure Hybrid Benefit needs to be + reviewed. + :vartype review_date_time: ~datetime.datetime """ _validation = { @@ -3042,6 +3359,7 @@ class ReservationOrderResponse(_serialization.Model): # pylint: disable=too-man "request_date_time": {"key": "properties.requestDateTime", "type": "iso-8601"}, "created_date_time": {"key": "properties.createdDateTime", "type": "iso-8601"}, "expiry_date": {"key": "properties.expiryDate", "type": "date"}, + "expiry_date_time": {"key": "properties.expiryDateTime", "type": "iso-8601"}, "benefit_start_time": {"key": "properties.benefitStartTime", "type": "iso-8601"}, "original_quantity": {"key": "properties.originalQuantity", "type": "int"}, "term": {"key": "properties.term", "type": "str"}, @@ -3049,6 +3367,7 @@ class ReservationOrderResponse(_serialization.Model): # pylint: disable=too-man "billing_plan": {"key": "properties.billingPlan", "type": "str"}, "plan_information": {"key": "properties.planInformation", "type": "ReservationOrderBillingPlanInformation"}, "reservations": {"key": "properties.reservations", "type": "[ReservationResponse]"}, + "review_date_time": {"key": "properties.reviewDateTime", "type": "iso-8601"}, } def __init__( @@ -3059,6 +3378,7 @@ def __init__( request_date_time: Optional[datetime.datetime] = None, created_date_time: Optional[datetime.datetime] = None, expiry_date: Optional[datetime.date] = None, + expiry_date_time: Optional[datetime.datetime] = None, benefit_start_time: Optional[datetime.datetime] = None, original_quantity: Optional[int] = None, term: Optional[Union[str, "_models.ReservationTerm"]] = None, @@ -3066,8 +3386,9 @@ def __init__( billing_plan: Optional[Union[str, "_models.ReservationBillingPlan"]] = None, plan_information: Optional["_models.ReservationOrderBillingPlanInformation"] = None, reservations: Optional[List["_models.ReservationResponse"]] = None, - **kwargs - ): + review_date_time: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: """ :keyword etag: :paramtype etag: int @@ -3078,13 +3399,15 @@ def __init__( :paramtype request_date_time: ~datetime.datetime :keyword created_date_time: This is the DateTime when the reservation was created. :paramtype created_date_time: ~datetime.datetime - :keyword expiry_date: This is the date when the Reservation will expire. + :keyword expiry_date: This is the date when the reservation will expire. :paramtype expiry_date: ~datetime.date + :keyword expiry_date_time: This is the date-time when the reservation will expire. + :paramtype expiry_date_time: ~datetime.datetime :keyword benefit_start_time: This is the DateTime when the reservation benefit started. :paramtype benefit_start_time: ~datetime.datetime - :keyword original_quantity: Total Quantity of the SKUs purchased in the Reservation. + :keyword original_quantity: Total Quantity of the skus purchased in the reservation. :paramtype original_quantity: int - :keyword term: Represent the term of Reservation. Known values are: "P1Y", "P3Y", and "P5Y". + :keyword term: Represent the term of reservation. Known values are: "P1Y", "P3Y", and "P5Y". :paramtype term: str or ~azure.mgmt.reservations.models.ReservationTerm :keyword provisioning_state: Current state of the reservation. Known values are: "Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", @@ -3099,6 +3422,9 @@ def __init__( ~azure.mgmt.reservations.models.ReservationOrderBillingPlanInformation :keyword reservations: :paramtype reservations: list[~azure.mgmt.reservations.models.ReservationResponse] + :keyword review_date_time: This is the date-time when the Azure Hybrid Benefit needs to be + reviewed. + :paramtype review_date_time: ~datetime.datetime """ super().__init__(**kwargs) self.etag = etag @@ -3110,6 +3436,7 @@ def __init__( self.request_date_time = request_date_time self.created_date_time = created_date_time self.expiry_date = expiry_date + self.expiry_date_time = expiry_date_time self.benefit_start_time = benefit_start_time self.original_quantity = original_quantity self.term = term @@ -3117,31 +3444,35 @@ def __init__( self.billing_plan = billing_plan self.plan_information = plan_information self.reservations = reservations + self.review_date_time = review_date_time -class ReservationResponse(_serialization.Model): +class ReservationResponse(ProxyResource): """The definition of the reservation. Variables are only populated by the server, and will be ignored when sending a request. - :ivar location: The Azure Region where the reserved resource lives. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.reservations.models.SystemData + :ivar location: The Azure region where the reserved resource lives. :vartype location: str :ivar etag: :vartype etag: int - :ivar id: Identifier of the reservation. - :vartype id: str - :ivar name: Name of the reservation. - :vartype name: str :ivar sku: The sku information associated to this reservation. :vartype sku: ~azure.mgmt.reservations.models.SkuName :ivar properties: The properties associated to this reservation. :vartype properties: ~azure.mgmt.reservations.models.ReservationsProperties - :ivar type: Type of resource. "Microsoft.Capacity/reservationOrders/reservations". - :vartype type: str :ivar kind: Resource Provider type to be reserved. Default value is "Microsoft.Compute". :vartype kind: str - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.reservations.models.SystemData """ _validation = { @@ -3152,15 +3483,15 @@ class ReservationResponse(_serialization.Model): } _attribute_map = { - "location": {"key": "location", "type": "str"}, - "etag": {"key": "etag", "type": "int"}, "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "location": {"key": "location", "type": "str"}, + "etag": {"key": "etag", "type": "int"}, "sku": {"key": "sku", "type": "SkuName"}, "properties": {"key": "properties", "type": "ReservationsProperties"}, - "type": {"key": "type", "type": "str"}, "kind": {"key": "kind", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, } def __init__( @@ -3171,10 +3502,10 @@ def __init__( sku: Optional["_models.SkuName"] = None, properties: Optional["_models.ReservationsProperties"] = None, kind: Optional[Literal["Microsoft.Compute"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ - :keyword location: The Azure Region where the reserved resource lives. + :keyword location: The Azure region where the reserved resource lives. :paramtype location: str :keyword etag: :paramtype etag: int @@ -3188,13 +3519,9 @@ def __init__( super().__init__(**kwargs) self.location = location self.etag = etag - self.id = None - self.name = None self.sku = sku self.properties = properties - self.type = None self.kind = kind - self.system_data = None class ReservationsListResult(_serialization.Model): @@ -3221,7 +3548,7 @@ class ReservationsListResult(_serialization.Model): "summary": {"key": "summary", "type": "ReservationSummary"}, } - def __init__(self, *, summary: Optional["_models.ReservationSummary"] = None, **kwargs): + def __init__(self, *, summary: Optional["_models.ReservationSummary"] = None, **kwargs: Any) -> None: """ :keyword summary: The roll out count summary of the reservations. :paramtype summary: ~azure.mgmt.reservations.models.ReservationSummary @@ -3233,14 +3560,14 @@ def __init__(self, *, summary: Optional["_models.ReservationSummary"] = None, ** class ReservationSplitProperties(_serialization.Model): - """ReservationSplitProperties. + """Properties of reservation split. - :ivar split_destinations: List of destination Resource Id that are created due to split. Format - of the resource Id is + :ivar split_destinations: List of destination resource id that are created due to split. Format + of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :vartype split_destinations: list[str] - :ivar split_source: Resource Id of the Reservation from which this is split. Format of the - resource Id is + :ivar split_source: Resource id of the reservation from which this is split. Format of the + resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :vartype split_source: str """ @@ -3250,14 +3577,16 @@ class ReservationSplitProperties(_serialization.Model): "split_source": {"key": "splitSource", "type": "str"}, } - def __init__(self, *, split_destinations: Optional[List[str]] = None, split_source: Optional[str] = None, **kwargs): + def __init__( + self, *, split_destinations: Optional[List[str]] = None, split_source: Optional[str] = None, **kwargs: Any + ) -> None: """ - :keyword split_destinations: List of destination Resource Id that are created due to split. - Format of the resource Id is + :keyword split_destinations: List of destination resource id that are created due to split. + Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :paramtype split_destinations: list[str] - :keyword split_source: Resource Id of the Reservation from which this is split. Format of the - resource Id is + :keyword split_source: Resource id of the reservation from which this is split. Format of the + resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :paramtype split_source: str """ @@ -3279,58 +3608,69 @@ class ReservationsProperties(_serialization.Model): # pylint: disable=too-many- "SqlEdge", and "VirtualMachineSoftware". :vartype reserved_resource_type: str or ~azure.mgmt.reservations.models.ReservedResourceType :ivar instance_flexibility: Allows reservation discount to be applied across skus within the - same Autofit group. Not all skus support instance size flexibility. Known values are: "On" and + same auto fit group. Not all skus support instance size flexibility. Known values are: "On" and "Off". :vartype instance_flexibility: str or ~azure.mgmt.reservations.models.InstanceFlexibility :ivar display_name: Friendly name for user to easily identify the reservation. :vartype display_name: str :ivar applied_scopes: The list of applied scopes. :vartype applied_scopes: list[str] - :ivar applied_scope_type: The applied scope type. Known values are: "Single" and "Shared". + :ivar applied_scope_type: The applied scope type. Known values are: "Single", "Shared", and + "ManagementGroup". :vartype applied_scope_type: str or ~azure.mgmt.reservations.models.AppliedScopeType :ivar archived: Indicates if the reservation is archived. :vartype archived: bool :ivar capabilities: Capabilities of the reservation. :vartype capabilities: str - :ivar quantity: Quantity of the SKUs that are part of the Reservation. + :ivar quantity: Quantity of the skus that are part of the reservation. :vartype quantity: int :ivar provisioning_state: Current state of the reservation. Known values are: "Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", "BillingFailed", "Failed", "Split", and "Merged". :vartype provisioning_state: str or ~azure.mgmt.reservations.models.ProvisioningState - :ivar effective_date_time: DateTime of the Reservation starting when this version is effective + :ivar effective_date_time: DateTime of the reservation starting when this version is effective from. :vartype effective_date_time: ~datetime.datetime :ivar benefit_start_time: This is the DateTime when the reservation benefit started. :vartype benefit_start_time: ~datetime.datetime - :ivar last_updated_date_time: DateTime of the last time the Reservation was updated. + :ivar last_updated_date_time: DateTime of the last time the reservation was updated. :vartype last_updated_date_time: ~datetime.datetime - :ivar expiry_date: This is the date when the Reservation will expire. + :ivar expiry_date: This is the date when the reservation will expire. :vartype expiry_date: ~datetime.date - :ivar sku_description: Description of the SKU in english. + :ivar expiry_date_time: This is the date-time when the reservation will expire. + :vartype expiry_date_time: ~datetime.datetime + :ivar review_date_time: This is the date-time when the Azure Hybrid Benefit needs to be + reviewed. + :vartype review_date_time: ~datetime.datetime + :ivar sku_description: Description of the sku in english. :vartype sku_description: str :ivar extended_status_info: The message giving detailed information about the status code. :vartype extended_status_info: ~azure.mgmt.reservations.models.ExtendedStatusInfo - :ivar billing_plan: The billing plan options available for this SKU. Known values are: + :ivar billing_plan: The billing plan options available for this sku. Known values are: "Upfront" and "Monthly". :vartype billing_plan: str or ~azure.mgmt.reservations.models.ReservationBillingPlan :ivar display_provisioning_state: The provisioning state of the reservation for display, e.g. Succeeded. :vartype display_provisioning_state: str - :ivar provisioning_sub_state: The provisioning state of the reservation, e.g. Succeeded. + :ivar provisioning_sub_state: The provisioning sub-state of the reservation, e.g. Succeeded. :vartype provisioning_sub_state: str - :ivar purchase_date: This is the date when the Reservation was purchased. + :ivar purchase_date: This is the date when the reservation was purchased. :vartype purchase_date: ~datetime.date - :ivar split_properties: + :ivar purchase_date_time: This is the date-time when the reservation was purchased. + :vartype purchase_date_time: ~datetime.datetime + :ivar split_properties: Properties of reservation split. :vartype split_properties: ~azure.mgmt.reservations.models.ReservationSplitProperties - :ivar merge_properties: + :ivar merge_properties: Properties of reservation merge. :vartype merge_properties: ~azure.mgmt.reservations.models.ReservationMergeProperties - :ivar swap_properties: + :ivar swap_properties: Properties of reservation swap. :vartype swap_properties: ~azure.mgmt.reservations.models.ReservationSwapProperties - :ivar applied_scope_properties: + :ivar applied_scope_properties: Properties specific to applied scope type. Not required if not + applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is + ManagementGroup. :vartype applied_scope_properties: ~azure.mgmt.reservations.models.AppliedScopeProperties - :ivar billing_scope_id: Subscription that will be charged for purchasing Reservation. + :ivar billing_scope_id: Subscription that will be charged for purchasing reservation or savings + plan. :vartype billing_scope_id: str :ivar renew: Setting this to true will automatically purchase a new reservation on the expiration date time. @@ -3343,9 +3683,9 @@ class ReservationsProperties(_serialization.Model): # pylint: disable=too-many- Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :vartype renew_destination: str - :ivar renew_properties: + :ivar renew_properties: The renew properties for a reservation. :vartype renew_properties: ~azure.mgmt.reservations.models.RenewPropertiesResponse - :ivar term: Represent the term of Reservation. Known values are: "P1Y", "P3Y", and "P5Y". + :ivar term: Represent the term of reservation. Known values are: "P1Y", "P3Y", and "P5Y". :vartype term: str or ~azure.mgmt.reservations.models.ReservationTerm :ivar user_friendly_applied_scope_type: The applied scope type of the reservation for display, e.g. Shared. @@ -3379,12 +3719,15 @@ class ReservationsProperties(_serialization.Model): # pylint: disable=too-many- "benefit_start_time": {"key": "benefitStartTime", "type": "iso-8601"}, "last_updated_date_time": {"key": "lastUpdatedDateTime", "type": "iso-8601"}, "expiry_date": {"key": "expiryDate", "type": "date"}, + "expiry_date_time": {"key": "expiryDateTime", "type": "iso-8601"}, + "review_date_time": {"key": "reviewDateTime", "type": "iso-8601"}, "sku_description": {"key": "skuDescription", "type": "str"}, "extended_status_info": {"key": "extendedStatusInfo", "type": "ExtendedStatusInfo"}, "billing_plan": {"key": "billingPlan", "type": "str"}, "display_provisioning_state": {"key": "displayProvisioningState", "type": "str"}, "provisioning_sub_state": {"key": "provisioningSubState", "type": "str"}, "purchase_date": {"key": "purchaseDate", "type": "date"}, + "purchase_date_time": {"key": "purchaseDateTime", "type": "iso-8601"}, "split_properties": {"key": "splitProperties", "type": "ReservationSplitProperties"}, "merge_properties": {"key": "mergeProperties", "type": "ReservationMergeProperties"}, "swap_properties": {"key": "swapProperties", "type": "ReservationSwapProperties"}, @@ -3415,10 +3758,13 @@ def __init__( # pylint: disable=too-many-locals effective_date_time: Optional[datetime.datetime] = None, benefit_start_time: Optional[datetime.datetime] = None, expiry_date: Optional[datetime.date] = None, + expiry_date_time: Optional[datetime.datetime] = None, + review_date_time: Optional[datetime.datetime] = None, sku_description: Optional[str] = None, extended_status_info: Optional["_models.ExtendedStatusInfo"] = None, billing_plan: Optional[Union[str, "_models.ReservationBillingPlan"]] = None, purchase_date: Optional[datetime.date] = None, + purchase_date_time: Optional[datetime.datetime] = None, split_properties: Optional["_models.ReservationSplitProperties"] = None, merge_properties: Optional["_models.ReservationMergeProperties"] = None, swap_properties: Optional["_models.ReservationSwapProperties"] = None, @@ -3429,8 +3775,8 @@ def __init__( # pylint: disable=too-many-locals renew_destination: Optional[str] = None, renew_properties: Optional["_models.RenewPropertiesResponse"] = None, term: Optional[Union[str, "_models.ReservationTerm"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword reserved_resource_type: The type of the resource that is being reserved. Known values are: "VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", @@ -3440,51 +3786,62 @@ def __init__( # pylint: disable=too-many-locals "SqlEdge", and "VirtualMachineSoftware". :paramtype reserved_resource_type: str or ~azure.mgmt.reservations.models.ReservedResourceType :keyword instance_flexibility: Allows reservation discount to be applied across skus within the - same Autofit group. Not all skus support instance size flexibility. Known values are: "On" and + same auto fit group. Not all skus support instance size flexibility. Known values are: "On" and "Off". :paramtype instance_flexibility: str or ~azure.mgmt.reservations.models.InstanceFlexibility :keyword display_name: Friendly name for user to easily identify the reservation. :paramtype display_name: str :keyword applied_scopes: The list of applied scopes. :paramtype applied_scopes: list[str] - :keyword applied_scope_type: The applied scope type. Known values are: "Single" and "Shared". + :keyword applied_scope_type: The applied scope type. Known values are: "Single", "Shared", and + "ManagementGroup". :paramtype applied_scope_type: str or ~azure.mgmt.reservations.models.AppliedScopeType :keyword archived: Indicates if the reservation is archived. :paramtype archived: bool :keyword capabilities: Capabilities of the reservation. :paramtype capabilities: str - :keyword quantity: Quantity of the SKUs that are part of the Reservation. + :keyword quantity: Quantity of the skus that are part of the reservation. :paramtype quantity: int :keyword provisioning_state: Current state of the reservation. Known values are: "Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", "BillingFailed", "Failed", "Split", and "Merged". :paramtype provisioning_state: str or ~azure.mgmt.reservations.models.ProvisioningState - :keyword effective_date_time: DateTime of the Reservation starting when this version is + :keyword effective_date_time: DateTime of the reservation starting when this version is effective from. :paramtype effective_date_time: ~datetime.datetime :keyword benefit_start_time: This is the DateTime when the reservation benefit started. :paramtype benefit_start_time: ~datetime.datetime - :keyword expiry_date: This is the date when the Reservation will expire. + :keyword expiry_date: This is the date when the reservation will expire. :paramtype expiry_date: ~datetime.date - :keyword sku_description: Description of the SKU in english. + :keyword expiry_date_time: This is the date-time when the reservation will expire. + :paramtype expiry_date_time: ~datetime.datetime + :keyword review_date_time: This is the date-time when the Azure Hybrid Benefit needs to be + reviewed. + :paramtype review_date_time: ~datetime.datetime + :keyword sku_description: Description of the sku in english. :paramtype sku_description: str :keyword extended_status_info: The message giving detailed information about the status code. :paramtype extended_status_info: ~azure.mgmt.reservations.models.ExtendedStatusInfo - :keyword billing_plan: The billing plan options available for this SKU. Known values are: + :keyword billing_plan: The billing plan options available for this sku. Known values are: "Upfront" and "Monthly". :paramtype billing_plan: str or ~azure.mgmt.reservations.models.ReservationBillingPlan - :keyword purchase_date: This is the date when the Reservation was purchased. + :keyword purchase_date: This is the date when the reservation was purchased. :paramtype purchase_date: ~datetime.date - :keyword split_properties: + :keyword purchase_date_time: This is the date-time when the reservation was purchased. + :paramtype purchase_date_time: ~datetime.datetime + :keyword split_properties: Properties of reservation split. :paramtype split_properties: ~azure.mgmt.reservations.models.ReservationSplitProperties - :keyword merge_properties: + :keyword merge_properties: Properties of reservation merge. :paramtype merge_properties: ~azure.mgmt.reservations.models.ReservationMergeProperties - :keyword swap_properties: + :keyword swap_properties: Properties of reservation swap. :paramtype swap_properties: ~azure.mgmt.reservations.models.ReservationSwapProperties - :keyword applied_scope_properties: + :keyword applied_scope_properties: Properties specific to applied scope type. Not required if + not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType + is ManagementGroup. :paramtype applied_scope_properties: ~azure.mgmt.reservations.models.AppliedScopeProperties - :keyword billing_scope_id: Subscription that will be charged for purchasing Reservation. + :keyword billing_scope_id: Subscription that will be charged for purchasing reservation or + savings plan. :paramtype billing_scope_id: str :keyword renew: Setting this to true will automatically purchase a new reservation on the expiration date time. @@ -3497,9 +3854,9 @@ def __init__( # pylint: disable=too-many-locals renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :paramtype renew_destination: str - :keyword renew_properties: + :keyword renew_properties: The renew properties for a reservation. :paramtype renew_properties: ~azure.mgmt.reservations.models.RenewPropertiesResponse - :keyword term: Represent the term of Reservation. Known values are: "P1Y", "P3Y", and "P5Y". + :keyword term: Represent the term of reservation. Known values are: "P1Y", "P3Y", and "P5Y". :paramtype term: str or ~azure.mgmt.reservations.models.ReservationTerm """ super().__init__(**kwargs) @@ -3516,12 +3873,15 @@ def __init__( # pylint: disable=too-many-locals self.benefit_start_time = benefit_start_time self.last_updated_date_time = None self.expiry_date = expiry_date + self.expiry_date_time = expiry_date_time + self.review_date_time = review_date_time self.sku_description = sku_description self.extended_status_info = extended_status_info self.billing_plan = billing_plan self.display_provisioning_state = None self.provisioning_sub_state = None self.purchase_date = purchase_date + self.purchase_date_time = purchase_date_time self.split_properties = split_properties self.merge_properties = merge_properties self.swap_properties = swap_properties @@ -3542,7 +3902,7 @@ class ReservationsPropertiesUtilization(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar trend: The number of days trend for a reservation. + :ivar trend: last 7 day utilization trend for a reservation. :vartype trend: str :ivar aggregates: The array of aggregates of a reservation's utilization. :vartype aggregates: list[~azure.mgmt.reservations.models.ReservationUtilizationAggregates] @@ -3557,7 +3917,9 @@ class ReservationsPropertiesUtilization(_serialization.Model): "aggregates": {"key": "aggregates", "type": "[ReservationUtilizationAggregates]"}, } - def __init__(self, *, aggregates: Optional[List["_models.ReservationUtilizationAggregates"]] = None, **kwargs): + def __init__( + self, *, aggregates: Optional[List["_models.ReservationUtilizationAggregates"]] = None, **kwargs: Any + ) -> None: """ :keyword aggregates: The array of aggregates of a reservation's utilization. :paramtype aggregates: list[~azure.mgmt.reservations.models.ReservationUtilizationAggregates] @@ -3586,6 +3948,10 @@ class ReservationSummary(_serialization.Model): :vartype cancelled_count: float :ivar processing_count: The number of reservation in Processing state. :vartype processing_count: float + :ivar warning_count: The number of reservation in Warning state. + :vartype warning_count: float + :ivar no_benefit_count: The number of reservation in NoBenefit state. + :vartype no_benefit_count: float """ _validation = { @@ -3596,6 +3962,8 @@ class ReservationSummary(_serialization.Model): "pending_count": {"readonly": True}, "cancelled_count": {"readonly": True}, "processing_count": {"readonly": True}, + "warning_count": {"readonly": True}, + "no_benefit_count": {"readonly": True}, } _attribute_map = { @@ -3606,9 +3974,11 @@ class ReservationSummary(_serialization.Model): "pending_count": {"key": "pendingCount", "type": "float"}, "cancelled_count": {"key": "cancelledCount", "type": "float"}, "processing_count": {"key": "processingCount", "type": "float"}, + "warning_count": {"key": "warningCount", "type": "float"}, + "no_benefit_count": {"key": "noBenefitCount", "type": "float"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.succeeded_count = None @@ -3618,17 +3988,19 @@ def __init__(self, **kwargs): self.pending_count = None self.cancelled_count = None self.processing_count = None + self.warning_count = None + self.no_benefit_count = None class ReservationSwapProperties(_serialization.Model): - """ReservationSwapProperties. + """Properties of reservation swap. - :ivar swap_source: Resource Id of the Source Reservation that gets swapped. Format of the - resource Id is + :ivar swap_source: Resource id of the source reservation that gets swapped. Format of the + resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :vartype swap_source: str - :ivar swap_destination: Reservation Resource Id that the original resource gets swapped to. - Format of the resource Id is + :ivar swap_destination: Reservation resource id that the original resource gets swapped to. + Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :vartype swap_destination: str """ @@ -3638,14 +4010,16 @@ class ReservationSwapProperties(_serialization.Model): "swap_destination": {"key": "swapDestination", "type": "str"}, } - def __init__(self, *, swap_source: Optional[str] = None, swap_destination: Optional[str] = None, **kwargs): + def __init__( + self, *, swap_source: Optional[str] = None, swap_destination: Optional[str] = None, **kwargs: Any + ) -> None: """ - :keyword swap_source: Resource Id of the Source Reservation that gets swapped. Format of the - resource Id is + :keyword swap_source: Resource id of the source reservation that gets swapped. Format of the + resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :paramtype swap_source: str - :keyword swap_destination: Reservation Resource Id that the original resource gets swapped to. - Format of the resource Id is + :keyword swap_destination: Reservation resource id that the original resource gets swapped to. + Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. :paramtype swap_destination: str """ @@ -3657,11 +4031,11 @@ def __init__(self, *, swap_source: Optional[str] = None, swap_destination: Optio class ReservationToExchange(_serialization.Model): """Reservation refund details. - :ivar reservation_id: Fully qualified id of the Reservation being returned. + :ivar reservation_id: Fully qualified id of the reservation being returned. :vartype reservation_id: str :ivar quantity: Quantity to be returned. :vartype quantity: int - :ivar billing_refund_amount: + :ivar billing_refund_amount: Pricing information containing the amount and the currency code. :vartype billing_refund_amount: ~azure.mgmt.reservations.models.Price :ivar billing_information: billing information. :vartype billing_information: ~azure.mgmt.reservations.models.BillingInformation @@ -3681,14 +4055,15 @@ def __init__( quantity: Optional[int] = None, billing_refund_amount: Optional["_models.Price"] = None, billing_information: Optional["_models.BillingInformation"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ - :keyword reservation_id: Fully qualified id of the Reservation being returned. + :keyword reservation_id: Fully qualified id of the reservation being returned. :paramtype reservation_id: str :keyword quantity: Quantity to be returned. :paramtype quantity: int - :keyword billing_refund_amount: + :keyword billing_refund_amount: Pricing information containing the amount and the currency + code. :paramtype billing_refund_amount: ~azure.mgmt.reservations.models.Price :keyword billing_information: billing information. :paramtype billing_information: ~azure.mgmt.reservations.models.BillingInformation @@ -3703,9 +4078,9 @@ def __init__( class ReservationToPurchaseCalculateExchange(_serialization.Model): """Reservation purchase details. - :ivar properties: + :ivar properties: The request for reservation purchase. :vartype properties: ~azure.mgmt.reservations.models.PurchaseRequest - :ivar billing_currency_total: + :ivar billing_currency_total: Pricing information containing the amount and the currency code. :vartype billing_currency_total: ~azure.mgmt.reservations.models.Price """ @@ -3719,12 +4094,13 @@ def __init__( *, properties: Optional["_models.PurchaseRequest"] = None, billing_currency_total: Optional["_models.Price"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ - :keyword properties: + :keyword properties: The request for reservation purchase. :paramtype properties: ~azure.mgmt.reservations.models.PurchaseRequest - :keyword billing_currency_total: + :keyword billing_currency_total: Pricing information containing the amount and the currency + code. :paramtype billing_currency_total: ~azure.mgmt.reservations.models.Price """ super().__init__(**kwargs) @@ -3735,14 +4111,14 @@ def __init__( class ReservationToPurchaseExchange(_serialization.Model): """Reservation purchase details. - :ivar reservation_order_id: Fully qualified id of the ReservationOrder being purchased. + :ivar reservation_order_id: Fully qualified id of the reservationOrder being purchased. :vartype reservation_order_id: str - :ivar reservation_id: Fully qualified id of the Reservation being purchased. This value is only + :ivar reservation_id: Fully qualified id of the reservation being purchased. This value is only guaranteed to be non-null if the purchase is successful. :vartype reservation_id: str - :ivar properties: + :ivar properties: The request for reservation purchase. :vartype properties: ~azure.mgmt.reservations.models.PurchaseRequest - :ivar billing_currency_total: + :ivar billing_currency_total: Pricing information containing the amount and the currency code. :vartype billing_currency_total: ~azure.mgmt.reservations.models.Price :ivar status: Status of the individual operation. Known values are: "Succeeded", "Failed", "Cancelled", and "Pending". @@ -3765,17 +4141,18 @@ def __init__( properties: Optional["_models.PurchaseRequest"] = None, billing_currency_total: Optional["_models.Price"] = None, status: Optional[Union[str, "_models.OperationStatus"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ - :keyword reservation_order_id: Fully qualified id of the ReservationOrder being purchased. + :keyword reservation_order_id: Fully qualified id of the reservationOrder being purchased. :paramtype reservation_order_id: str - :keyword reservation_id: Fully qualified id of the Reservation being purchased. This value is + :keyword reservation_id: Fully qualified id of the reservation being purchased. This value is only guaranteed to be non-null if the purchase is successful. :paramtype reservation_id: str - :keyword properties: + :keyword properties: The request for reservation purchase. :paramtype properties: ~azure.mgmt.reservations.models.PurchaseRequest - :keyword billing_currency_total: + :keyword billing_currency_total: Pricing information containing the amount and the currency + code. :paramtype billing_currency_total: ~azure.mgmt.reservations.models.Price :keyword status: Status of the individual operation. Known values are: "Succeeded", "Failed", "Cancelled", and "Pending". @@ -3792,7 +4169,7 @@ def __init__( class ReservationToReturn(_serialization.Model): """Reservation to return. - :ivar reservation_id: Fully qualified identifier of the Reservation being returned. + :ivar reservation_id: Fully qualified identifier of the reservation being returned. :vartype reservation_id: str :ivar quantity: Quantity to be returned. Must be greater than zero. :vartype quantity: int @@ -3803,9 +4180,9 @@ class ReservationToReturn(_serialization.Model): "quantity": {"key": "quantity", "type": "int"}, } - def __init__(self, *, reservation_id: Optional[str] = None, quantity: Optional[int] = None, **kwargs): + def __init__(self, *, reservation_id: Optional[str] = None, quantity: Optional[int] = None, **kwargs: Any) -> None: """ - :keyword reservation_id: Fully qualified identifier of the Reservation being returned. + :keyword reservation_id: Fully qualified identifier of the reservation being returned. :paramtype reservation_id: str :keyword quantity: Quantity to be returned. Must be greater than zero. :paramtype quantity: int @@ -3818,11 +4195,11 @@ def __init__(self, *, reservation_id: Optional[str] = None, quantity: Optional[i class ReservationToReturnForExchange(_serialization.Model): """Reservation refund details. - :ivar reservation_id: Fully qualified id of the Reservation being returned. + :ivar reservation_id: Fully qualified id of the reservation being returned. :vartype reservation_id: str :ivar quantity: Quantity to be returned. :vartype quantity: int - :ivar billing_refund_amount: + :ivar billing_refund_amount: Pricing information containing the amount and the currency code. :vartype billing_refund_amount: ~azure.mgmt.reservations.models.Price :ivar billing_information: billing information. :vartype billing_information: ~azure.mgmt.reservations.models.BillingInformation @@ -3847,14 +4224,15 @@ def __init__( billing_refund_amount: Optional["_models.Price"] = None, billing_information: Optional["_models.BillingInformation"] = None, status: Optional[Union[str, "_models.OperationStatus"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ - :keyword reservation_id: Fully qualified id of the Reservation being returned. + :keyword reservation_id: Fully qualified id of the reservation being returned. :paramtype reservation_id: str :keyword quantity: Quantity to be returned. :paramtype quantity: int - :keyword billing_refund_amount: + :keyword billing_refund_amount: Pricing information containing the amount and the currency + code. :paramtype billing_refund_amount: ~azure.mgmt.reservations.models.Price :keyword billing_information: billing information. :paramtype billing_information: ~azure.mgmt.reservations.models.BillingInformation @@ -3899,7 +4277,7 @@ class ReservationUtilizationAggregates(_serialization.Model): "value_unit": {"key": "valueUnit", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.grain = None @@ -3928,7 +4306,7 @@ class ResourceName(_serialization.Model): "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__(self, *, value: Optional[str] = None, **kwargs): + def __init__(self, *, value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword value: Resource name. :paramtype value: str @@ -3938,8 +4316,184 @@ def __init__(self, *, value: Optional[str] = None, **kwargs): self.localized_value = None +class SavingsPlanPurchaseRequest(_serialization.Model): + """Request body for savings plan purchase. + + :ivar sku: The name of sku. + :vartype sku: ~azure.mgmt.reservations.models.SkuName + :ivar display_name: Friendly name of the savings plan. + :vartype display_name: str + :ivar billing_scope_id: Subscription that will be charged for purchasing reservation or savings + plan. + :vartype billing_scope_id: str + :ivar term: Represent savings plan term in ISO 8601 format. Known values are: "P1Y" and "P3Y". + :vartype term: str or ~azure.mgmt.reservations.models.SavingsPlanTerm + :ivar billing_plan: Represents the billing plan in ISO 8601 format. Required only for monthly + billing plans. "P1M" + :vartype billing_plan: str or ~azure.mgmt.reservations.models.BillingPlan + :ivar applied_scope_type: Type of the Applied Scope. Known values are: "Single", "Shared", and + "ManagementGroup". + :vartype applied_scope_type: str or ~azure.mgmt.reservations.models.AppliedScopeType + :ivar applied_scope_properties: Properties specific to applied scope type. Not required if not + applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is + ManagementGroup. + :vartype applied_scope_properties: ~azure.mgmt.reservations.models.AppliedScopeProperties + :ivar commitment: Commitment towards the benefit. + :vartype commitment: ~azure.mgmt.reservations.models.Commitment + """ + + _attribute_map = { + "sku": {"key": "sku", "type": "SkuName"}, + "display_name": {"key": "properties.displayName", "type": "str"}, + "billing_scope_id": {"key": "properties.billingScopeId", "type": "str"}, + "term": {"key": "properties.term", "type": "str"}, + "billing_plan": {"key": "properties.billingPlan", "type": "str"}, + "applied_scope_type": {"key": "properties.appliedScopeType", "type": "str"}, + "applied_scope_properties": {"key": "properties.appliedScopeProperties", "type": "AppliedScopeProperties"}, + "commitment": {"key": "properties.commitment", "type": "Commitment"}, + } + + def __init__( + self, + *, + sku: Optional["_models.SkuName"] = None, + display_name: Optional[str] = None, + billing_scope_id: Optional[str] = None, + term: Optional[Union[str, "_models.SavingsPlanTerm"]] = None, + billing_plan: Optional[Union[str, "_models.BillingPlan"]] = None, + applied_scope_type: Optional[Union[str, "_models.AppliedScopeType"]] = None, + applied_scope_properties: Optional["_models.AppliedScopeProperties"] = None, + commitment: Optional["_models.Commitment"] = None, + **kwargs: Any + ) -> None: + """ + :keyword sku: The name of sku. + :paramtype sku: ~azure.mgmt.reservations.models.SkuName + :keyword display_name: Friendly name of the savings plan. + :paramtype display_name: str + :keyword billing_scope_id: Subscription that will be charged for purchasing reservation or + savings plan. + :paramtype billing_scope_id: str + :keyword term: Represent savings plan term in ISO 8601 format. Known values are: "P1Y" and + "P3Y". + :paramtype term: str or ~azure.mgmt.reservations.models.SavingsPlanTerm + :keyword billing_plan: Represents the billing plan in ISO 8601 format. Required only for + monthly billing plans. "P1M" + :paramtype billing_plan: str or ~azure.mgmt.reservations.models.BillingPlan + :keyword applied_scope_type: Type of the Applied Scope. Known values are: "Single", "Shared", + and "ManagementGroup". + :paramtype applied_scope_type: str or ~azure.mgmt.reservations.models.AppliedScopeType + :keyword applied_scope_properties: Properties specific to applied scope type. Not required if + not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType + is ManagementGroup. + :paramtype applied_scope_properties: ~azure.mgmt.reservations.models.AppliedScopeProperties + :keyword commitment: Commitment towards the benefit. + :paramtype commitment: ~azure.mgmt.reservations.models.Commitment + """ + super().__init__(**kwargs) + self.sku = sku + self.display_name = display_name + self.billing_scope_id = billing_scope_id + self.term = term + self.billing_plan = billing_plan + self.applied_scope_type = applied_scope_type + self.applied_scope_properties = applied_scope_properties + self.commitment = commitment + + +class SavingsPlanToPurchaseCalculateExchange(_serialization.Model): + """Savings plan purchase details. + + :ivar properties: Request body for savings plan purchase. + :vartype properties: ~azure.mgmt.reservations.models.SavingsPlanPurchaseRequest + :ivar billing_currency_total: Pricing information containing the amount and the currency code. + :vartype billing_currency_total: ~azure.mgmt.reservations.models.Price + """ + + _attribute_map = { + "properties": {"key": "properties", "type": "SavingsPlanPurchaseRequest"}, + "billing_currency_total": {"key": "billingCurrencyTotal", "type": "Price"}, + } + + def __init__( + self, + *, + properties: Optional["_models.SavingsPlanPurchaseRequest"] = None, + billing_currency_total: Optional["_models.Price"] = None, + **kwargs: Any + ) -> None: + """ + :keyword properties: Request body for savings plan purchase. + :paramtype properties: ~azure.mgmt.reservations.models.SavingsPlanPurchaseRequest + :keyword billing_currency_total: Pricing information containing the amount and the currency + code. + :paramtype billing_currency_total: ~azure.mgmt.reservations.models.Price + """ + super().__init__(**kwargs) + self.properties = properties + self.billing_currency_total = billing_currency_total + + +class SavingsPlanToPurchaseExchange(_serialization.Model): + """Savings plan purchase details. + + :ivar savings_plan_order_id: Fully qualified id of the savings plan order being purchased. + :vartype savings_plan_order_id: str + :ivar savings_plan_id: Fully qualified id of the savings plan being purchased. This value is + only guaranteed to be non-null if the purchase is successful. + :vartype savings_plan_id: str + :ivar properties: Request body for savings plan purchase. + :vartype properties: ~azure.mgmt.reservations.models.SavingsPlanPurchaseRequest + :ivar billing_currency_total: Pricing information containing the amount and the currency code. + :vartype billing_currency_total: ~azure.mgmt.reservations.models.Price + :ivar status: Status of the individual operation. Known values are: "Succeeded", "Failed", + "Cancelled", and "Pending". + :vartype status: str or ~azure.mgmt.reservations.models.OperationStatus + """ + + _attribute_map = { + "savings_plan_order_id": {"key": "savingsPlanOrderId", "type": "str"}, + "savings_plan_id": {"key": "savingsPlanId", "type": "str"}, + "properties": {"key": "properties", "type": "SavingsPlanPurchaseRequest"}, + "billing_currency_total": {"key": "billingCurrencyTotal", "type": "Price"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__( + self, + *, + savings_plan_order_id: Optional[str] = None, + savings_plan_id: Optional[str] = None, + properties: Optional["_models.SavingsPlanPurchaseRequest"] = None, + billing_currency_total: Optional["_models.Price"] = None, + status: Optional[Union[str, "_models.OperationStatus"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword savings_plan_order_id: Fully qualified id of the savings plan order being purchased. + :paramtype savings_plan_order_id: str + :keyword savings_plan_id: Fully qualified id of the savings plan being purchased. This value is + only guaranteed to be non-null if the purchase is successful. + :paramtype savings_plan_id: str + :keyword properties: Request body for savings plan purchase. + :paramtype properties: ~azure.mgmt.reservations.models.SavingsPlanPurchaseRequest + :keyword billing_currency_total: Pricing information containing the amount and the currency + code. + :paramtype billing_currency_total: ~azure.mgmt.reservations.models.Price + :keyword status: Status of the individual operation. Known values are: "Succeeded", "Failed", + "Cancelled", and "Pending". + :paramtype status: str or ~azure.mgmt.reservations.models.OperationStatus + """ + super().__init__(**kwargs) + self.savings_plan_order_id = savings_plan_order_id + self.savings_plan_id = savings_plan_id + self.properties = properties + self.billing_currency_total = billing_currency_total + self.status = status + + class ScopeProperties(_serialization.Model): - """ScopeProperties. + """The scope and whether it is valid. :ivar scope: :vartype scope: str @@ -3952,7 +4506,7 @@ class ScopeProperties(_serialization.Model): "valid": {"key": "valid", "type": "bool"}, } - def __init__(self, *, scope: Optional[str] = None, valid: Optional[bool] = None, **kwargs): + def __init__(self, *, scope: Optional[str] = None, valid: Optional[bool] = None, **kwargs: Any) -> None: """ :keyword scope: :paramtype scope: str @@ -3987,7 +4541,7 @@ class ServiceError(_serialization.Model): "details": {"key": "details", "type": "[ServiceErrorDetail]"}, } - def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs): + def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs: Any) -> None: """ :keyword code: The error code. :paramtype code: str @@ -4021,7 +4575,7 @@ class ServiceErrorDetail(_serialization.Model): "message": {"key": "message", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -4029,7 +4583,7 @@ def __init__(self, **kwargs): class SkuCapability(_serialization.Model): - """SkuCapability. + """Capability of a sku. :ivar name: An invariant to describe the feature. :vartype name: str @@ -4042,7 +4596,7 @@ class SkuCapability(_serialization.Model): "value": {"key": "value", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: An invariant to describe the feature. :paramtype name: str @@ -4055,7 +4609,7 @@ def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, * class SkuName(_serialization.Model): - """SkuName. + """The name of sku. :ivar name: :vartype name: str @@ -4065,7 +4619,7 @@ class SkuName(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: :paramtype name: str @@ -4075,7 +4629,7 @@ def __init__(self, *, name: Optional[str] = None, **kwargs): class SkuProperty(_serialization.Model): - """SkuProperty. + """Property of a sku. :ivar name: An invariant to describe the feature. :vartype name: str @@ -4088,7 +4642,7 @@ class SkuProperty(_serialization.Model): "value": {"key": "value", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: An invariant to describe the feature. :paramtype name: str @@ -4101,12 +4655,12 @@ def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, * class SkuRestriction(_serialization.Model): - """SkuRestriction. + """Restriction of a sku. :ivar type: The type of restrictions. :vartype type: str :ivar values: The value of restrictions. If the restriction type is set to location. This would - be different locations where the SKU is restricted. + be different locations where the sku is restricted. :vartype values: list[str] :ivar reason_code: The reason for restriction. :vartype reason_code: str @@ -4124,13 +4678,13 @@ def __init__( type: Optional[str] = None, values: Optional[List[str]] = None, reason_code: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: The type of restrictions. :paramtype type: str :keyword values: The value of restrictions. If the restriction type is set to location. This - would be different locations where the SKU is restricted. + would be different locations where the sku is restricted. :paramtype values: list[str] :keyword reason_code: The reason for restriction. :paramtype reason_code: str @@ -4142,7 +4696,7 @@ def __init__( class SplitRequest(_serialization.Model): - """SplitRequest. + """The request for reservation split. :ivar quantities: List of the quantities in the new reservations to create. :vartype quantities: list[int] @@ -4157,7 +4711,9 @@ class SplitRequest(_serialization.Model): "reservation_id": {"key": "properties.reservationId", "type": "str"}, } - def __init__(self, *, quantities: Optional[List[int]] = None, reservation_id: Optional[str] = None, **kwargs): + def __init__( + self, *, quantities: Optional[List[int]] = None, reservation_id: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword quantities: List of the quantities in the new reservations to create. :paramtype quantities: list[int] @@ -4217,8 +4773,8 @@ def __init__( name: Optional["_models.ResourceName"] = None, unit: Optional[str] = None, provisioning_state: Optional[Union[str, "_models.QuotaRequestState"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The resource name. :paramtype name: ~azure.mgmt.reservations.models.ResourceName @@ -4240,7 +4796,7 @@ def __init__( class SubscriptionScopeProperties(_serialization.Model): - """SubscriptionScopeProperties. + """The scopes checked by the available scope api. :ivar scopes: :vartype scopes: list[~azure.mgmt.reservations.models.ScopeProperties] @@ -4250,7 +4806,7 @@ class SubscriptionScopeProperties(_serialization.Model): "scopes": {"key": "scopes", "type": "[ScopeProperties]"}, } - def __init__(self, *, scopes: Optional[List["_models.ScopeProperties"]] = None, **kwargs): + def __init__(self, *, scopes: Optional[List["_models.ScopeProperties"]] = None, **kwargs: Any) -> None: """ :keyword scopes: :paramtype scopes: list[~azure.mgmt.reservations.models.ScopeProperties] @@ -4296,8 +4852,8 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_azure_reservation_api_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_azure_reservation_api_operations.py index 9a9d4b9202dbf..81344fc6ab41a 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_azure_reservation_api_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_azure_reservation_api_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -17,6 +17,7 @@ ResourceNotModifiedError, map_error, ) +from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -47,12 +48,15 @@ def build_get_catalog_request( publisher_id: Optional[str] = None, offer_id: Optional[str] = None, plan_id: Optional[str] = None, + filter: Optional[str] = None, + skip: Optional[float] = None, + take: Optional[float] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,6 +79,12 @@ def build_get_catalog_request( _params["offerId"] = _SERIALIZER.query("offer_id", offer_id, "str") if plan_id is not None: _params["planId"] = _SERIALIZER.query("plan_id", plan_id, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "float") + if take is not None: + _params["$take"] = _SERIALIZER.query("take", take, "float") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -86,7 +96,7 @@ def build_get_applied_reservation_list_request(subscription_id: str, **kwargs: A _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,8 +128,11 @@ def get_catalog( publisher_id: Optional[str] = None, offer_id: Optional[str] = None, plan_id: Optional[str] = None, + filter: Optional[str] = None, + skip: Optional[float] = None, + take: Optional[float] = None, **kwargs: Any - ) -> List[_models.Catalog]: + ) -> Iterable["_models.Catalog"]: """Get the regions and skus that are available for RI purchase for the specified Azure subscription. @@ -132,7 +145,7 @@ def get_catalog( Default value is None. :type reserved_resource_type: str :param location: Filters the skus based on the location specified in this parameter. This can - be an azure region or global. Default value is None. + be an Azure region or global. Default value is None. :type location: str :param publisher_id: Publisher id used to get the third party products. Default value is None. :type publisher_id: str @@ -140,11 +153,25 @@ def get_catalog( :type offer_id: str :param plan_id: Plan id used to get the third party products. Default value is None. :type plan_id: str + :param filter: May be used to filter by Catalog properties. The filter supports 'eq', 'or', and + 'and'. Default value is None. + :type filter: str + :param skip: The number of reservations to skip from the list before returning results. Default + value is None. + :type skip: float + :param take: To number of reservations to return. Default value is None. + :type take: float :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of Catalog or the result of cls(response) - :rtype: list[~azure.mgmt.reservations.models.Catalog] + :return: An iterator like instance of either Catalog or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.reservations.models.Catalog] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + cls: ClsType[_models.CatalogsResult] = kwargs.pop("cls", None) + error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -153,44 +180,57 @@ def get_catalog( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) - cls: ClsType[List[_models.Catalog]] = kwargs.pop("cls", None) - - request = build_get_catalog_request( - subscription_id=subscription_id, - reserved_resource_type=reserved_resource_type, - location=location, - publisher_id=publisher_id, - offer_id=offer_id, - plan_id=plan_id, - api_version=api_version, - template_url=self.get_catalog.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("[Catalog]", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + def prepare_request(next_link=None): + if not next_link: + + request = build_get_catalog_request( + subscription_id=subscription_id, + reserved_resource_type=reserved_resource_type, + location=location, + publisher_id=publisher_id, + offer_id=offer_id, + plan_id=plan_id, + filter=filter, + skip=skip, + take=take, + api_version=api_version, + template_url=self.get_catalog.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + request = HttpRequest("GET", next_link) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("CatalogsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) get_catalog.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs"} @@ -219,7 +259,7 @@ def get_applied_reservation_list(self, subscription_id: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.AppliedReservations] = kwargs.pop("cls", None) request = build_get_applied_reservation_list_request( diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_calculate_exchange_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_calculate_exchange_operations.py index 481fbf6b1e7df..6cd2da2deebb7 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_calculate_exchange_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_calculate_exchange_operations.py @@ -45,7 +45,7 @@ def build_post_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -96,7 +96,7 @@ def _post_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.CalculateExchangeOperationResultResponse]] = kwargs.pop("cls", None) @@ -237,7 +237,7 @@ def begin_post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CalculateExchangeOperationResultResponse] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_calculate_refund_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_calculate_refund_operations.py index 425ae4fb98457..f2881e9be3aa8 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_calculate_refund_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_calculate_refund_operations.py @@ -43,7 +43,7 @@ def build_post_request(reservation_order_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -166,7 +166,7 @@ def post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CalculateRefundResponse] = kwargs.pop("cls", None) diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_exchange_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_exchange_operations.py index 3196c70a8e9f1..5c3d35fc47621 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_exchange_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_exchange_operations.py @@ -45,7 +45,7 @@ def build_post_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -96,7 +96,7 @@ def _post_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ExchangeOperationResultResponse]] = kwargs.pop("cls", None) @@ -237,7 +237,7 @@ def begin_post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExchangeOperationResultResponse] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_operation_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_operation_operations.py index 857a165369f11..bf3b599edaa05 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_operation_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_operation_operations.py @@ -44,7 +44,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationResponse"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_operations.py index 85636cb5ffc7a..ea8080c32a3ac 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_operations.py @@ -353,7 +353,7 @@ def begin_create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> Union[LROPoller[_models.CurrentQuotaLimitBase], LROPoller[_models.QuotaRequestSubmitResponse201]]: + ) -> LROPoller[_models.CurrentQuotaLimitBase]: """Create or update the quota (service limits) of a resource to the requested value. Steps: @@ -405,7 +405,7 @@ def begin_create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> Union[LROPoller[_models.CurrentQuotaLimitBase], LROPoller[_models.QuotaRequestSubmitResponse201]]: + ) -> LROPoller[_models.CurrentQuotaLimitBase]: """Create or update the quota (service limits) of a resource to the requested value. Steps: @@ -455,7 +455,7 @@ def begin_create_or_update( resource_name: str, create_quota_request: Union[_models.CurrentQuotaLimitBase, IO], **kwargs: Any - ) -> Union[LROPoller[_models.CurrentQuotaLimitBase], LROPoller[_models.QuotaRequestSubmitResponse201]]: + ) -> LROPoller[_models.CurrentQuotaLimitBase]: """Create or update the quota (service limits) of a resource to the requested value. Steps: @@ -635,7 +635,7 @@ def begin_update( *, content_type: str = "application/json", **kwargs: Any - ) -> Union[LROPoller[_models.CurrentQuotaLimitBase], LROPoller[_models.QuotaRequestSubmitResponse201]]: + ) -> LROPoller[_models.CurrentQuotaLimitBase]: """Update the quota (service limits) of this resource to the requested value. • To get the quota information for specific resource, send a GET request. • To increase the quota, update the limit field from the GET response to a new value. @@ -684,7 +684,7 @@ def begin_update( *, content_type: str = "application/json", **kwargs: Any - ) -> Union[LROPoller[_models.CurrentQuotaLimitBase], LROPoller[_models.QuotaRequestSubmitResponse201]]: + ) -> LROPoller[_models.CurrentQuotaLimitBase]: """Update the quota (service limits) of this resource to the requested value. • To get the quota information for specific resource, send a GET request. • To increase the quota, update the limit field from the GET response to a new value. @@ -731,7 +731,7 @@ def begin_update( resource_name: str, create_quota_request: Union[_models.CurrentQuotaLimitBase, IO], **kwargs: Any - ) -> Union[LROPoller[_models.CurrentQuotaLimitBase], LROPoller[_models.QuotaRequestSubmitResponse201]]: + ) -> LROPoller[_models.CurrentQuotaLimitBase]: """Update the quota (service limits) of this resource to the requested value. • To get the quota information for specific resource, send a GET request. • To increase the quota, update the limit field from the GET response to a new value. diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_reservation_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_reservation_operations.py index 0eec5d1ea4e27..f7c679bacfc60 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_reservation_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_reservation_operations.py @@ -46,7 +46,7 @@ def build_available_scopes_request(reservation_order_id: str, reservation_id: st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -77,7 +77,7 @@ def build_split_request(reservation_order_id: str, **kwargs: Any) -> HttpRequest _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -104,7 +104,7 @@ def build_merge_request(reservation_order_id: str, **kwargs: Any) -> HttpRequest _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,7 +131,7 @@ def build_list_request(reservation_order_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,12 +154,12 @@ def build_list_request(reservation_order_id: str, **kwargs: Any) -> HttpRequest: def build_get_request( - reservation_id: str, reservation_order_id: str, *, expand: Optional[str] = None, **kwargs: Any + reservation_order_id: str, reservation_id: str, *, expand: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,8 +168,8 @@ def build_get_request( "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", ) # pylint: disable=line-too-long path_format_arguments = { - "reservationId": _SERIALIZER.url("reservation_id", reservation_id, "str"), "reservationOrderId": _SERIALIZER.url("reservation_order_id", reservation_order_id, "str"), + "reservationId": _SERIALIZER.url("reservation_id", reservation_id, "str"), } _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore @@ -177,7 +177,7 @@ def build_get_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") if expand is not None: - _params["expand"] = _SERIALIZER.query("expand", expand, "str") + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -189,7 +189,7 @@ def build_update_request(reservation_order_id: str, reservation_id: str, **kwarg _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -220,7 +220,7 @@ def build_archive_request(reservation_order_id: str, reservation_id: str, **kwar _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -248,7 +248,7 @@ def build_unarchive_request(reservation_order_id: str, reservation_id: str, **kw _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -272,11 +272,11 @@ def build_unarchive_request(reservation_order_id: str, reservation_id: str, **kw return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_revisions_request(reservation_id: str, reservation_order_id: str, **kwargs: Any) -> HttpRequest: +def build_list_revisions_request(reservation_order_id: str, reservation_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -285,8 +285,8 @@ def build_list_revisions_request(reservation_id: str, reservation_order_id: str, "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/revisions", ) # pylint: disable=line-too-long path_format_arguments = { - "reservationId": _SERIALIZER.url("reservation_id", reservation_id, "str"), "reservationOrderId": _SERIALIZER.url("reservation_order_id", reservation_order_id, "str"), + "reservationId": _SERIALIZER.url("reservation_id", reservation_id, "str"), } _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore @@ -313,7 +313,7 @@ def build_list_all_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -377,7 +377,7 @@ def _available_scopes_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AvailableScopeProperties] = kwargs.pop("cls", None) @@ -437,13 +437,13 @@ def begin_available_scopes( ) -> LROPoller[_models.AvailableScopeProperties]: """Get Available Scopes for ``Reservation``. - Get Available Scopes for ``Reservation``. + Check whether the scopes from request is valid for ``Reservation``. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str - :param body: Required. + :param body: Scopes to be checked for eligibility. Required. :type body: ~azure.mgmt.reservations.models.AvailableScopeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -474,13 +474,13 @@ def begin_available_scopes( ) -> LROPoller[_models.AvailableScopeProperties]: """Get Available Scopes for ``Reservation``. - Get Available Scopes for ``Reservation``. + Check whether the scopes from request is valid for ``Reservation``. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str - :param body: Required. + :param body: Scopes to be checked for eligibility. Required. :type body: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -509,13 +509,14 @@ def begin_available_scopes( ) -> LROPoller[_models.AvailableScopeProperties]: """Get Available Scopes for ``Reservation``. - Get Available Scopes for ``Reservation``. + Check whether the scopes from request is valid for ``Reservation``. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str - :param body: Is either a model type or a IO type. Required. + :param body: Scopes to be checked for eligibility. Is either a model type or a IO type. + Required. :type body: ~azure.mgmt.reservations.models.AvailableScopeRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -536,7 +537,7 @@ def begin_available_scopes( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AvailableScopeProperties] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -595,7 +596,7 @@ def _split_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[List[_models.ReservationResponse]]] = kwargs.pop("cls", None) @@ -632,11 +633,16 @@ def _split_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("[ReservationResponse]", pipeline_response) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized @@ -740,7 +746,7 @@ def begin_split( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[List[_models.ReservationResponse]] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -798,7 +804,7 @@ def _merge_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[List[_models.ReservationResponse]]] = kwargs.pop("cls", None) @@ -835,11 +841,16 @@ def _merge_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("[ReservationResponse]", pipeline_response) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized @@ -946,7 +957,7 @@ def begin_merge( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[List[_models.ReservationResponse]] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1006,7 +1017,7 @@ def list(self, reservation_order_id: str, **kwargs: Any) -> Iterable["_models.Re _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.ReservationList] = kwargs.pop("cls", None) error_map = { @@ -1065,16 +1076,16 @@ def get_next(next_link=None): @distributed_trace def get( - self, reservation_id: str, reservation_order_id: str, expand: Optional[str] = None, **kwargs: Any + self, reservation_order_id: str, reservation_id: str, expand: Optional[str] = None, **kwargs: Any ) -> _models.ReservationResponse: """Get ``Reservation`` details. Get specific ``Reservation`` details. - :param reservation_id: Id of the Reservation Item. Required. - :type reservation_id: str :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str + :param reservation_id: Id of the reservation item. Required. + :type reservation_id: str :param expand: Supported value of this query is renewProperties. Default value is None. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -1093,12 +1104,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.ReservationResponse] = kwargs.pop("cls", None) request = build_get_request( - reservation_id=reservation_id, reservation_order_id=reservation_order_id, + reservation_id=reservation_id, expand=expand, api_version=api_version, template_url=self.get.metadata["url"], @@ -1144,7 +1155,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ReservationResponse]] = kwargs.pop("cls", None) @@ -1182,11 +1193,19 @@ def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("ReservationResponse", pipeline_response) + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized @@ -1210,7 +1229,7 @@ def begin_update( :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str :param parameters: Information needed to patch a reservation item. Required. :type parameters: ~azure.mgmt.reservations.models.Patch @@ -1247,7 +1266,7 @@ def begin_update( :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str :param parameters: Information needed to patch a reservation item. Required. :type parameters: IO @@ -1278,7 +1297,7 @@ def begin_update( :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str :param parameters: Information needed to patch a reservation item. Is either a model type or a IO type. Required. @@ -1302,7 +1321,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ReservationResponse] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1329,7 +1348,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1357,7 +1378,7 @@ def archive( # pylint: disable=inconsistent-return-statements :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) @@ -1375,7 +1396,7 @@ def archive( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_archive_request( @@ -1413,11 +1434,11 @@ def unarchive( # pylint: disable=inconsistent-return-statements ) -> None: """Unarchive a ``Reservation``. - Unarchiving a ``Reservation`` moves it to the state it was before archiving. + Restores a ``Reservation`` to the state it was before archiving. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item. Required. + :param reservation_id: Id of the reservation item. Required. :type reservation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) @@ -1435,7 +1456,7 @@ def unarchive( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_unarchive_request( @@ -1469,16 +1490,16 @@ def unarchive( # pylint: disable=inconsistent-return-statements @distributed_trace def list_revisions( - self, reservation_id: str, reservation_order_id: str, **kwargs: Any + self, reservation_order_id: str, reservation_id: str, **kwargs: Any ) -> Iterable["_models.ReservationResponse"]: """Get ``Reservation`` revisions. List of all the revisions for the ``Reservation``. - :param reservation_id: Id of the Reservation Item. Required. - :type reservation_id: str :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str + :param reservation_id: Id of the reservation item. Required. + :type reservation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReservationResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.reservations.models.ReservationResponse] @@ -1487,7 +1508,7 @@ def list_revisions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.ReservationList] = kwargs.pop("cls", None) error_map = { @@ -1502,8 +1523,8 @@ def prepare_request(next_link=None): if not next_link: request = build_list_revisions_request( - reservation_id=reservation_id, reservation_order_id=reservation_order_id, + reservation_id=reservation_id, api_version=api_version, template_url=self.list_revisions.metadata["url"], headers=_headers, @@ -1564,9 +1585,9 @@ def list_all( :param filter: May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, properties/{appliedScopeType, archived, displayName, - displayProvisioningState, effectiveDateTime, expiryDate, provisioningState, quantity, renew, - reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState}. Default - value is None. + displayProvisioningState, effectiveDateTime, expiryDate, expiryDateTime, provisioningState, + quantity, renew, reservedResourceType, term, userFriendlyAppliedScopeType, + userFriendlyRenewState}. Default value is None. :type filter: str :param orderby: May be used to sort order by reservation properties. Default value is None. :type orderby: str @@ -1588,7 +1609,7 @@ def list_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.ReservationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_reservation_order_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_reservation_order_operations.py index 085c65f341adb..e9015230bf9be 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_reservation_order_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_reservation_order_operations.py @@ -46,7 +46,7 @@ def build_calculate_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -68,7 +68,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +87,7 @@ def build_purchase_request(reservation_order_id: str, **kwargs: Any) -> HttpRequ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -114,7 +114,7 @@ def build_get_request(reservation_order_id: str, *, expand: Optional[str] = None _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +140,7 @@ def build_change_directory_request(reservation_order_id: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -250,7 +250,7 @@ def calculate(self, body: Union[_models.PurchaseRequest, IO], **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CalculatePriceResponse] = kwargs.pop("cls", None) @@ -309,7 +309,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ReservationOrderResponse"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.ReservationOrderList] = kwargs.pop("cls", None) error_map = { @@ -379,7 +379,7 @@ def _purchase_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ReservationOrderResponse] = kwargs.pop("cls", None) @@ -415,14 +415,18 @@ def _purchase_initial( error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("ReservationOrderResponse", pipeline_response) if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("ReservationOrderResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -523,7 +527,7 @@ def begin_purchase( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ReservationOrderResponse] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -595,7 +599,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) cls: ClsType[_models.ReservationOrderResponse] = kwargs.pop("cls", None) request = build_get_request( @@ -711,7 +715,7 @@ def change_directory( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ChangeDirectoryResponse] = kwargs.pop("cls", None) diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_return_operations_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_return_operations_operations.py index a535832781ab1..83fbadec45d97 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_return_operations_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_return_operations_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -19,10 +19,12 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from .._serialization import Serializer @@ -43,7 +45,7 @@ def build_post_request(reservation_order_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -85,18 +87,80 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + def _post_initial( + self, reservation_order_id: str, body: Union[_models.RefundRequest, IO], **kwargs: Any + ) -> _models.RefundResponse: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RefundResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + _json = self._serialize.body(body, "RefundRequest") + + request = build_post_request( + reservation_order_id=reservation_order_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._post_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("RefundResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _post_initial.metadata = {"url": "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return"} + @overload - def post( + def begin_post( self, reservation_order_id: str, body: _models.RefundRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RefundResponse: + ) -> LROPoller[_models.RefundResponse]: """Return a reservation. - Return a reservation. + Return a reservation and get refund information. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str @@ -106,18 +170,26 @@ def post( Default value is "application/json". :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: RefundResponse or the result of cls(response) - :rtype: ~azure.mgmt.reservations.models.RefundResponse + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either RefundResponse or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.reservations.models.RefundResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def post( + def begin_post( self, reservation_order_id: str, body: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RefundResponse: + ) -> LROPoller[_models.RefundResponse]: """Return a reservation. - Return a reservation. + Return a reservation and get refund information. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str @@ -127,18 +199,26 @@ def post( Default value is "application/json". :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: RefundResponse or the result of cls(response) - :rtype: ~azure.mgmt.reservations.models.RefundResponse + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either RefundResponse or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.reservations.models.RefundResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def post( + def begin_post( self, reservation_order_id: str, body: Union[_models.RefundRequest, IO], **kwargs: Any - ) -> _models.RefundResponse: + ) -> LROPoller[_models.RefundResponse]: """Return a reservation. - Return a reservation. + Return a reservation and get refund information. :param reservation_order_id: Order Id of the reservation. Required. :type reservation_order_id: str @@ -149,65 +229,65 @@ def post( Default value is None. :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: RefundResponse or the result of cls(response) - :rtype: ~azure.mgmt.reservations.models.RefundResponse + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either RefundResponse or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.reservations.models.RefundResponse] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + api_version: Literal["2022-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.RefundResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._post_initial( + reservation_order_id=reservation_order_id, + body=body, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("RefundResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - _json = self._serialize.body(body, "RefundRequest") - - request = build_post_request( - reservation_order_id=reservation_order_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.post.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("RefundResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - post.metadata = {"url": "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return"} + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_post.metadata = {"url": "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return"} diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/archive.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/archive.py index 12d28d88189cb..72b6876ec37f5 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/archive.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/archive.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/Archive.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Archive.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/calculate_exchange.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/calculate_exchange.py index 16f3849c0cece..f9e48e7b3d358 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/calculate_exchange.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/calculate_exchange.py @@ -55,12 +55,27 @@ def main(): "sku": {"name": "Standard_B1ls"}, } ], + "savingsPlansToPurchase": [ + { + "properties": { + "appliedScopeProperties": { + "resourceGroupId": "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg" + }, + "appliedScopeType": "Single", + "billingScopeId": "/subscriptions/10000000-0000-0000-0000-000000000000", + "commitment": {"amount": 15.23, "currencyCode": "USD", "grain": "Hourly"}, + "displayName": "ComputeSavingsPlan", + "term": "P1Y", + }, + "sku": {"name": "Compute_Savings_Plan"}, + } + ], } }, ).result() print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/CalculateExchange.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/CalculateExchange.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/calculate_refund.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/calculate_refund.py index db3419bb29904..93aa685f4f8de 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/calculate_refund.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/calculate_refund.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/CalculateRefund.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/CalculateRefund.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/calculate_reservation_order.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/calculate_reservation_order.py index eba871dd01fd9..ab798f14b78b3 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/calculate_reservation_order.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/calculate_reservation_order.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/CalculateReservationOrder.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/CalculateReservationOrder.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/change_directory_reservation_order.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/change_directory_reservation_order.py index 9c4ccffb38490..ea186f527d7f3 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/change_directory_reservation_order.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/change_directory_reservation_order.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/ChangeDirectoryReservationOrder.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ChangeDirectoryReservationOrder.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/exchange.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/exchange.py index ffead6407fb09..06330f0efa39c 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/exchange.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/exchange.py @@ -34,6 +34,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/Exchange.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Exchange.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_applied_reservations.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_applied_reservations.py index 343e1956615a4..47a4ed365fcca 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_applied_reservations.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_applied_reservations.py @@ -34,6 +34,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetAppliedReservations.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetAppliedReservations.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_available_scope.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_available_scope.py index 21c2011c642e3..3e04d4091f7de 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_available_scope.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_available_scope.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetAvailableScope.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetAvailableScope.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_catalog.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_catalog.py index e757bf86e9ae4..175fb88823561 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_catalog.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_catalog.py @@ -31,9 +31,10 @@ def main(): response = client.get_catalog( subscription_id="23bc208b-083f-4901-ae85-4f98c0c3b4b6", ) - print(response) + for item in response: + print(item) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetCatalog.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetCatalog.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_operations.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_operations.py index 7ca68a923df1c..231e0b8f9c652 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_operations.py @@ -33,6 +33,6 @@ def main(): print(item) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetOperations.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetOperations.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_details.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_details.py index d6306e33fcdd1..8f9343cbad943 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_details.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_details.py @@ -29,12 +29,12 @@ def main(): ) response = client.reservation.get( - reservation_id="6ef59113-3482-40da-8d79-787f823e34bc", reservation_order_id="276e7ae4-84d0-4da6-ab4b-d6b94f3557da", + reservation_id="6ef59113-3482-40da-8d79-787f823e34bc", ) print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservationDetails.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationDetails.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_order_details.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_order_details.py index 6a4007d2258e3..26cf37d6d3c31 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_order_details.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_order_details.py @@ -34,6 +34,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservationOrderDetails.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationOrderDetails.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_order_details_with_expand_plan_information.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_order_details_with_expand_plan_information.py index cc276b75bc03e..8890ff2de9901 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_order_details_with_expand_plan_information.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_order_details_with_expand_plan_information.py @@ -34,6 +34,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservationOrderDetailsWithExpandPlanInformation.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationOrderDetailsWithExpandPlanInformation.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_orders.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_orders.py index db43642aee9c4..e77ec60f450a2 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_orders.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_orders.py @@ -33,6 +33,6 @@ def main(): print(item) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservationOrders.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationOrders.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_revisions.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_revisions.py index 5382ef932ca20..93de7e0bac0b4 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_revisions.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservation_revisions.py @@ -29,13 +29,13 @@ def main(): ) response = client.reservation.list_revisions( - reservation_id="6ef59113-3482-40da-8d79-787f823e34bc", reservation_order_id="276e7ae4-84d0-4da6-ab4b-d6b94f3557da", + reservation_id="6ef59113-3482-40da-8d79-787f823e34bc", ) for item in response: print(item) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservationRevisions.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationRevisions.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservations.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservations.py index 159661f700f7d..5f98fcaa6efbd 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservations.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservations.py @@ -33,6 +33,6 @@ def main(): print(item) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservations.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservations.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservations_from_order.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservations_from_order.py index cae7546e9385d..59c758aac557a 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservations_from_order.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/get_reservations_from_order.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservationsFromOrder.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationsFromOrder.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/merge_reservations.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/merge_reservations.py index b27110f7be6cb..9c21137aa0485 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/merge_reservations.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/merge_reservations.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/MergeReservations.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/MergeReservations.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/purchase_reservation_order.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/purchase_reservation_order.py index 6e50238489765..b3b2ad0b0e62d 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/purchase_reservation_order.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/purchase_reservation_order.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/PurchaseReservationOrder.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/PurchaseReservationOrder.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/return.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/return.py index 4eac73fbaf250..8fae4a796a446 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/return.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/return.py @@ -28,8 +28,8 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.return_operations.post( - reservation_order_id="276e7ae4-84d0-4da6-ab4b-d6b94f3557da", + response = client.return_operations.begin_post( + reservation_order_id="50000000-aaaa-bbbb-cccc-100000000004", body={ "properties": { "reservationToReturn": { @@ -41,10 +41,10 @@ def main(): "sessionId": "10000000-aaaa-bbbb-cccc-200000000000", } }, - ) + ).result() print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/Return.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Return.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/split_reservation.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/split_reservation.py index 11effdf3af95b..f27cf34b64231 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/split_reservation.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/split_reservation.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/SplitReservation.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/SplitReservation.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/unarchive.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/unarchive.py index 1a42bb9e804f9..87e76952bf14f 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/unarchive.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/unarchive.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/Unarchive.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Unarchive.json if __name__ == "__main__": main() diff --git a/sdk/reservations/azure-mgmt-reservations/generated_samples/update_reservation.py b/sdk/reservations/azure-mgmt-reservations/generated_samples/update_reservation.py index a4b0517423df0..3f694f7548b0a 100644 --- a/sdk/reservations/azure-mgmt-reservations/generated_samples/update_reservation.py +++ b/sdk/reservations/azure-mgmt-reservations/generated_samples/update_reservation.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/UpdateReservation.json +# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/UpdateReservation.json if __name__ == "__main__": main()