Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR] reservations/resource-manager #4792

Merged
merged 12 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions azure-mgmt-reservations/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
Release History
===============

0.3.2 (2019-04-18)
++++++++++++++++++

**Features**

- Added operation ReservationOrderOperations.purchase
- Added operation ReservationOrderOperations.calculate

0.3.1 (2018-11-05)
++++++++++++++++++

Expand Down
1 change: 1 addition & 0 deletions azure-mgmt-reservations/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
recursive-include tests *.py *.yaml
include *.rst
include azure/__init__.py
include azure/mgmt/__init__.py
Expand Down
19 changes: 0 additions & 19 deletions azure-mgmt-reservations/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see
For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


Compatibility
=============

**IMPORTANT**: If you have an earlier version of the azure package
(version < 1.0), you should uninstall it before installing this package.

You can check the version using pip:

.. code:: shell

pip freeze

If you see azure==0.11.0 (or any version below 1.0), uninstall it first:

.. code:: shell

pip uninstall azure


Usage
=====

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(
super(AzureReservationAPI, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2018-06-01'
self.api_version = '2019-04-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
18 changes: 18 additions & 0 deletions azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
from .reservation_properties_py3 import ReservationProperties
from .reservation_response_py3 import ReservationResponse
from .reservation_order_response_py3 import ReservationOrderResponse
from .calculate_price_response_properties_billing_currency_total_py3 import CalculatePriceResponsePropertiesBillingCurrencyTotal
from .calculate_price_response_properties_pricing_currency_total_py3 import CalculatePriceResponsePropertiesPricingCurrencyTotal
from .calculate_price_response_properties_py3 import CalculatePriceResponseProperties
from .calculate_price_response_py3 import CalculatePriceResponse
from .purchase_request_properties_reserved_resource_properties_py3 import PurchaseRequestPropertiesReservedResourceProperties
from .merge_request_py3 import MergeRequest
from .purchase_request_py3 import PurchaseRequest
from .patch_py3 import Patch
from .split_request_py3 import SplitRequest
from .extended_error_info_py3 import ExtendedErrorInfo
Expand All @@ -40,7 +46,13 @@
from .reservation_properties import ReservationProperties
from .reservation_response import ReservationResponse
from .reservation_order_response import ReservationOrderResponse
from .calculate_price_response_properties_billing_currency_total import CalculatePriceResponsePropertiesBillingCurrencyTotal
from .calculate_price_response_properties_pricing_currency_total import CalculatePriceResponsePropertiesPricingCurrencyTotal
from .calculate_price_response_properties import CalculatePriceResponseProperties
from .calculate_price_response import CalculatePriceResponse
from .purchase_request_properties_reserved_resource_properties import PurchaseRequestPropertiesReservedResourceProperties
from .merge_request import MergeRequest
from .purchase_request import PurchaseRequest
from .patch import Patch
from .split_request import SplitRequest
from .extended_error_info import ExtendedErrorInfo
Expand Down Expand Up @@ -72,7 +84,13 @@
'ReservationProperties',
'ReservationResponse',
'ReservationOrderResponse',
'CalculatePriceResponsePropertiesBillingCurrencyTotal',
'CalculatePriceResponsePropertiesPricingCurrencyTotal',
'CalculatePriceResponseProperties',
'CalculatePriceResponse',
'PurchaseRequestPropertiesReservedResourceProperties',
'MergeRequest',
'PurchaseRequest',
'Patch',
'SplitRequest',
'ExtendedErrorInfo',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,12 @@ class ReservedResourceType(str, Enum):
sql_databases = "SqlDatabases"
suse_linux = "SuseLinux"
cosmos_db = "CosmosDb"
red_hat = "RedHat"


class InstanceFlexibility(str, Enum):

on = "On"
off = "Off"
not_supported = "NotSupported"


class AppliedScopeType(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CalculatePriceResponse(Model):
"""CalculatePriceResponse.

:param properties:
:type properties:
~azure.mgmt.reservations.models.CalculatePriceResponseProperties
"""

_attribute_map = {
'properties': {'key': 'properties', 'type': 'CalculatePriceResponseProperties'},
}

def __init__(self, **kwargs):
super(CalculatePriceResponse, self).__init__(**kwargs)
self.properties = kwargs.get('properties', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CalculatePriceResponseProperties(Model):
"""CalculatePriceResponseProperties.

:param billing_currency_total: Currency and amount that customer will be
charged in customer's local currency. Tax is not included.
:type billing_currency_total:
~azure.mgmt.reservations.models.CalculatePriceResponsePropertiesBillingCurrencyTotal
:param is_billing_partner_managed: True if billing is managed by Microsoft
Partner. Used only for CSP accounts.
:type is_billing_partner_managed: bool
:param reservation_order_id: GUID that represents reservation order that
can be placed after calculating price.
:type reservation_order_id: str
:param sku_title: Title of SKU that is being purchased.
:type sku_title: str
:param sku_description: Description of SKU that is being purchased.
:type sku_description: str
:param pricing_currency_total: Amount that Microsoft uses for record. Used
during refund for calculating refund limit. Tax is not included.
:type pricing_currency_total:
~azure.mgmt.reservations.models.CalculatePriceResponsePropertiesPricingCurrencyTotal
"""

_attribute_map = {
'billing_currency_total': {'key': 'billingCurrencyTotal', 'type': 'CalculatePriceResponsePropertiesBillingCurrencyTotal'},
'is_billing_partner_managed': {'key': 'isBillingPartnerManaged', 'type': 'bool'},
'reservation_order_id': {'key': 'reservationOrderId', 'type': 'str'},
'sku_title': {'key': 'skuTitle', 'type': 'str'},
'sku_description': {'key': 'skuDescription', 'type': 'str'},
'pricing_currency_total': {'key': 'pricingCurrencyTotal', 'type': 'CalculatePriceResponsePropertiesPricingCurrencyTotal'},
}

def __init__(self, **kwargs):
super(CalculatePriceResponseProperties, self).__init__(**kwargs)
self.billing_currency_total = kwargs.get('billing_currency_total', None)
self.is_billing_partner_managed = kwargs.get('is_billing_partner_managed', None)
self.reservation_order_id = kwargs.get('reservation_order_id', None)
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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CalculatePriceResponsePropertiesBillingCurrencyTotal(Model):
"""Currency and amount that customer will be charged in customer's local
currency. Tax is not included.

:param currency_code:
: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(CalculatePriceResponsePropertiesBillingCurrencyTotal, self).__init__(**kwargs)
self.currency_code = kwargs.get('currency_code', None)
self.amount = kwargs.get('amount', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CalculatePriceResponsePropertiesBillingCurrencyTotal(Model):
"""Currency and amount that customer will be charged in customer's local
currency. Tax is not included.

:param currency_code:
: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(CalculatePriceResponsePropertiesBillingCurrencyTotal, self).__init__(**kwargs)
self.currency_code = currency_code
self.amount = amount
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CalculatePriceResponsePropertiesPricingCurrencyTotal(Model):
"""Amount that Microsoft uses for record. Used during refund for calculating
refund limit. Tax is not included.

:param currency_code:
: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(CalculatePriceResponsePropertiesPricingCurrencyTotal, self).__init__(**kwargs)
self.currency_code = kwargs.get('currency_code', None)
self.amount = kwargs.get('amount', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CalculatePriceResponsePropertiesPricingCurrencyTotal(Model):
"""Amount that Microsoft uses for record. Used during refund for calculating
refund limit. Tax is not included.

:param currency_code:
: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(CalculatePriceResponsePropertiesPricingCurrencyTotal, self).__init__(**kwargs)
self.currency_code = currency_code
self.amount = amount
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CalculatePriceResponseProperties(Model):
"""CalculatePriceResponseProperties.

:param billing_currency_total: Currency and amount that customer will be
charged in customer's local currency. Tax is not included.
:type billing_currency_total:
~azure.mgmt.reservations.models.CalculatePriceResponsePropertiesBillingCurrencyTotal
:param is_billing_partner_managed: True if billing is managed by Microsoft
Partner. Used only for CSP accounts.
:type is_billing_partner_managed: bool
:param reservation_order_id: GUID that represents reservation order that
can be placed after calculating price.
:type reservation_order_id: str
:param sku_title: Title of SKU that is being purchased.
:type sku_title: str
:param sku_description: Description of SKU that is being purchased.
:type sku_description: str
:param pricing_currency_total: Amount that Microsoft uses for record. Used
during refund for calculating refund limit. Tax is not included.
:type pricing_currency_total:
~azure.mgmt.reservations.models.CalculatePriceResponsePropertiesPricingCurrencyTotal
"""

_attribute_map = {
'billing_currency_total': {'key': 'billingCurrencyTotal', 'type': 'CalculatePriceResponsePropertiesBillingCurrencyTotal'},
'is_billing_partner_managed': {'key': 'isBillingPartnerManaged', 'type': 'bool'},
'reservation_order_id': {'key': 'reservationOrderId', 'type': 'str'},
'sku_title': {'key': 'skuTitle', 'type': 'str'},
'sku_description': {'key': 'skuDescription', 'type': 'str'},
'pricing_currency_total': {'key': 'pricingCurrencyTotal', 'type': 'CalculatePriceResponsePropertiesPricingCurrencyTotal'},
}

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:
super(CalculatePriceResponseProperties, self).__init__(**kwargs)
self.billing_currency_total = billing_currency_total
self.is_billing_partner_managed = is_billing_partner_managed
self.reservation_order_id = reservation_order_id
self.sku_title = sku_title
self.sku_description = sku_description
self.pricing_currency_total = pricing_currency_total
Loading