From 362de0cd77d01a0acf75e16d37e005c16f672e25 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot Date: Fri, 4 Oct 2019 11:02:08 +0800 Subject: [PATCH] [AutoPR] reservations/resource-manager (#7569) * [AutoPR reservations/resource-manager] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#7251) * Generated from f19a2e5b7f384018b74b21b7b8b8782d95b456f9 fixed x-ms-enum value * Generated from 2f56008117d578bec6cc8b8c832926f45a0fe52e fixed catalog definition * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * added version and history --- .../azure-mgmt-reservations/HISTORY.rst | 16 ++ .../mgmt/reservations/models/__init__.py | 16 ++ .../models/_azure_reservation_api_enums.py | 14 ++ .../azure/mgmt/reservations/models/_models.py | 150 ++++++++++++++++ .../mgmt/reservations/models/_models_py3.py | 160 +++++++++++++++++- .../_azure_reservation_api_operations.py | 3 +- .../operations/_reservation_operations.py | 4 +- .../_reservation_order_operations.py | 6 +- .../azure/mgmt/reservations/version.py | 2 +- 9 files changed, 361 insertions(+), 10 deletions(-) diff --git a/sdk/reservations/azure-mgmt-reservations/HISTORY.rst b/sdk/reservations/azure-mgmt-reservations/HISTORY.rst index 16caa0b80091..d5442a3da98e 100644 --- a/sdk/reservations/azure-mgmt-reservations/HISTORY.rst +++ b/sdk/reservations/azure-mgmt-reservations/HISTORY.rst @@ -3,6 +3,22 @@ Release History =============== +0.5.0 (2019-10-04) +++++++++++++++++++ + +**Features** + +- Model ReservationProperties has a new parameter billing_plan +- Model CalculatePriceResponseProperties has a new parameter payment_schedule +- Model ReservationOrderResponse has a new parameter plan_information +- Model ReservationOrderResponse has a new parameter billing_plan +- Model Catalog has a new parameter billing_plans +- Model PurchaseRequest has a new parameter billing_plan + +**Breaking changes** + +- Operation ReservationOrderOperations.get has a new signature + 0.4.0 (2019-09-09) ++++++++++++++++++ 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 c84f41407bff..26dff26dac86 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 @@ -17,6 +17,7 @@ from ._models_py3 import CalculatePriceResponsePropertiesBillingCurrencyTotal from ._models_py3 import CalculatePriceResponsePropertiesPricingCurrencyTotal from ._models_py3 import Catalog + from ._models_py3 import CatalogBillingPlansItem from ._models_py3 import Error, ErrorException from ._models_py3 import ExtendedErrorInfo from ._models_py3 import ExtendedStatusInfo @@ -25,6 +26,8 @@ from ._models_py3 import OperationResponse from ._models_py3 import Patch from ._models_py3 import PatchPropertiesRenewProperties + from ._models_py3 import PaymentDetail + from ._models_py3 import Price from ._models_py3 import Properties from ._models_py3 import PurchaseRequest from ._models_py3 import PurchaseRequestPropertiesReservedResourceProperties @@ -32,6 +35,7 @@ from ._models_py3 import RenewPropertiesResponseBillingCurrencyTotal from ._models_py3 import RenewPropertiesResponsePricingCurrencyTotal from ._models_py3 import ReservationMergeProperties + from ._models_py3 import ReservationOrderBillingPlanInformation from ._models_py3 import ReservationOrderResponse from ._models_py3 import ReservationProperties from ._models_py3 import ReservationResponse @@ -50,6 +54,7 @@ from ._models import CalculatePriceResponsePropertiesBillingCurrencyTotal from ._models import CalculatePriceResponsePropertiesPricingCurrencyTotal from ._models import Catalog + from ._models import CatalogBillingPlansItem from ._models import Error, ErrorException from ._models import ExtendedErrorInfo from ._models import ExtendedStatusInfo @@ -58,6 +63,8 @@ from ._models import OperationResponse from ._models import Patch from ._models import PatchPropertiesRenewProperties + from ._models import PaymentDetail + from ._models import Price from ._models import Properties from ._models import PurchaseRequest from ._models import PurchaseRequestPropertiesReservedResourceProperties @@ -65,6 +72,7 @@ from ._models import RenewPropertiesResponseBillingCurrencyTotal from ._models import RenewPropertiesResponsePricingCurrencyTotal from ._models import ReservationMergeProperties + from ._models import ReservationOrderBillingPlanInformation from ._models import ReservationOrderResponse from ._models import ReservationProperties from ._models import ReservationResponse @@ -81,7 +89,9 @@ from ._azure_reservation_api_enums import ( ReservationStatusCode, ErrorResponseCode, + ReservationBillingPlan, ReservationTerm, + PaymentStatus, ReservedResourceType, InstanceFlexibility, AppliedScopeType, @@ -95,6 +105,7 @@ 'CalculatePriceResponsePropertiesBillingCurrencyTotal', 'CalculatePriceResponsePropertiesPricingCurrencyTotal', 'Catalog', + 'CatalogBillingPlansItem', 'Error', 'ErrorException', 'ExtendedErrorInfo', 'ExtendedStatusInfo', @@ -103,6 +114,8 @@ 'OperationResponse', 'Patch', 'PatchPropertiesRenewProperties', + 'PaymentDetail', + 'Price', 'Properties', 'PurchaseRequest', 'PurchaseRequestPropertiesReservedResourceProperties', @@ -110,6 +123,7 @@ 'RenewPropertiesResponseBillingCurrencyTotal', 'RenewPropertiesResponsePricingCurrencyTotal', 'ReservationMergeProperties', + 'ReservationOrderBillingPlanInformation', 'ReservationOrderResponse', 'ReservationProperties', 'ReservationResponse', @@ -125,7 +139,9 @@ 'OperationResponsePaged', 'ReservationStatusCode', 'ErrorResponseCode', + 'ReservationBillingPlan', 'ReservationTerm', + 'PaymentStatus', 'ReservedResourceType', 'InstanceFlexibility', 'AppliedScopeType', 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 90602e0ba6df..1f5afb6042f4 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 @@ -84,12 +84,26 @@ class ErrorResponseCode(str, Enum): calculate_price_failed = "CalculatePriceFailed" +class ReservationBillingPlan(str, Enum): + + upfront = "Upfront" + monthly = "Monthly" + + class ReservationTerm(str, Enum): p1_y = "P1Y" p3_y = "P3Y" +class PaymentStatus(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + scheduled = "Scheduled" + cancelled = "Cancelled" + + class ReservedResourceType(str, Enum): virtual_machines = "VirtualMachines" diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models.py index adddc3a84f61..e18fb68f9786 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models.py @@ -109,6 +109,9 @@ class CalculatePriceResponseProperties(Model): during refund for calculating refund limit. Tax is not included. :type pricing_currency_total: ~azure.mgmt.reservations.models.CalculatePriceResponsePropertiesPricingCurrencyTotal + :param payment_schedule: + :type payment_schedule: + list[~azure.mgmt.reservations.models.PaymentDetail] """ _attribute_map = { @@ -118,6 +121,7 @@ class CalculatePriceResponseProperties(Model): 'sku_title': {'key': 'skuTitle', 'type': 'str'}, 'sku_description': {'key': 'skuDescription', 'type': 'str'}, 'pricing_currency_total': {'key': 'pricingCurrencyTotal', 'type': 'CalculatePriceResponsePropertiesPricingCurrencyTotal'}, + 'payment_schedule': {'key': 'paymentSchedule', 'type': '[PaymentDetail]'}, } def __init__(self, **kwargs): @@ -128,6 +132,7 @@ def __init__(self, **kwargs): self.sku_title = kwargs.get('sku_title', None) self.sku_description = kwargs.get('sku_description', None) self.pricing_currency_total = kwargs.get('pricing_currency_total', None) + self.payment_schedule = kwargs.get('payment_schedule', None) class CalculatePriceResponsePropertiesBillingCurrencyTotal(Model): @@ -182,6 +187,9 @@ class Catalog(Model): :vartype resource_type: str :ivar name: The name of SKU :vartype name: str + :param billing_plans: The billing plan options available for this SKU. + :type billing_plans: + list[~azure.mgmt.reservations.models.CatalogBillingPlansItem] :ivar terms: Available reservation terms for this resource :vartype terms: list[str or ~azure.mgmt.reservations.models.ReservationTerm] @@ -206,6 +214,7 @@ class Catalog(Model): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'billing_plans': {'key': 'billingPlans', 'type': '[CatalogBillingPlansItem]'}, 'terms': {'key': 'terms', 'type': '[str]'}, 'locations': {'key': 'locations', 'type': '[str]'}, 'sku_properties': {'key': 'skuProperties', 'type': '[SkuProperty]'}, @@ -216,12 +225,36 @@ def __init__(self, **kwargs): super(Catalog, self).__init__(**kwargs) self.resource_type = None self.name = None + self.billing_plans = kwargs.get('billing_plans', None) self.terms = None self.locations = None self.sku_properties = None self.restrictions = None +class CatalogBillingPlansItem(Model): + """CatalogBillingPlansItem. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, list[str or + ~azure.mgmt.reservations.models.ReservationBillingPlan]] + :param name: The term for the billing SKU is available for. Possible + values include: 'P1Y', 'P3Y' + :type name: str or ~azure.mgmt.reservations.models.ReservationTerm + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{[str]}'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CatalogBillingPlansItem, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.name = kwargs.get('name', None) + + class CloudError(Model): """CloudError. """ @@ -451,6 +484,73 @@ def __init__(self, **kwargs): self.purchase_properties = kwargs.get('purchase_properties', None) +class PaymentDetail(Model): + """Information about payment related to a reservation order. + + :param due_date: Date when the payment needs to be done. + :type due_date: date + :param payment_date: Date when the transaction is completed. Is null when + it is scheduled. + :type payment_date: date + :param pricing_currency_total: Amount in pricing currency. Tax not + included. + :type pricing_currency_total: ~azure.mgmt.reservations.models.Price + :param billing_currency_total: Amount charged in Billing currency. Tax not + included. Is null for future payments + :type billing_currency_total: ~azure.mgmt.reservations.models.Price + :param billing_account: Shows the Account that is charged for this + payment. + :type billing_account: str + :param status: Possible values include: 'Succeeded', 'Failed', + 'Scheduled', 'Cancelled' + :type status: str or ~azure.mgmt.reservations.models.PaymentStatus + :param extended_status_info: + :type extended_status_info: + ~azure.mgmt.reservations.models.ExtendedStatusInfo + """ + + _attribute_map = { + 'due_date': {'key': 'dueDate', 'type': 'date'}, + 'payment_date': {'key': 'paymentDate', 'type': 'date'}, + 'pricing_currency_total': {'key': 'pricingCurrencyTotal', 'type': 'Price'}, + 'billing_currency_total': {'key': 'billingCurrencyTotal', 'type': 'Price'}, + 'billing_account': {'key': 'billingAccount', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'extended_status_info': {'key': 'extendedStatusInfo', 'type': 'ExtendedStatusInfo'}, + } + + def __init__(self, **kwargs): + super(PaymentDetail, self).__init__(**kwargs) + self.due_date = kwargs.get('due_date', None) + self.payment_date = kwargs.get('payment_date', None) + self.pricing_currency_total = kwargs.get('pricing_currency_total', None) + self.billing_currency_total = kwargs.get('billing_currency_total', None) + self.billing_account = kwargs.get('billing_account', None) + self.status = kwargs.get('status', None) + self.extended_status_info = kwargs.get('extended_status_info', None) + + +class Price(Model): + """Price. + + :param currency_code: The ISO 4217 3-letter currency code for the currency + used by this purchase record. + :type currency_code: str + :param amount: + :type amount: float + """ + + _attribute_map = { + 'currency_code': {'key': 'currencyCode', 'type': 'str'}, + 'amount': {'key': 'amount', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(Price, self).__init__(**kwargs) + self.currency_code = kwargs.get('currency_code', None) + self.amount = kwargs.get('amount', None) + + class Properties(Model): """Properties. @@ -484,6 +584,9 @@ class PurchaseRequest(Model): :type billing_scope_id: str :param term: Possible values include: 'P1Y', 'P3Y' :type term: str or ~azure.mgmt.reservations.models.ReservationTerm + :param billing_plan: Possible values include: 'Upfront', 'Monthly' + :type billing_plan: str or + ~azure.mgmt.reservations.models.ReservationBillingPlan :param quantity: :type quantity: int :param display_name: Friendly name of the Reservation @@ -507,6 +610,7 @@ class PurchaseRequest(Model): 'reserved_resource_type': {'key': 'properties.reservedResourceType', 'type': 'str'}, 'billing_scope_id': {'key': 'properties.billingScopeId', 'type': 'str'}, 'term': {'key': 'properties.term', 'type': 'str'}, + 'billing_plan': {'key': 'properties.billingPlan', 'type': 'str'}, 'quantity': {'key': 'properties.quantity', 'type': 'int'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'applied_scope_type': {'key': 'properties.appliedScopeType', 'type': 'str'}, @@ -522,6 +626,7 @@ def __init__(self, **kwargs): self.reserved_resource_type = kwargs.get('reserved_resource_type', None) self.billing_scope_id = kwargs.get('billing_scope_id', None) self.term = kwargs.get('term', None) + self.billing_plan = kwargs.get('billing_plan', None) self.quantity = kwargs.get('quantity', None) self.display_name = kwargs.get('display_name', None) self.applied_scope_type = kwargs.get('applied_scope_type', None) @@ -645,6 +750,36 @@ def __init__(self, **kwargs): self.merge_sources = kwargs.get('merge_sources', None) +class ReservationOrderBillingPlanInformation(Model): + """Information describing the type of billing plan for this reservation. + + :param pricing_currency_total: Amount of money to be paid for the Order. + Tax is not included. + :type pricing_currency_total: ~azure.mgmt.reservations.models.Price + :param start_date: Date when the billing plan has started. + :type start_date: date + :param next_payment_due_date: For recurring billing plans, indicates the + date when next payment will be processed. Null when total is paid off. + :type next_payment_due_date: date + :param transactions: + :type transactions: list[~azure.mgmt.reservations.models.PaymentDetail] + """ + + _attribute_map = { + 'pricing_currency_total': {'key': 'pricingCurrencyTotal', 'type': 'Price'}, + 'start_date': {'key': 'startDate', 'type': 'date'}, + 'next_payment_due_date': {'key': 'nextPaymentDueDate', 'type': 'date'}, + 'transactions': {'key': 'transactions', 'type': '[PaymentDetail]'}, + } + + def __init__(self, **kwargs): + super(ReservationOrderBillingPlanInformation, self).__init__(**kwargs) + self.pricing_currency_total = kwargs.get('pricing_currency_total', None) + self.start_date = kwargs.get('start_date', None) + self.next_payment_due_date = kwargs.get('next_payment_due_date', None) + self.transactions = kwargs.get('transactions', None) + + class ReservationOrderResponse(Model): """ReservationOrderResponse. @@ -674,6 +809,12 @@ class ReservationOrderResponse(Model): :type term: str or ~azure.mgmt.reservations.models.ReservationTerm :param provisioning_state: Current state of the reservation. :type provisioning_state: str + :param billing_plan: Possible values include: 'Upfront', 'Monthly' + :type billing_plan: str or + ~azure.mgmt.reservations.models.ReservationBillingPlan + :param plan_information: + :type plan_information: + ~azure.mgmt.reservations.models.ReservationOrderBillingPlanInformation :param reservations: :type reservations: list[~azure.mgmt.reservations.models.ReservationResponse] @@ -698,6 +839,8 @@ class ReservationOrderResponse(Model): 'original_quantity': {'key': 'properties.originalQuantity', 'type': 'int'}, 'term': {'key': 'properties.term', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'billing_plan': {'key': 'properties.billingPlan', 'type': 'str'}, + 'plan_information': {'key': 'properties.planInformation', 'type': 'ReservationOrderBillingPlanInformation'}, 'reservations': {'key': 'properties.reservations', 'type': '[ReservationResponse]'}, 'type': {'key': 'type', 'type': 'str'}, } @@ -714,6 +857,8 @@ def __init__(self, **kwargs): self.original_quantity = kwargs.get('original_quantity', None) self.term = kwargs.get('term', None) self.provisioning_state = kwargs.get('provisioning_state', None) + self.billing_plan = kwargs.get('billing_plan', None) + self.plan_information = kwargs.get('plan_information', None) self.reservations = kwargs.get('reservations', None) self.type = None @@ -757,6 +902,9 @@ class ReservationProperties(Model): :param extended_status_info: :type extended_status_info: ~azure.mgmt.reservations.models.ExtendedStatusInfo + :param billing_plan: Possible values include: 'Upfront', 'Monthly' + :type billing_plan: str or + ~azure.mgmt.reservations.models.ReservationBillingPlan :param split_properties: :type split_properties: ~azure.mgmt.reservations.models.ReservationSplitProperties @@ -799,6 +947,7 @@ class ReservationProperties(Model): 'expiry_date': {'key': 'expiryDate', 'type': 'date'}, 'sku_description': {'key': 'skuDescription', 'type': 'str'}, 'extended_status_info': {'key': 'extendedStatusInfo', 'type': 'ExtendedStatusInfo'}, + 'billing_plan': {'key': 'billingPlan', 'type': 'str'}, 'split_properties': {'key': 'splitProperties', 'type': 'ReservationSplitProperties'}, 'merge_properties': {'key': 'mergeProperties', 'type': 'ReservationMergeProperties'}, 'billing_scope_id': {'key': 'billingScopeId', 'type': 'str'}, @@ -823,6 +972,7 @@ def __init__(self, **kwargs): self.expiry_date = kwargs.get('expiry_date', None) self.sku_description = kwargs.get('sku_description', None) self.extended_status_info = kwargs.get('extended_status_info', None) + self.billing_plan = kwargs.get('billing_plan', None) self.split_properties = kwargs.get('split_properties', None) self.merge_properties = kwargs.get('merge_properties', None) self.billing_scope_id = kwargs.get('billing_scope_id', None) 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 2e5a69a1d141..af871bedb7bd 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 @@ -109,6 +109,9 @@ class CalculatePriceResponseProperties(Model): during refund for calculating refund limit. Tax is not included. :type pricing_currency_total: ~azure.mgmt.reservations.models.CalculatePriceResponsePropertiesPricingCurrencyTotal + :param payment_schedule: + :type payment_schedule: + list[~azure.mgmt.reservations.models.PaymentDetail] """ _attribute_map = { @@ -118,9 +121,10 @@ class CalculatePriceResponseProperties(Model): 'sku_title': {'key': 'skuTitle', 'type': 'str'}, 'sku_description': {'key': 'skuDescription', 'type': 'str'}, 'pricing_currency_total': {'key': 'pricingCurrencyTotal', 'type': 'CalculatePriceResponsePropertiesPricingCurrencyTotal'}, + 'payment_schedule': {'key': 'paymentSchedule', 'type': '[PaymentDetail]'}, } - def __init__(self, *, billing_currency_total=None, is_billing_partner_managed: bool=None, reservation_order_id: str=None, sku_title: str=None, sku_description: str=None, pricing_currency_total=None, **kwargs) -> None: + def __init__(self, *, billing_currency_total=None, is_billing_partner_managed: bool=None, reservation_order_id: str=None, sku_title: str=None, sku_description: str=None, pricing_currency_total=None, payment_schedule=None, **kwargs) -> None: super(CalculatePriceResponseProperties, self).__init__(**kwargs) self.billing_currency_total = billing_currency_total self.is_billing_partner_managed = is_billing_partner_managed @@ -128,6 +132,7 @@ def __init__(self, *, billing_currency_total=None, is_billing_partner_managed: b self.sku_title = sku_title self.sku_description = sku_description self.pricing_currency_total = pricing_currency_total + self.payment_schedule = payment_schedule class CalculatePriceResponsePropertiesBillingCurrencyTotal(Model): @@ -182,6 +187,9 @@ class Catalog(Model): :vartype resource_type: str :ivar name: The name of SKU :vartype name: str + :param billing_plans: The billing plan options available for this SKU. + :type billing_plans: + list[~azure.mgmt.reservations.models.CatalogBillingPlansItem] :ivar terms: Available reservation terms for this resource :vartype terms: list[str or ~azure.mgmt.reservations.models.ReservationTerm] @@ -206,22 +214,47 @@ class Catalog(Model): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'billing_plans': {'key': 'billingPlans', 'type': '[CatalogBillingPlansItem]'}, 'terms': {'key': 'terms', 'type': '[str]'}, 'locations': {'key': 'locations', 'type': '[str]'}, 'sku_properties': {'key': 'skuProperties', 'type': '[SkuProperty]'}, 'restrictions': {'key': 'restrictions', 'type': '[SkuRestriction]'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, billing_plans=None, **kwargs) -> None: super(Catalog, self).__init__(**kwargs) self.resource_type = None self.name = None + self.billing_plans = billing_plans self.terms = None self.locations = None self.sku_properties = None self.restrictions = None +class CatalogBillingPlansItem(Model): + """CatalogBillingPlansItem. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, list[str or + ~azure.mgmt.reservations.models.ReservationBillingPlan]] + :param name: The term for the billing SKU is available for. Possible + values include: 'P1Y', 'P3Y' + :type name: str or ~azure.mgmt.reservations.models.ReservationTerm + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{[str]}'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, additional_properties=None, name=None, **kwargs) -> None: + super(CatalogBillingPlansItem, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.name = name + + class CloudError(Model): """CloudError. """ @@ -451,6 +484,73 @@ def __init__(self, *, purchase_properties=None, **kwargs) -> None: self.purchase_properties = purchase_properties +class PaymentDetail(Model): + """Information about payment related to a reservation order. + + :param due_date: Date when the payment needs to be done. + :type due_date: date + :param payment_date: Date when the transaction is completed. Is null when + it is scheduled. + :type payment_date: date + :param pricing_currency_total: Amount in pricing currency. Tax not + included. + :type pricing_currency_total: ~azure.mgmt.reservations.models.Price + :param billing_currency_total: Amount charged in Billing currency. Tax not + included. Is null for future payments + :type billing_currency_total: ~azure.mgmt.reservations.models.Price + :param billing_account: Shows the Account that is charged for this + payment. + :type billing_account: str + :param status: Possible values include: 'Succeeded', 'Failed', + 'Scheduled', 'Cancelled' + :type status: str or ~azure.mgmt.reservations.models.PaymentStatus + :param extended_status_info: + :type extended_status_info: + ~azure.mgmt.reservations.models.ExtendedStatusInfo + """ + + _attribute_map = { + 'due_date': {'key': 'dueDate', 'type': 'date'}, + 'payment_date': {'key': 'paymentDate', 'type': 'date'}, + 'pricing_currency_total': {'key': 'pricingCurrencyTotal', 'type': 'Price'}, + 'billing_currency_total': {'key': 'billingCurrencyTotal', 'type': 'Price'}, + 'billing_account': {'key': 'billingAccount', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'extended_status_info': {'key': 'extendedStatusInfo', 'type': 'ExtendedStatusInfo'}, + } + + def __init__(self, *, due_date=None, payment_date=None, pricing_currency_total=None, billing_currency_total=None, billing_account: str=None, status=None, extended_status_info=None, **kwargs) -> None: + super(PaymentDetail, self).__init__(**kwargs) + self.due_date = due_date + self.payment_date = payment_date + self.pricing_currency_total = pricing_currency_total + self.billing_currency_total = billing_currency_total + self.billing_account = billing_account + self.status = status + self.extended_status_info = extended_status_info + + +class Price(Model): + """Price. + + :param currency_code: The ISO 4217 3-letter currency code for the currency + used by this purchase record. + :type currency_code: str + :param amount: + :type amount: float + """ + + _attribute_map = { + 'currency_code': {'key': 'currencyCode', 'type': 'str'}, + 'amount': {'key': 'amount', 'type': 'float'}, + } + + def __init__(self, *, currency_code: str=None, amount: float=None, **kwargs) -> None: + super(Price, self).__init__(**kwargs) + self.currency_code = currency_code + self.amount = amount + + class Properties(Model): """Properties. @@ -484,6 +584,9 @@ class PurchaseRequest(Model): :type billing_scope_id: str :param term: Possible values include: 'P1Y', 'P3Y' :type term: str or ~azure.mgmt.reservations.models.ReservationTerm + :param billing_plan: Possible values include: 'Upfront', 'Monthly' + :type billing_plan: str or + ~azure.mgmt.reservations.models.ReservationBillingPlan :param quantity: :type quantity: int :param display_name: Friendly name of the Reservation @@ -507,6 +610,7 @@ class PurchaseRequest(Model): 'reserved_resource_type': {'key': 'properties.reservedResourceType', 'type': 'str'}, 'billing_scope_id': {'key': 'properties.billingScopeId', 'type': 'str'}, 'term': {'key': 'properties.term', 'type': 'str'}, + 'billing_plan': {'key': 'properties.billingPlan', 'type': 'str'}, 'quantity': {'key': 'properties.quantity', 'type': 'int'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'applied_scope_type': {'key': 'properties.appliedScopeType', 'type': 'str'}, @@ -515,13 +619,14 @@ class PurchaseRequest(Model): 'reserved_resource_properties': {'key': 'properties.reservedResourceProperties', 'type': 'PurchaseRequestPropertiesReservedResourceProperties'}, } - def __init__(self, *, sku=None, location: str=None, reserved_resource_type=None, billing_scope_id: str=None, term=None, quantity: int=None, display_name: str=None, applied_scope_type=None, applied_scopes=None, renew: bool=None, reserved_resource_properties=None, **kwargs) -> None: + def __init__(self, *, sku=None, location: str=None, reserved_resource_type=None, billing_scope_id: str=None, term=None, billing_plan=None, quantity: int=None, display_name: str=None, applied_scope_type=None, applied_scopes=None, renew: bool=None, reserved_resource_properties=None, **kwargs) -> None: super(PurchaseRequest, self).__init__(**kwargs) self.sku = sku self.location = location self.reserved_resource_type = reserved_resource_type self.billing_scope_id = billing_scope_id self.term = term + self.billing_plan = billing_plan self.quantity = quantity self.display_name = display_name self.applied_scope_type = applied_scope_type @@ -645,6 +750,36 @@ def __init__(self, *, merge_destination: str=None, merge_sources=None, **kwargs) self.merge_sources = merge_sources +class ReservationOrderBillingPlanInformation(Model): + """Information describing the type of billing plan for this reservation. + + :param pricing_currency_total: Amount of money to be paid for the Order. + Tax is not included. + :type pricing_currency_total: ~azure.mgmt.reservations.models.Price + :param start_date: Date when the billing plan has started. + :type start_date: date + :param next_payment_due_date: For recurring billing plans, indicates the + date when next payment will be processed. Null when total is paid off. + :type next_payment_due_date: date + :param transactions: + :type transactions: list[~azure.mgmt.reservations.models.PaymentDetail] + """ + + _attribute_map = { + 'pricing_currency_total': {'key': 'pricingCurrencyTotal', 'type': 'Price'}, + 'start_date': {'key': 'startDate', 'type': 'date'}, + 'next_payment_due_date': {'key': 'nextPaymentDueDate', 'type': 'date'}, + 'transactions': {'key': 'transactions', 'type': '[PaymentDetail]'}, + } + + def __init__(self, *, pricing_currency_total=None, start_date=None, next_payment_due_date=None, transactions=None, **kwargs) -> None: + super(ReservationOrderBillingPlanInformation, self).__init__(**kwargs) + self.pricing_currency_total = pricing_currency_total + self.start_date = start_date + self.next_payment_due_date = next_payment_due_date + self.transactions = transactions + + class ReservationOrderResponse(Model): """ReservationOrderResponse. @@ -674,6 +809,12 @@ class ReservationOrderResponse(Model): :type term: str or ~azure.mgmt.reservations.models.ReservationTerm :param provisioning_state: Current state of the reservation. :type provisioning_state: str + :param billing_plan: Possible values include: 'Upfront', 'Monthly' + :type billing_plan: str or + ~azure.mgmt.reservations.models.ReservationBillingPlan + :param plan_information: + :type plan_information: + ~azure.mgmt.reservations.models.ReservationOrderBillingPlanInformation :param reservations: :type reservations: list[~azure.mgmt.reservations.models.ReservationResponse] @@ -698,11 +839,13 @@ class ReservationOrderResponse(Model): 'original_quantity': {'key': 'properties.originalQuantity', 'type': 'int'}, 'term': {'key': 'properties.term', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'billing_plan': {'key': 'properties.billingPlan', 'type': 'str'}, + 'plan_information': {'key': 'properties.planInformation', 'type': 'ReservationOrderBillingPlanInformation'}, 'reservations': {'key': 'properties.reservations', 'type': '[ReservationResponse]'}, 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, etag: int=None, display_name: str=None, request_date_time=None, created_date_time=None, expiry_date=None, original_quantity: int=None, term=None, provisioning_state: str=None, reservations=None, **kwargs) -> None: + def __init__(self, *, etag: int=None, display_name: str=None, request_date_time=None, created_date_time=None, expiry_date=None, original_quantity: int=None, term=None, provisioning_state: str=None, billing_plan=None, plan_information=None, reservations=None, **kwargs) -> None: super(ReservationOrderResponse, self).__init__(**kwargs) self.etag = etag self.id = None @@ -714,6 +857,8 @@ def __init__(self, *, etag: int=None, display_name: str=None, request_date_time= self.original_quantity = original_quantity self.term = term self.provisioning_state = provisioning_state + self.billing_plan = billing_plan + self.plan_information = plan_information self.reservations = reservations self.type = None @@ -757,6 +902,9 @@ class ReservationProperties(Model): :param extended_status_info: :type extended_status_info: ~azure.mgmt.reservations.models.ExtendedStatusInfo + :param billing_plan: Possible values include: 'Upfront', 'Monthly' + :type billing_plan: str or + ~azure.mgmt.reservations.models.ReservationBillingPlan :param split_properties: :type split_properties: ~azure.mgmt.reservations.models.ReservationSplitProperties @@ -799,6 +947,7 @@ class ReservationProperties(Model): 'expiry_date': {'key': 'expiryDate', 'type': 'date'}, 'sku_description': {'key': 'skuDescription', 'type': 'str'}, 'extended_status_info': {'key': 'extendedStatusInfo', 'type': 'ExtendedStatusInfo'}, + 'billing_plan': {'key': 'billingPlan', 'type': 'str'}, 'split_properties': {'key': 'splitProperties', 'type': 'ReservationSplitProperties'}, 'merge_properties': {'key': 'mergeProperties', 'type': 'ReservationMergeProperties'}, 'billing_scope_id': {'key': 'billingScopeId', 'type': 'str'}, @@ -809,7 +958,7 @@ class ReservationProperties(Model): 'term': {'key': 'term', 'type': 'str'}, } - def __init__(self, *, reserved_resource_type=None, instance_flexibility=None, display_name: str=None, applied_scopes=None, applied_scope_type=None, quantity: int=None, provisioning_state: str=None, effective_date_time=None, expiry_date=None, sku_description: str=None, extended_status_info=None, split_properties=None, merge_properties=None, billing_scope_id: str=None, renew: bool=None, renew_source: str=None, renew_destination: str=None, renew_properties=None, term=None, **kwargs) -> None: + def __init__(self, *, reserved_resource_type=None, instance_flexibility=None, display_name: str=None, applied_scopes=None, applied_scope_type=None, quantity: int=None, provisioning_state: str=None, effective_date_time=None, expiry_date=None, sku_description: str=None, extended_status_info=None, billing_plan=None, split_properties=None, merge_properties=None, billing_scope_id: str=None, renew: bool=None, renew_source: str=None, renew_destination: str=None, renew_properties=None, term=None, **kwargs) -> None: super(ReservationProperties, self).__init__(**kwargs) self.reserved_resource_type = reserved_resource_type self.instance_flexibility = instance_flexibility @@ -823,6 +972,7 @@ def __init__(self, *, reserved_resource_type=None, instance_flexibility=None, di self.expiry_date = expiry_date self.sku_description = sku_description self.extended_status_info = extended_status_info + self.billing_plan = billing_plan self.split_properties = split_properties self.merge_properties = merge_properties self.billing_scope_id = billing_scope_id 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 2042cafecbd2..6de3cd988d1b 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 @@ -88,7 +88,8 @@ def get_applied_reservation_list( self, subscription_id, custom_headers=None, raw=False, **operation_config): """Get list of applicable `Reservation`s. - Get applicable `Reservation`s that are applied to this subscription. + Get applicable `Reservation`s that are applied to this subscription or + a resource group under this subscription. :param subscription_id: Id of the subscription :type subscription_id: str 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 3a8db3c6f2c8..b36986777efc 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 @@ -240,7 +240,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -340,7 +340,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) 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 3d368fd4ec18..27c9f60ca544 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 @@ -263,13 +263,15 @@ def get_long_running_output(response): purchase.metadata = {'url': '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'} def get( - self, reservation_order_id, custom_headers=None, raw=False, **operation_config): + self, reservation_order_id, expand=None, custom_headers=None, raw=False, **operation_config): """Get a specific `ReservationOrder`. Get the details of the `ReservationOrder`. :param reservation_order_id: Order Id of the reservation :type reservation_order_id: str + :param expand: May be used to expand the planInformation. + :type expand: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -291,6 +293,8 @@ def get( # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers header_parameters = {} 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 85da2c00c1a6..266f5a486d79 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/version.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.4.0" +VERSION = "0.5.0"