diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/__init__.py b/azure-mgmt-reservations/azure/mgmt/reservations/__init__.py index dde33b7e70c4..a2ff086dcdca 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/__init__.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/__init__.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/azure_reservation_api.py b/azure-mgmt-reservations/azure/mgmt/reservations/azure_reservation_api.py index 17dacbe779e1..7d4af5699647 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/azure_reservation_api.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/azure_reservation_api.py @@ -1,16 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION from msrest.pipeline import ClientRawResponse -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.reservation_order_operations import ReservationOrderOperations from .operations.reservation_operations import ReservationOperations @@ -39,24 +44,24 @@ def __init__( super(AzureReservationAPIConfiguration, self).__init__(base_url) - self.add_user_agent('azurereservationapi/{}'.format(VERSION)) + self.add_user_agent('azure-mgmt-reservations/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials -class AzureReservationAPI(object): +class AzureReservationAPI(SDKClient): """This API describe Azure Reservation :ivar config: Configuration for client. :vartype config: AzureReservationAPIConfiguration :ivar reservation_order: ReservationOrder operations - :vartype reservation_order: reservations.operations.ReservationOrderOperations + :vartype reservation_order: azure.mgmt.reservations.operations.ReservationOrderOperations :ivar reservation: Reservation operations - :vartype reservation: reservations.operations.ReservationOperations + :vartype reservation: azure.mgmt.reservations.operations.ReservationOperations :ivar operation: Operation operations - :vartype operation: reservations.operations.OperationOperations + :vartype operation: azure.mgmt.reservations.operations.OperationOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -68,10 +73,10 @@ def __init__( self, credentials, base_url=None): self.config = AzureReservationAPIConfiguration(credentials, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + 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 = '2017-11-01' + self.api_version = '2018-06-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -83,26 +88,31 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) def get_catalog( - self, subscription_id, custom_headers=None, raw=False, **operation_config): + self, subscription_id, reserved_resource_type, location=None, custom_headers=None, raw=False, **operation_config): """Get the regions and skus that are available for RI purchase for the specified Azure subscription. :param subscription_id: Id of the subscription :type subscription_id: str + :param reserved_resource_type: The type of the resource for which the + skus should be provided. + :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 + :type location: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: list of :class:`Catalog ` or - :class:`ClientRawResponse` if - raw=true - :rtype: list of :class:`Catalog ` or - :class:`ClientRawResponse` - :raises: :class:`ErrorException` + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.reservations.models.Catalog] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs' + url = self.get_catalog.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str') } @@ -111,6 +121,9 @@ def get_catalog( # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['reservedResourceType'] = self._serialize.query("reserved_resource_type", reserved_resource_type, 'str') + if location is not None: + query_parameters['location'] = self._serialize.query("location", location, 'str') # Construct headers header_parameters = {} @@ -124,7 +137,7 @@ def get_catalog( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -139,6 +152,7 @@ def get_catalog( return client_raw_response return deserialized + get_catalog.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs'} def get_applied_reservation_list( self, subscription_id, custom_headers=None, raw=False, **operation_config): @@ -153,17 +167,14 @@ def get_applied_reservation_list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`AppliedReservations - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`AppliedReservations - ` or - :class:`ClientRawResponse` - :raises: :class:`ErrorException` + :return: AppliedReservations or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.reservations.models.AppliedReservations or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations' + url = self.get_applied_reservation_list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str') } @@ -185,7 +196,7 @@ def get_applied_reservation_list( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -200,3 +211,4 @@ def get_applied_reservation_list( return client_raw_response return deserialized + get_applied_reservation_list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations'} diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py index ac1c4c4c55fa..f1ad166cfc89 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py @@ -1,39 +1,61 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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 .sku_name import SkuName -from .sku_capability import SkuCapability -from .sku_restriction import SkuRestriction -from .catalog import Catalog -from .extended_status_info import ExtendedStatusInfo -from .reservation_split_properties import ReservationSplitProperties -from .reservation_merge_properties import ReservationMergeProperties -from .reservation_properties import ReservationProperties -from .reservation_response import ReservationResponse -from .reservation_order_response import ReservationOrderResponse -from .merge_request import MergeRequest -from .patch import Patch -from .split_request import SplitRequest -from .extended_error_info import ExtendedErrorInfo -from .error import Error, ErrorException -from .applied_reservation_list import AppliedReservationList -from .applied_reservations import AppliedReservations -from .operation_display import OperationDisplay -from .operation_response import OperationResponse +try: + from .sku_name_py3 import SkuName + from .sku_property_py3 import SkuProperty + from .sku_restriction_py3 import SkuRestriction + from .catalog_py3 import Catalog + from .extended_status_info_py3 import ExtendedStatusInfo + from .reservation_split_properties_py3 import ReservationSplitProperties + from .reservation_merge_properties_py3 import ReservationMergeProperties + from .reservation_properties_py3 import ReservationProperties + from .reservation_response_py3 import ReservationResponse + from .reservation_order_response_py3 import ReservationOrderResponse + from .merge_request_py3 import MergeRequest + from .patch_py3 import Patch + from .split_request_py3 import SplitRequest + from .extended_error_info_py3 import ExtendedErrorInfo + from .error_py3 import Error, ErrorException + from .applied_reservation_list_py3 import AppliedReservationList + from .applied_reservations_py3 import AppliedReservations + from .operation_display_py3 import OperationDisplay + from .operation_response_py3 import OperationResponse +except (SyntaxError, ImportError): + from .sku_name import SkuName + from .sku_property import SkuProperty + from .sku_restriction import SkuRestriction + from .catalog import Catalog + from .extended_status_info import ExtendedStatusInfo + from .reservation_split_properties import ReservationSplitProperties + from .reservation_merge_properties import ReservationMergeProperties + from .reservation_properties import ReservationProperties + from .reservation_response import ReservationResponse + from .reservation_order_response import ReservationOrderResponse + from .merge_request import MergeRequest + from .patch import Patch + from .split_request import SplitRequest + from .extended_error_info import ExtendedErrorInfo + from .error import Error, ErrorException + from .applied_reservation_list import AppliedReservationList + from .applied_reservations import AppliedReservations + from .operation_display import OperationDisplay + from .operation_response import OperationResponse from .reservation_order_response_paged import ReservationOrderResponsePaged from .reservation_response_paged import ReservationResponsePaged from .operation_response_paged import OperationResponsePaged -from .azure_reservation_api_enums import ( - Kind, -) __all__ = [ 'SkuName', - 'SkuCapability', + 'SkuProperty', 'SkuRestriction', 'Catalog', 'ExtendedStatusInfo', @@ -54,5 +76,4 @@ 'ReservationOrderResponsePaged', 'ReservationResponsePaged', 'OperationResponsePaged', - 'Kind', ] diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservation_list.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservation_list.py index f8786931f913..bbbdf641de7b 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservation_list.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservation_list.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -12,7 +16,7 @@ class AppliedReservationList(Model): """AppliedReservationList. :param value: - :type value: list of str + :type value: list[str] :param next_link: Url to get the next page of reservations :type next_link: str """ @@ -22,6 +26,7 @@ class AppliedReservationList(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(AppliedReservationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservation_list_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservation_list_py3.py new file mode 100644 index 000000000000..6947ee80161a --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservation_list_py3.py @@ -0,0 +1,32 @@ +# 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 AppliedReservationList(Model): + """AppliedReservationList. + + :param value: + :type value: list[str] + :param next_link: Url to get the next page of reservations + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(AppliedReservationList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservations.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservations.py index 980c01fbabda..0f9c2581ef5b 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservations.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservations.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -21,8 +25,8 @@ class AppliedReservations(Model): :ivar type: Type of resource. "Microsoft.Capacity/AppliedReservations" :vartype type: str :param reservation_order_ids: - :type reservation_order_ids: :class:`AppliedReservationList - ` + :type reservation_order_ids: + ~azure.mgmt.reservations.models.AppliedReservationList """ _validation = { @@ -38,8 +42,9 @@ class AppliedReservations(Model): 'reservation_order_ids': {'key': 'properties.reservationOrderIds', 'type': 'AppliedReservationList'}, } - def __init__(self, reservation_order_ids=None): + def __init__(self, **kwargs): + super(AppliedReservations, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.reservation_order_ids = reservation_order_ids + self.reservation_order_ids = kwargs.get('reservation_order_ids', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservations_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservations_py3.py new file mode 100644 index 000000000000..03025f54a7e6 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/applied_reservations_py3.py @@ -0,0 +1,50 @@ +# 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 AppliedReservations(Model): + """AppliedReservations. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Identifier of the applied reservations + :vartype id: str + :ivar name: Name of resource + :vartype name: str + :ivar type: Type of resource. "Microsoft.Capacity/AppliedReservations" + :vartype type: str + :param reservation_order_ids: + :type reservation_order_ids: + ~azure.mgmt.reservations.models.AppliedReservationList + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'reservation_order_ids': {'key': 'properties.reservationOrderIds', 'type': 'AppliedReservationList'}, + } + + def __init__(self, *, reservation_order_ids=None, **kwargs) -> None: + super(AppliedReservations, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.reservation_order_ids = reservation_order_ids diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/azure_reservation_api_enums.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/azure_reservation_api_enums.py deleted file mode 100644 index 84f0e6744407..000000000000 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/azure_reservation_api_enums.py +++ /dev/null @@ -1,13 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum - - -class Kind(Enum): - - microsoft_compute = "Microsoft.Compute" diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/catalog.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/catalog.py index b4dac2d519ff..cd9297a5224e 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/catalog.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/catalog.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -18,50 +22,40 @@ class Catalog(Model): :vartype resource_type: str :ivar name: The name of SKU :vartype name: str - :ivar tier: The tier of this SKU - :vartype tier: str - :ivar size: The size of this SKU - :vartype size: str :ivar terms: Available reservation terms for this resource - :vartype terms: list of str + :vartype terms: list[str] :ivar locations: - :vartype locations: list of str - :ivar capabilities: - :vartype capabilities: list of :class:`SkuCapability - ` + :vartype locations: list[str] + :ivar sku_properties: + :vartype sku_properties: list[~azure.mgmt.reservations.models.SkuProperty] :ivar restrictions: - :vartype restrictions: list of :class:`SkuRestriction - ` + :vartype restrictions: + list[~azure.mgmt.reservations.models.SkuRestriction] """ _validation = { 'resource_type': {'readonly': True}, 'name': {'readonly': True}, - 'tier': {'readonly': True}, - 'size': {'readonly': True}, 'terms': {'readonly': True}, 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, + 'sku_properties': {'readonly': True}, 'restrictions': {'readonly': True}, } _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, 'terms': {'key': 'terms', 'type': '[str]'}, 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, + 'sku_properties': {'key': 'skuProperties', 'type': '[SkuProperty]'}, 'restrictions': {'key': 'restrictions', 'type': '[SkuRestriction]'}, } - def __init__(self): + def __init__(self, **kwargs): + super(Catalog, self).__init__(**kwargs) self.resource_type = None self.name = None - self.tier = None - self.size = None self.terms = None self.locations = None - self.capabilities = None + self.sku_properties = None self.restrictions = None diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/catalog_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/catalog_py3.py new file mode 100644 index 000000000000..51b01b39f04f --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/catalog_py3.py @@ -0,0 +1,61 @@ +# 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 Catalog(Model): + """Catalog. + + 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. + :vartype resource_type: str + :ivar name: The name of SKU + :vartype name: str + :ivar terms: Available reservation terms for this resource + :vartype terms: list[str] + :ivar locations: + :vartype locations: list[str] + :ivar sku_properties: + :vartype sku_properties: list[~azure.mgmt.reservations.models.SkuProperty] + :ivar restrictions: + :vartype restrictions: + list[~azure.mgmt.reservations.models.SkuRestriction] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'terms': {'readonly': True}, + 'locations': {'readonly': True}, + 'sku_properties': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + '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: + super(Catalog, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.terms = None + self.locations = None + self.sku_properties = None + self.restrictions = None diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/error.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/error.py index 07f10c4f389b..fa9805046fce 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/error.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/error.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -13,16 +17,16 @@ class Error(Model): """Error. :param error: - :type error: :class:`ExtendedErrorInfo - ` + :type error: ~azure.mgmt.reservations.models.ExtendedErrorInfo """ _attribute_map = { 'error': {'key': 'error', 'type': 'ExtendedErrorInfo'}, } - def __init__(self, error=None): - self.error = error + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.error = kwargs.get('error', None) class ErrorException(HttpOperationError): diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/error_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/error_py3.py new file mode 100644 index 000000000000..0eb2fbecad17 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/error_py3.py @@ -0,0 +1,41 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class Error(Model): + """Error. + + :param error: + :type error: ~azure.mgmt.reservations.models.ExtendedErrorInfo + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ExtendedErrorInfo'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.error = error + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_error_info.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_error_info.py index 9345c9e7972d..a7bac5ddd91b 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_error_info.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_error_info.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -22,7 +26,7 @@ class ExtendedErrorInfo(Model): 'UnauthenticatedRequestsThrottled', 'InvalidHealthCheckType', 'Forbidden', 'BillingScopeIdCannotBeChanged', 'AppliedScopesNotAssociatedWithCommerceAccount', - 'AppliedScopesSameAsExisting', 'RoleAssignmentCreationFailed', + 'PatchValuesSameAsExisting', 'RoleAssignmentCreationFailed', 'ReservationOrderCreationFailed', 'ReservationOrderNotEnabled', 'CapacityUpdateScopesFailed', 'UnsupportedReservationTerm', 'ReservationOrderIdAlreadyExists', 'RiskCheckFailed', 'CreateQuoteFailed', @@ -37,7 +41,7 @@ class ExtendedErrorInfo(Model): 'BillingError', 'FulfillmentConfigurationError', 'FulfillmentOutOfStockError', 'FulfillmentTransientError', 'FulfillmentError', 'CalculatePriceFailed' - :type code: str or :class:`enum ` + :type code: str or ~azure.mgmt.reservations.models.enum :param message: :type message: str """ @@ -47,6 +51,7 @@ class ExtendedErrorInfo(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, message=None): - self.code = code - self.message = message + def __init__(self, **kwargs): + super(ExtendedErrorInfo, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_error_info_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_error_info_py3.py new file mode 100644 index 000000000000..244d50abd923 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_error_info_py3.py @@ -0,0 +1,57 @@ +# 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 ExtendedErrorInfo(Model): + """ExtendedErrorInfo. + + :param code: Possible values include: 'NotSpecified', + 'InternalServerError', 'ServerTimeout', 'AuthorizationFailed', + 'BadRequest', 'ClientCertificateThumbprintNotSet', + 'InvalidRequestContent', 'OperationFailed', 'HttpMethodNotSupported', + 'InvalidRequestUri', 'MissingTenantId', 'InvalidTenantId', + 'InvalidReservationOrderId', 'InvalidReservationId', + 'ReservationIdNotInReservationOrder', 'ReservationOrderNotFound', + 'InvalidSubscriptionId', 'InvalidAccessToken', 'InvalidLocationId', + 'UnauthenticatedRequestsThrottled', 'InvalidHealthCheckType', 'Forbidden', + 'BillingScopeIdCannotBeChanged', + 'AppliedScopesNotAssociatedWithCommerceAccount', + 'PatchValuesSameAsExisting', 'RoleAssignmentCreationFailed', + 'ReservationOrderCreationFailed', 'ReservationOrderNotEnabled', + 'CapacityUpdateScopesFailed', 'UnsupportedReservationTerm', + 'ReservationOrderIdAlreadyExists', 'RiskCheckFailed', 'CreateQuoteFailed', + 'ActivateQuoteFailed', 'NonsupportedAccountId', + 'PaymentInstrumentNotFound', 'MissingAppliedScopesForSingle', + 'NoValidReservationsToReRate', 'ReRateOnlyAllowedForEA', + 'OperationCannotBePerformedInCurrentState', + 'InvalidSingleAppliedScopesCount', 'InvalidFulfillmentRequestParameters', + 'NotSupportedCountry', 'InvalidRefundQuantity', 'PurchaseError', + 'BillingCustomerInputError', 'BillingPaymentInstrumentSoftError', + 'BillingPaymentInstrumentHardError', 'BillingTransientError', + 'BillingError', 'FulfillmentConfigurationError', + 'FulfillmentOutOfStockError', 'FulfillmentTransientError', + 'FulfillmentError', 'CalculatePriceFailed' + :type code: str or ~azure.mgmt.reservations.models.enum + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code=None, message: str=None, **kwargs) -> None: + super(ExtendedErrorInfo, self).__init__(**kwargs) + self.code = code + self.message = message diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_status_info.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_status_info.py index 2e3cf0b28b78..1849791f9e6d 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_status_info.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_status_info.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -14,7 +18,7 @@ class ExtendedStatusInfo(Model): :param status_code: Possible values include: 'None', 'Pending', 'Active', 'PurchaseError', 'PaymentInstrumentError', 'Split', 'Merged', 'Expired', 'Succeeded' - :type status_code: str or :class:`enum ` + :type status_code: str or ~azure.mgmt.reservations.models.enum :param message: The message giving detailed information about the status code. :type message: str @@ -25,6 +29,7 @@ class ExtendedStatusInfo(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, status_code=None, message=None): - self.status_code = status_code - self.message = message + def __init__(self, **kwargs): + super(ExtendedStatusInfo, self).__init__(**kwargs) + self.status_code = kwargs.get('status_code', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_status_info_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_status_info_py3.py new file mode 100644 index 000000000000..078b4d66640e --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/extended_status_info_py3.py @@ -0,0 +1,35 @@ +# 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 ExtendedStatusInfo(Model): + """ExtendedStatusInfo. + + :param status_code: Possible values include: 'None', 'Pending', 'Active', + 'PurchaseError', 'PaymentInstrumentError', 'Split', 'Merged', 'Expired', + 'Succeeded' + :type status_code: str or ~azure.mgmt.reservations.models.enum + :param message: The message giving detailed information about the status + code. + :type message: str + """ + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, status_code=None, message: str=None, **kwargs) -> None: + super(ExtendedStatusInfo, self).__init__(**kwargs) + self.status_code = status_code + self.message = message diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/merge_request.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/merge_request.py index 34c966fa69e4..017d8199c1be 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/merge_request.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/merge_request.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -13,12 +17,13 @@ class MergeRequest(Model): :param sources: Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} - :type sources: list of str + :type sources: list[str] """ _attribute_map = { 'sources': {'key': 'properties.sources', 'type': '[str]'}, } - def __init__(self, sources=None): - self.sources = sources + def __init__(self, **kwargs): + super(MergeRequest, self).__init__(**kwargs) + self.sources = kwargs.get('sources', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/merge_request_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/merge_request_py3.py new file mode 100644 index 000000000000..cb7b41e5dcf3 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/merge_request_py3.py @@ -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 MergeRequest(Model): + """MergeRequest. + + :param sources: Format of the resource id should be + /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} + :type sources: list[str] + """ + + _attribute_map = { + 'sources': {'key': 'properties.sources', 'type': '[str]'}, + } + + def __init__(self, *, sources=None, **kwargs) -> None: + super(MergeRequest, self).__init__(**kwargs) + self.sources = sources diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_display.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_display.py index 2f0ad26ac656..79a304da49c9 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_display.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_display.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -28,8 +32,9 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None): - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_display_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_display_py3.py new file mode 100644 index 000000000000..eba1e3726b41 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# 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 OperationDisplay(Model): + """OperationDisplay. + + :param provider: + :type provider: str + :param resource: + :type resource: str + :param operation: + :type operation: str + :param description: + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_response.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_response.py index ed1a35194cf6..e3684cf97340 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_response.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_response.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -14,8 +18,7 @@ class OperationResponse(Model): :param name: :type name: str :param display: - :type display: :class:`OperationDisplay - ` + :type display: ~azure.mgmt.reservations.models.OperationDisplay :param origin: :type origin: str """ @@ -26,7 +29,8 @@ class OperationResponse(Model): 'origin': {'key': 'origin', 'type': 'str'}, } - def __init__(self, name=None, display=None, origin=None): - self.name = name - self.display = display - self.origin = origin + def __init__(self, **kwargs): + super(OperationResponse, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_response_paged.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_response_paged.py index 9a594ea956da..46bc490fd198 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_response_paged.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_response_paged.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -10,7 +14,7 @@ class OperationResponsePaged(Paged): """ - A paging container for iterating over a list of :class:`OperationResponse ` object + A paging container for iterating over a list of :class:`OperationResponse ` object """ _attribute_map = { diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_response_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_response_py3.py new file mode 100644 index 000000000000..ee82aa93d7d5 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/operation_response_py3.py @@ -0,0 +1,36 @@ +# 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 OperationResponse(Model): + """OperationResponse. + + :param name: + :type name: str + :param display: + :type display: ~azure.mgmt.reservations.models.OperationDisplay + :param origin: + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, **kwargs) -> None: + super(OperationResponse, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/patch.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/patch.py index 733eac375c9a..1116e5a057fd 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/patch.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/patch.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -12,16 +16,22 @@ class Patch(Model): """Patch. :param applied_scope_type: Possible values include: 'Single', 'Shared' - :type applied_scope_type: str or :class:`enum ` + :type applied_scope_type: str or ~azure.mgmt.reservations.models.enum :param applied_scopes: - :type applied_scopes: list of str + :type applied_scopes: list[str] + :param instance_flexibility: Possible values include: 'On', 'Off', + 'NotSupported' + :type instance_flexibility: str or ~azure.mgmt.reservations.models.enum """ _attribute_map = { 'applied_scope_type': {'key': 'properties.appliedScopeType', 'type': 'str'}, 'applied_scopes': {'key': 'properties.appliedScopes', 'type': '[str]'}, + 'instance_flexibility': {'key': 'properties.instanceFlexibility', 'type': 'str'}, } - def __init__(self, applied_scope_type=None, applied_scopes=None): - self.applied_scope_type = applied_scope_type - self.applied_scopes = applied_scopes + def __init__(self, **kwargs): + super(Patch, self).__init__(**kwargs) + self.applied_scope_type = kwargs.get('applied_scope_type', None) + self.applied_scopes = kwargs.get('applied_scopes', None) + self.instance_flexibility = kwargs.get('instance_flexibility', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/patch_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/patch_py3.py new file mode 100644 index 000000000000..bec3bf92d88b --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/patch_py3.py @@ -0,0 +1,37 @@ +# 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 Patch(Model): + """Patch. + + :param applied_scope_type: Possible values include: 'Single', 'Shared' + :type applied_scope_type: str or ~azure.mgmt.reservations.models.enum + :param applied_scopes: + :type applied_scopes: list[str] + :param instance_flexibility: Possible values include: 'On', 'Off', + 'NotSupported' + :type instance_flexibility: str or ~azure.mgmt.reservations.models.enum + """ + + _attribute_map = { + 'applied_scope_type': {'key': 'properties.appliedScopeType', 'type': 'str'}, + 'applied_scopes': {'key': 'properties.appliedScopes', 'type': '[str]'}, + 'instance_flexibility': {'key': 'properties.instanceFlexibility', 'type': 'str'}, + } + + def __init__(self, *, applied_scope_type=None, applied_scopes=None, instance_flexibility=None, **kwargs) -> None: + super(Patch, self).__init__(**kwargs) + self.applied_scope_type = applied_scope_type + self.applied_scopes = applied_scopes + self.instance_flexibility = instance_flexibility diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_merge_properties.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_merge_properties.py index 61dd1b1daa93..494f268981a1 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_merge_properties.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_merge_properties.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -18,7 +22,7 @@ class ReservationMergeProperties(Model): :param 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} - :type merge_sources: list of str + :type merge_sources: list[str] """ _attribute_map = { @@ -26,6 +30,7 @@ class ReservationMergeProperties(Model): 'merge_sources': {'key': 'mergeSources', 'type': '[str]'}, } - def __init__(self, merge_destination=None, merge_sources=None): - self.merge_destination = merge_destination - self.merge_sources = merge_sources + def __init__(self, **kwargs): + super(ReservationMergeProperties, self).__init__(**kwargs) + self.merge_destination = kwargs.get('merge_destination', None) + self.merge_sources = kwargs.get('merge_sources', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_merge_properties_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_merge_properties_py3.py new file mode 100644 index 000000000000..b03bd47a1e75 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_merge_properties_py3.py @@ -0,0 +1,36 @@ +# 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 ReservationMergeProperties(Model): + """ReservationMergeProperties. + + :param merge_destination: Reservation Resource Id Created due to the + merge. Format of the resource Id is + /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} + :type merge_destination: str + :param 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} + :type merge_sources: list[str] + """ + + _attribute_map = { + 'merge_destination': {'key': 'mergeDestination', 'type': 'str'}, + 'merge_sources': {'key': 'mergeSources', 'type': '[str]'}, + } + + def __init__(self, *, merge_destination: str=None, merge_sources=None, **kwargs) -> None: + super(ReservationMergeProperties, self).__init__(**kwargs) + self.merge_destination = merge_destination + self.merge_sources = merge_sources diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_order_response.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_order_response.py index 56a98fab3c88..18d85ae9c4d7 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_order_response.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_order_response.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -35,15 +39,15 @@ class ReservationOrderResponse(Model): Reservation. :type original_quantity: int :param term: Possible values include: 'P1Y', 'P3Y' - :type term: str or :class:`enum ` + :type term: str or ~azure.mgmt.reservations.models.enum :param provisioning_state: Possible values include: 'Creating', 'PendingResourceHold', 'ConfirmedResourceHold', 'PendingBilling', 'ConfirmedBilling', 'Created', 'Succeeded', 'Cancelled', 'Expired', 'BillingFailed', 'Failed', 'Split', 'Merged' - :type provisioning_state: str or :class:`enum ` - :param reservations_property: - :type reservations_property: list of :class:`ReservationResponse - ` + :type provisioning_state: str or ~azure.mgmt.reservations.models.enum + :param reservations: + :type reservations: + list[~azure.mgmt.reservations.models.ReservationResponse] :ivar type: Type of resource. "Microsoft.Capacity/reservations" :vartype type: str """ @@ -65,20 +69,21 @@ class ReservationOrderResponse(Model): 'original_quantity': {'key': 'properties.originalQuantity', 'type': 'int'}, 'term': {'key': 'properties.term', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'reservations_property': {'key': 'properties.reservations', 'type': '[ReservationResponse]'}, + 'reservations': {'key': 'properties.reservations', 'type': '[ReservationResponse]'}, 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, etag=None, display_name=None, request_date_time=None, created_date_time=None, expiry_date=None, original_quantity=None, term=None, provisioning_state=None, reservations_property=None): - self.etag = etag + def __init__(self, **kwargs): + super(ReservationOrderResponse, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) self.id = None self.name = None - self.display_name = display_name - self.request_date_time = request_date_time - self.created_date_time = created_date_time - self.expiry_date = expiry_date - self.original_quantity = original_quantity - self.term = term - self.provisioning_state = provisioning_state - self.reservations_property = reservations_property + self.display_name = kwargs.get('display_name', None) + self.request_date_time = kwargs.get('request_date_time', None) + self.created_date_time = kwargs.get('created_date_time', None) + self.expiry_date = kwargs.get('expiry_date', None) + self.original_quantity = kwargs.get('original_quantity', None) + self.term = kwargs.get('term', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.reservations = kwargs.get('reservations', None) self.type = None diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_order_response_paged.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_order_response_paged.py index 3dbc4827c612..1a72737da5d7 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_order_response_paged.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_order_response_paged.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -10,7 +14,7 @@ class ReservationOrderResponsePaged(Paged): """ - A paging container for iterating over a list of :class:`ReservationOrderResponse ` object + A paging container for iterating over a list of :class:`ReservationOrderResponse ` object """ _attribute_map = { diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_order_response_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_order_response_py3.py new file mode 100644 index 000000000000..d0d559698587 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_order_response_py3.py @@ -0,0 +1,89 @@ +# 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 ReservationOrderResponse(Model): + """ReservationOrderResponse. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param etag: + :type etag: int + :ivar id: Identifier of the reservation + :vartype id: str + :ivar name: Name of the reservation + :vartype name: str + :param display_name: Friendly name for user to easily identified the + reservation. + :type display_name: str + :param request_date_time: This is the DateTime when the reservation was + initially requested for purchase. + :type request_date_time: datetime + :param created_date_time: This is the DateTime when the reservation was + created. + :type created_date_time: datetime + :param expiry_date: This is the date when the Reservation will expire. + :type expiry_date: date + :param original_quantity: Total Quantity of the SKUs purchased in the + Reservation. + :type original_quantity: int + :param term: Possible values include: 'P1Y', 'P3Y' + :type term: str or ~azure.mgmt.reservations.models.enum + :param provisioning_state: Possible values include: 'Creating', + 'PendingResourceHold', 'ConfirmedResourceHold', 'PendingBilling', + 'ConfirmedBilling', 'Created', 'Succeeded', 'Cancelled', 'Expired', + 'BillingFailed', 'Failed', 'Split', 'Merged' + :type provisioning_state: str or ~azure.mgmt.reservations.models.enum + :param reservations: + :type reservations: + list[~azure.mgmt.reservations.models.ReservationResponse] + :ivar type: Type of resource. "Microsoft.Capacity/reservations" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'etag': {'key': 'etag', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + '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'}, + 'original_quantity': {'key': 'properties.originalQuantity', 'type': 'int'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + '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=None, reservations=None, **kwargs) -> None: + super(ReservationOrderResponse, self).__init__(**kwargs) + self.etag = etag + self.id = None + self.name = None + self.display_name = display_name + self.request_date_time = request_date_time + self.created_date_time = created_date_time + self.expiry_date = expiry_date + self.original_quantity = original_quantity + self.term = term + self.provisioning_state = provisioning_state + self.reservations = reservations + self.type = None diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties.py index a805654b9012..2b828cef7f65 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -14,20 +18,26 @@ class ReservationProperties(Model): Variables are only populated by the server, and will be ignored when sending a request. + :param reserved_resource_type: Possible values include: 'VirtualMachines', + 'SqlDatabases', 'SuseLinux' + :type reserved_resource_type: str or ~azure.mgmt.reservations.models.enum + :param instance_flexibility: Possible values include: 'On', 'Off', + 'NotSupported' + :type instance_flexibility: str or ~azure.mgmt.reservations.models.enum :param display_name: Friendly name for user to easily identify the reservation :type display_name: str :param applied_scopes: - :type applied_scopes: list of str + :type applied_scopes: list[str] :param applied_scope_type: Possible values include: 'Single', 'Shared' - :type applied_scope_type: str or :class:`enum ` + :type applied_scope_type: str or ~azure.mgmt.reservations.models.enum :param quantity: Quantity of the SKUs that are part of the Reservation. :type quantity: int :param provisioning_state: Possible values include: 'Creating', 'PendingResourceHold', 'ConfirmedResourceHold', 'PendingBilling', 'ConfirmedBilling', 'Created', 'Succeeded', 'Cancelled', 'Expired', 'BillingFailed', 'Failed', 'Split', 'Merged' - :type provisioning_state: str or :class:`enum ` + :type provisioning_state: str or ~azure.mgmt.reservations.models.enum :param effective_date_time: DateTime of the Reservation starting when this version is effective from. :type effective_date_time: datetime @@ -36,15 +46,17 @@ class ReservationProperties(Model): :vartype last_updated_date_time: datetime :param expiry_date: This is the date when the Reservation will expire. :type expiry_date: date + :param sku_description: Description of the SKU in english. + :type sku_description: str :param extended_status_info: - :type extended_status_info: :class:`ExtendedStatusInfo - ` + :type extended_status_info: + ~azure.mgmt.reservations.models.ExtendedStatusInfo :param split_properties: - :type split_properties: :class:`ReservationSplitProperties - ` + :type split_properties: + ~azure.mgmt.reservations.models.ReservationSplitProperties :param merge_properties: - :type merge_properties: :class:`ReservationMergeProperties - ` + :type merge_properties: + ~azure.mgmt.reservations.models.ReservationMergeProperties """ _validation = { @@ -52,6 +64,8 @@ class ReservationProperties(Model): } _attribute_map = { + 'reserved_resource_type': {'key': 'reservedResourceType', 'type': 'str'}, + 'instance_flexibility': {'key': 'instanceFlexibility', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'applied_scopes': {'key': 'appliedScopes', 'type': '[str]'}, 'applied_scope_type': {'key': 'appliedScopeType', 'type': 'str'}, @@ -60,20 +74,25 @@ class ReservationProperties(Model): 'effective_date_time': {'key': 'effectiveDateTime', 'type': 'iso-8601'}, 'last_updated_date_time': {'key': 'lastUpdatedDateTime', 'type': 'iso-8601'}, 'expiry_date': {'key': 'expiryDate', 'type': 'date'}, + 'sku_description': {'key': 'skuDescription', 'type': 'str'}, 'extended_status_info': {'key': 'extendedStatusInfo', 'type': 'ExtendedStatusInfo'}, 'split_properties': {'key': 'splitProperties', 'type': 'ReservationSplitProperties'}, 'merge_properties': {'key': 'mergeProperties', 'type': 'ReservationMergeProperties'}, } - def __init__(self, display_name=None, applied_scopes=None, applied_scope_type=None, quantity=None, provisioning_state=None, effective_date_time=None, expiry_date=None, extended_status_info=None, split_properties=None, merge_properties=None): - self.display_name = display_name - self.applied_scopes = applied_scopes - self.applied_scope_type = applied_scope_type - self.quantity = quantity - self.provisioning_state = provisioning_state - self.effective_date_time = effective_date_time + def __init__(self, **kwargs): + super(ReservationProperties, self).__init__(**kwargs) + self.reserved_resource_type = kwargs.get('reserved_resource_type', None) + self.instance_flexibility = kwargs.get('instance_flexibility', None) + self.display_name = kwargs.get('display_name', None) + self.applied_scopes = kwargs.get('applied_scopes', None) + self.applied_scope_type = kwargs.get('applied_scope_type', None) + self.quantity = kwargs.get('quantity', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.effective_date_time = kwargs.get('effective_date_time', None) self.last_updated_date_time = None - self.expiry_date = expiry_date - self.extended_status_info = extended_status_info - self.split_properties = split_properties - self.merge_properties = merge_properties + 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.split_properties = kwargs.get('split_properties', None) + self.merge_properties = kwargs.get('merge_properties', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties_py3.py new file mode 100644 index 000000000000..3f04cfe724a8 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_properties_py3.py @@ -0,0 +1,98 @@ +# 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 ReservationProperties(Model): + """ReservationProperties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param reserved_resource_type: Possible values include: 'VirtualMachines', + 'SqlDatabases', 'SuseLinux' + :type reserved_resource_type: str or ~azure.mgmt.reservations.models.enum + :param instance_flexibility: Possible values include: 'On', 'Off', + 'NotSupported' + :type instance_flexibility: str or ~azure.mgmt.reservations.models.enum + :param display_name: Friendly name for user to easily identify the + reservation + :type display_name: str + :param applied_scopes: + :type applied_scopes: list[str] + :param applied_scope_type: Possible values include: 'Single', 'Shared' + :type applied_scope_type: str or ~azure.mgmt.reservations.models.enum + :param quantity: Quantity of the SKUs that are part of the Reservation. + :type quantity: int + :param provisioning_state: Possible values include: 'Creating', + 'PendingResourceHold', 'ConfirmedResourceHold', 'PendingBilling', + 'ConfirmedBilling', 'Created', 'Succeeded', 'Cancelled', 'Expired', + 'BillingFailed', 'Failed', 'Split', 'Merged' + :type provisioning_state: str or ~azure.mgmt.reservations.models.enum + :param effective_date_time: DateTime of the Reservation starting when this + version is effective from. + :type effective_date_time: datetime + :ivar last_updated_date_time: DateTime of the last time the Reservation + was updated. + :vartype last_updated_date_time: datetime + :param expiry_date: This is the date when the Reservation will expire. + :type expiry_date: date + :param sku_description: Description of the SKU in english. + :type sku_description: str + :param extended_status_info: + :type extended_status_info: + ~azure.mgmt.reservations.models.ExtendedStatusInfo + :param split_properties: + :type split_properties: + ~azure.mgmt.reservations.models.ReservationSplitProperties + :param merge_properties: + :type merge_properties: + ~azure.mgmt.reservations.models.ReservationMergeProperties + """ + + _validation = { + 'last_updated_date_time': {'readonly': True}, + } + + _attribute_map = { + 'reserved_resource_type': {'key': 'reservedResourceType', 'type': 'str'}, + 'instance_flexibility': {'key': 'instanceFlexibility', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'applied_scopes': {'key': 'appliedScopes', 'type': '[str]'}, + 'applied_scope_type': {'key': 'appliedScopeType', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'int'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'effective_date_time': {'key': 'effectiveDateTime', 'type': 'iso-8601'}, + 'last_updated_date_time': {'key': 'lastUpdatedDateTime', 'type': 'iso-8601'}, + 'expiry_date': {'key': 'expiryDate', 'type': 'date'}, + 'sku_description': {'key': 'skuDescription', 'type': 'str'}, + 'extended_status_info': {'key': 'extendedStatusInfo', 'type': 'ExtendedStatusInfo'}, + 'split_properties': {'key': 'splitProperties', 'type': 'ReservationSplitProperties'}, + 'merge_properties': {'key': 'mergeProperties', 'type': 'ReservationMergeProperties'}, + } + + 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=None, effective_date_time=None, expiry_date=None, sku_description: str=None, extended_status_info=None, split_properties=None, merge_properties=None, **kwargs) -> None: + super(ReservationProperties, self).__init__(**kwargs) + self.reserved_resource_type = reserved_resource_type + self.instance_flexibility = instance_flexibility + self.display_name = display_name + self.applied_scopes = applied_scopes + self.applied_scope_type = applied_scope_type + self.quantity = quantity + self.provisioning_state = provisioning_state + self.effective_date_time = effective_date_time + self.last_updated_date_time = None + self.expiry_date = expiry_date + self.sku_description = sku_description + self.extended_status_info = extended_status_info + self.split_properties = split_properties + self.merge_properties = merge_properties diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_response.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_response.py index cbb7d78c1910..22f92b767bd5 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_response.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_response.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -19,22 +23,19 @@ class ReservationResponse(Model): 'northeurope', 'eastasia', 'southeastasia', 'japaneast', 'japanwest', 'brazilsouth', 'australiaeast', 'australiasoutheast', 'southindia', 'westindia', 'centralindia', 'canadacentral', 'canadaeast', 'uksouth', - 'westcentralus', 'ukwest' - :type location: str or :class:`enum ` + 'westcentralus', 'ukwest', 'francecentral', 'francesouth', 'australiac', + 'australiac2' + :type location: str or ~azure.mgmt.reservations.models.enum :param etag: :type etag: int :ivar id: Identifier of the reservation :vartype id: str :ivar name: Name of the reservation :vartype name: str - :param kind: Resource Provider type to be reserved. Possible values - include: 'Microsoft.Compute' - :type kind: str or :class:`Kind ` :param sku: - :type sku: :class:`SkuName ` + :type sku: ~azure.mgmt.reservations.models.SkuName :param properties: - :type properties: :class:`ReservationProperties - ` + :type properties: ~azure.mgmt.reservations.models.ReservationProperties :ivar type: Type of resource. "Microsoft.Capacity/reservationOrders/reservations" :vartype type: str @@ -51,18 +52,17 @@ class ReservationResponse(Model): 'etag': {'key': 'etag', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, 'sku': {'key': 'sku', 'type': 'SkuName'}, 'properties': {'key': 'properties', 'type': 'ReservationProperties'}, 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, location=None, etag=None, kind=None, sku=None, properties=None): - self.location = location - self.etag = etag + def __init__(self, **kwargs): + super(ReservationResponse, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.etag = kwargs.get('etag', None) self.id = None self.name = None - self.kind = kind - self.sku = sku - self.properties = properties + self.sku = kwargs.get('sku', None) + self.properties = kwargs.get('properties', None) self.type = None diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_response_paged.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_response_paged.py index 6b80767fdf4a..96a57e713fb9 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_response_paged.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_response_paged.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -10,7 +14,7 @@ class ReservationResponsePaged(Paged): """ - A paging container for iterating over a list of :class:`ReservationResponse ` object + A paging container for iterating over a list of :class:`ReservationResponse ` object """ _attribute_map = { diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_response_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_response_py3.py new file mode 100644 index 000000000000..b7d6d9cc4a34 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_response_py3.py @@ -0,0 +1,68 @@ +# 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 ReservationResponse(Model): + """ReservationResponse. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param location: Possible values include: 'westus', 'eastus', 'eastus2', + 'northcentralus', 'westus2', 'southcentralus', 'centralus', 'westeurope', + 'northeurope', 'eastasia', 'southeastasia', 'japaneast', 'japanwest', + 'brazilsouth', 'australiaeast', 'australiasoutheast', 'southindia', + 'westindia', 'centralindia', 'canadacentral', 'canadaeast', 'uksouth', + 'westcentralus', 'ukwest', 'francecentral', 'francesouth', 'australiac', + 'australiac2' + :type location: str or ~azure.mgmt.reservations.models.enum + :param etag: + :type etag: int + :ivar id: Identifier of the reservation + :vartype id: str + :ivar name: Name of the reservation + :vartype name: str + :param sku: + :type sku: ~azure.mgmt.reservations.models.SkuName + :param properties: + :type properties: ~azure.mgmt.reservations.models.ReservationProperties + :ivar type: Type of resource. + "Microsoft.Capacity/reservationOrders/reservations" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SkuName'}, + 'properties': {'key': 'properties', 'type': 'ReservationProperties'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, location=None, etag: int=None, sku=None, properties=None, **kwargs) -> None: + super(ReservationResponse, self).__init__(**kwargs) + self.location = location + self.etag = etag + self.id = None + self.name = None + self.sku = sku + self.properties = properties + self.type = None diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_split_properties.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_split_properties.py index 257162850d4c..bf6116d20550 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_split_properties.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_split_properties.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -14,7 +18,7 @@ class ReservationSplitProperties(Model): :param 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} - :type split_destinations: list of str + :type split_destinations: list[str] :param 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} @@ -26,6 +30,7 @@ class ReservationSplitProperties(Model): 'split_source': {'key': 'splitSource', 'type': 'str'}, } - def __init__(self, split_destinations=None, split_source=None): - self.split_destinations = split_destinations - self.split_source = split_source + def __init__(self, **kwargs): + super(ReservationSplitProperties, self).__init__(**kwargs) + self.split_destinations = kwargs.get('split_destinations', None) + self.split_source = kwargs.get('split_source', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_split_properties_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_split_properties_py3.py new file mode 100644 index 000000000000..f3224ec7d648 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_split_properties_py3.py @@ -0,0 +1,36 @@ +# 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 ReservationSplitProperties(Model): + """ReservationSplitProperties. + + :param 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} + :type split_destinations: list[str] + :param 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} + :type split_source: str + """ + + _attribute_map = { + 'split_destinations': {'key': 'splitDestinations', 'type': '[str]'}, + 'split_source': {'key': 'splitSource', 'type': 'str'}, + } + + def __init__(self, *, split_destinations=None, split_source: str=None, **kwargs) -> None: + super(ReservationSplitProperties, self).__init__(**kwargs) + self.split_destinations = split_destinations + self.split_source = split_source diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_name.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_name.py index 5d8ba33c25e4..7de914fa19dc 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_name.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_name.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -19,5 +23,6 @@ class SkuName(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - self.name = name + def __init__(self, **kwargs): + super(SkuName, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_name_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_name_py3.py new file mode 100644 index 000000000000..2eb49cb38c13 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_name_py3.py @@ -0,0 +1,28 @@ +# 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 SkuName(Model): + """SkuName. + + :param name: + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(SkuName, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_property.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_property.py new file mode 100644 index 000000000000..623fe19202b2 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_property.py @@ -0,0 +1,32 @@ +# 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 SkuProperty(Model): + """SkuProperty. + + :param name: An invariant to describe the feature. + :type name: str + :param value: An invariant if the feature is measured by quantity. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SkuProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_capability.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_property_py3.py similarity index 62% rename from azure-mgmt-reservations/azure/mgmt/reservations/models/sku_capability.py rename to azure-mgmt-reservations/azure/mgmt/reservations/models/sku_property_py3.py index 30fb5d2a55d0..bd9593bb9884 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_capability.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_property_py3.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -8,8 +12,8 @@ from msrest.serialization import Model -class SkuCapability(Model): - """SkuCapability. +class SkuProperty(Model): + """SkuProperty. :param name: An invariant to describe the feature. :type name: str @@ -22,6 +26,7 @@ class SkuCapability(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, name=None, value=None): + def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None: + super(SkuProperty, self).__init__(**kwargs) self.name = name self.value = value diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_restriction.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_restriction.py index 4174d4d11a5f..4417bdb25b0f 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_restriction.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_restriction.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -16,7 +20,7 @@ class SkuRestriction(Model): :param values: The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. - :type values: list of str + :type values: list[str] :param reason_code: The reason for restriction. :type reason_code: str """ @@ -27,7 +31,8 @@ class SkuRestriction(Model): 'reason_code': {'key': 'reasonCode', 'type': 'str'}, } - def __init__(self, type=None, values=None, reason_code=None): - self.type = type - self.values = values - self.reason_code = reason_code + def __init__(self, **kwargs): + super(SkuRestriction, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.values = kwargs.get('values', None) + self.reason_code = kwargs.get('reason_code', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_restriction_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_restriction_py3.py new file mode 100644 index 000000000000..cad7026cc099 --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/sku_restriction_py3.py @@ -0,0 +1,38 @@ +# 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 SkuRestriction(Model): + """SkuRestriction. + + :param type: The type of restrictions. + :type type: str + :param values: The value of restrictions. If the restriction type is set + to location. This would be different locations where the SKU is + restricted. + :type values: list[str] + :param reason_code: The reason for restriction. + :type reason_code: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, values=None, reason_code: str=None, **kwargs) -> None: + super(SkuRestriction, self).__init__(**kwargs) + self.type = type + self.values = values + self.reason_code = reason_code diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/split_request.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/split_request.py index 68840361f160..4fc428a12cff 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/models/split_request.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/split_request.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -13,7 +17,7 @@ class SplitRequest(Model): :param quantities: List of the quantities in the new reservations to create. - :type quantities: list of int + :type quantities: list[int] :param reservation_id: Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} @@ -25,6 +29,7 @@ class SplitRequest(Model): 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, } - def __init__(self, quantities=None, reservation_id=None): - self.quantities = quantities - self.reservation_id = reservation_id + def __init__(self, **kwargs): + super(SplitRequest, self).__init__(**kwargs) + self.quantities = kwargs.get('quantities', None) + self.reservation_id = kwargs.get('reservation_id', None) diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/models/split_request_py3.py b/azure-mgmt-reservations/azure/mgmt/reservations/models/split_request_py3.py new file mode 100644 index 000000000000..3ccd7610f4af --- /dev/null +++ b/azure-mgmt-reservations/azure/mgmt/reservations/models/split_request_py3.py @@ -0,0 +1,35 @@ +# 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 SplitRequest(Model): + """SplitRequest. + + :param quantities: List of the quantities in the new reservations to + create. + :type quantities: list[int] + :param reservation_id: Resource id of the reservation to be split. Format + of the resource id should be + /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} + :type reservation_id: str + """ + + _attribute_map = { + 'quantities': {'key': 'properties.quantities', 'type': '[int]'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + } + + def __init__(self, *, quantities=None, reservation_id: str=None, **kwargs) -> None: + super(SplitRequest, self).__init__(**kwargs) + self.quantities = quantities + self.reservation_id = reservation_id diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/operations/__init__.py b/azure-mgmt-reservations/azure/mgmt/reservations/operations/__init__.py index e2ee4f50b4d2..ba1213ec2e29 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/operations/__init__.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/operations/__init__.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/operations/operation_operations.py b/azure-mgmt-reservations/azure/mgmt/reservations/operations/operation_operations.py index 4542944166f4..2ee5d9c89dc4 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/operations/operation_operations.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/operations/operation_operations.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -17,16 +21,18 @@ class OperationOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Supported version. Constant value: "2017-11-01". + :param deserializer: An object model deserializer. + :ivar api_version: Supported version. Constant value: "2018-06-01". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-11-01" + self.api_version = "2018-06-01" self.config = config @@ -41,17 +47,17 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`OperationResponse - ` - :rtype: :class:`OperationResponsePaged - ` - :raises: :class:`ErrorException` + :return: An iterator like instance of OperationResponse + :rtype: + ~azure.mgmt.reservations.models.OperationResponsePaged[~azure.mgmt.reservations.models.OperationResponse] + :raises: + :class:`ErrorException` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Capacity/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -74,7 +80,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -90,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Capacity/operations'} diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_operations.py b/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_operations.py index 3941bb253e73..91853cadf859 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_operations.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_operations.py @@ -1,13 +1,18 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -18,47 +23,28 @@ class ReservationOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Supported version. Constant value: "2017-11-01". + :param deserializer: An object model deserializer. + :ivar api_version: Supported version. Constant value: "2018-06-01". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-11-01" + self.api_version = "2018-06-01" self.config = config - def split( - self, reservation_order_id, body, custom_headers=None, raw=False, **operation_config): - """Split the `Reservation`. - Split a `Reservation` into two `Reservation`s with specified quantity - distribution. - . + def _split_initial( + self, reservation_order_id, quantities=None, reservation_id=None, custom_headers=None, raw=False, **operation_config): + body = models.SplitRequest(quantities=quantities, reservation_id=reservation_id) - :param reservation_order_id: Order Id of the reservation - :type reservation_order_id: str - :param body: Information needed to Split a reservation item - :type body: :class:`SplitRequest ` - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: - :class:`AzureOperationPoller` - instance that returns list of :class:`ReservationResponse - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: - :class:`AzureOperationPoller` - or :class:`ClientRawResponse` - :raises: :class:`ErrorException` - """ # Construct URL - url = '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/split' + url = self.split.metadata['url'] path_format_arguments = { 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str') } @@ -82,29 +68,66 @@ def split( body_content = self._serialize.body(body, 'SplitRequest') # Construct and send request - def long_running_send(): + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.post(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 202]: + raise models.ErrorException(self._deserialize, response) - def get_long_running_status(status_link, headers=None): + deserialized = None - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if response.status_code == 200: + deserialized = self._deserialize('[ReservationResponse]', response) - def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - if response.status_code not in [200, 202]: - raise models.ErrorException(self._deserialize, response) + return deserialized - deserialized = None + def split( + self, reservation_order_id, quantities=None, reservation_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Split the `Reservation`. - if response.status_code == 200: - deserialized = self._deserialize('[ReservationResponse]', response) + Split a `Reservation` into two `Reservation`s with specified quantity + distribution. + . + + :param reservation_order_id: Order Id of the reservation + :type reservation_order_id: str + :param quantities: List of the quantities in the new reservations to + create. + :type quantities: list[int] + :param reservation_id: Resource id of the reservation to be split. + Format of the resource id should be + /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} + :type reservation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns list or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[list[~azure.mgmt.reservations.models.ReservationResponse]] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[list[~azure.mgmt.reservations.models.ReservationResponse]]] + :raises: + :class:`ErrorException` + """ + raw_result = self._split_initial( + reservation_order_id=reservation_order_id, + quantities=quantities, + reservation_id=reservation_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('[ReservationResponse]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -112,45 +135,22 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **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) + split.metadata = {'url': '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/split'} - def merge( - self, reservation_order_id, body, custom_headers=None, raw=False, **operation_config): - """Merges two `Reservation`s. - Merge the specified `Reservation`s into a new `Reservation`. The two - `Reservation`s being merged must have same properties. + def _merge_initial( + self, reservation_order_id, sources=None, custom_headers=None, raw=False, **operation_config): + body = models.MergeRequest(sources=sources) - :param reservation_order_id: Order Id of the reservation - :type reservation_order_id: str - :param body: Information needed for commercial request for a - reservation - :type body: :class:`MergeRequest ` - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: - :class:`AzureOperationPoller` - instance that returns list of :class:`ReservationResponse - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: - :class:`AzureOperationPoller` - or :class:`ClientRawResponse` - :raises: :class:`ErrorException` - """ # Construct URL - url = '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge' + url = self.merge.metadata['url'] path_format_arguments = { 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str') } @@ -174,29 +174,60 @@ def merge( body_content = self._serialize.body(body, 'MergeRequest') # Construct and send request - def long_running_send(): + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.post(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 202]: + raise models.ErrorException(self._deserialize, response) - def get_long_running_status(status_link, headers=None): + deserialized = None - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if response.status_code == 200: + deserialized = self._deserialize('[ReservationResponse]', response) - def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - if response.status_code not in [200, 202]: - raise models.ErrorException(self._deserialize, response) + return deserialized - deserialized = None + def merge( + self, reservation_order_id, sources=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Merges two `Reservation`s. - if response.status_code == 200: - deserialized = self._deserialize('[ReservationResponse]', response) + Merge the specified `Reservation`s into a new `Reservation`. The two + `Reservation`s being merged must have same properties. + + :param reservation_order_id: Order Id of the reservation + :type reservation_order_id: str + :param sources: Format of the resource id should be + /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} + :type sources: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns list or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[list[~azure.mgmt.reservations.models.ReservationResponse]] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[list[~azure.mgmt.reservations.models.ReservationResponse]]] + :raises: + :class:`ErrorException` + """ + raw_result = self._merge_initial( + reservation_order_id=reservation_order_id, + sources=sources, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('[ReservationResponse]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -204,16 +235,14 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **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) + merge.metadata = {'url': '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge'} def list( self, reservation_order_id, custom_headers=None, raw=False, **operation_config): @@ -228,17 +257,17 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`ReservationResponse - ` - :rtype: :class:`ReservationResponsePaged - ` - :raises: :class:`ErrorException` + :return: An iterator like instance of ReservationResponse + :rtype: + ~azure.mgmt.reservations.models.ReservationResponsePaged[~azure.mgmt.reservations.models.ReservationResponse] + :raises: + :class:`ErrorException` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations' + url = self.list.metadata['url'] path_format_arguments = { 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str') } @@ -265,7 +294,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -281,6 +310,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations'} def get( self, reservation_id, reservation_order_id, custom_headers=None, raw=False, **operation_config): @@ -297,17 +327,14 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`ReservationResponse - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`ReservationResponse - ` or - :class:`ClientRawResponse` - :raises: :class:`ErrorException` + :return: ReservationResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.reservations.models.ReservationResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` """ # Construct URL - url = '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}' + url = self.get.metadata['url'] path_format_arguments = { 'reservationId': self._serialize.url("reservation_id", reservation_id, 'str'), 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str') @@ -330,7 +357,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -345,35 +372,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}'} - def update( - self, reservation_order_id, reservation_id, parameters, custom_headers=None, raw=False, **operation_config): - """Updates a `Reservation`. - - Updates the applied scopes of the `Reservation`. - :param reservation_order_id: Order Id of the reservation - :type reservation_order_id: str - :param reservation_id: Id of the Reservation Item - :type reservation_id: str - :param parameters: Information needed to patch a reservation item - :type parameters: :class:`Patch ` - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: - :class:`AzureOperationPoller` - instance that returns :class:`ReservationResponse - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: - :class:`AzureOperationPoller` - or :class:`ClientRawResponse` - :raises: :class:`ErrorException` - """ + def _update_initial( + self, reservation_order_id, reservation_id, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}' + url = self.update.metadata['url'] path_format_arguments = { 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'), 'reservationId': self._serialize.url("reservation_id", reservation_id, 'str') @@ -398,29 +403,61 @@ def update( body_content = self._serialize.body(parameters, 'Patch') # Construct and send request - def long_running_send(): + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.patch(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 202]: + raise models.ErrorException(self._deserialize, response) - def get_long_running_status(status_link, headers=None): + deserialized = None - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if response.status_code == 200: + deserialized = self._deserialize('ReservationResponse', response) - def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - if response.status_code not in [200, 202]: - raise models.ErrorException(self._deserialize, response) + return deserialized - deserialized = None + def update( + self, reservation_order_id, reservation_id, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a `Reservation`. - if response.status_code == 200: - deserialized = self._deserialize('ReservationResponse', response) + Updates the applied scopes of the `Reservation`. + + :param reservation_order_id: Order Id of the reservation + :type reservation_order_id: str + :param reservation_id: Id of the Reservation Item + :type reservation_id: str + :param parameters: Information needed to patch a reservation item + :type parameters: ~azure.mgmt.reservations.models.Patch + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ReservationResponse or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.reservations.models.ReservationResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.reservations.models.ReservationResponse]] + :raises: + :class:`ErrorException` + """ + raw_result = self._update_initial( + reservation_order_id=reservation_order_id, + reservation_id=reservation_id, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ReservationResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -428,16 +465,14 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **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) + update.metadata = {'url': '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}'} def list_revisions( self, reservation_id, reservation_order_id, custom_headers=None, raw=False, **operation_config): @@ -455,17 +490,17 @@ def list_revisions( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`ReservationResponse - ` - :rtype: :class:`ReservationResponsePaged - ` - :raises: :class:`ErrorException` + :return: An iterator like instance of ReservationResponse + :rtype: + ~azure.mgmt.reservations.models.ReservationResponsePaged[~azure.mgmt.reservations.models.ReservationResponse] + :raises: + :class:`ErrorException` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/revisions' + url = self.list_revisions.metadata['url'] path_format_arguments = { 'reservationId': self._serialize.url("reservation_id", reservation_id, 'str'), 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str') @@ -493,7 +528,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -509,3 +544,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_revisions.metadata = {'url': '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/revisions'} diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_order_operations.py b/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_order_operations.py index b2a234e956ec..4898d26d101e 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_order_operations.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/operations/reservation_order_operations.py @@ -1,6 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- @@ -17,16 +21,18 @@ class ReservationOrderOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Supported version. Constant value: "2017-11-01". + :param deserializer: An object model deserializer. + :ivar api_version: Supported version. Constant value: "2018-06-01". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-11-01" + self.api_version = "2018-06-01" self.config = config @@ -42,17 +48,17 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`ReservationOrderResponse - ` - :rtype: :class:`ReservationOrderResponsePaged - ` - :raises: :class:`ErrorException` + :return: An iterator like instance of ReservationOrderResponse + :rtype: + ~azure.mgmt.reservations.models.ReservationOrderResponsePaged[~azure.mgmt.reservations.models.ReservationOrderResponse] + :raises: + :class:`ErrorException` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Capacity/reservationOrders' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -75,7 +81,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -91,6 +97,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Capacity/reservationOrders'} def get( self, reservation_order_id, custom_headers=None, raw=False, **operation_config): @@ -105,17 +112,14 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`ReservationOrderResponse - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`ReservationOrderResponse - ` or - :class:`ClientRawResponse` - :raises: :class:`ErrorException` + :return: ReservationOrderResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.reservations.models.ReservationOrderResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` """ # Construct URL - url = '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}' + url = self.get.metadata['url'] path_format_arguments = { 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str') } @@ -137,7 +141,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -152,3 +156,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'} diff --git a/azure-mgmt-reservations/azure/mgmt/reservations/version.py b/azure-mgmt-reservations/azure/mgmt/reservations/version.py index cb8ad9967749..9bd1dfac7ecb 100644 --- a/azure-mgmt-reservations/azure/mgmt/reservations/version.py +++ b/azure-mgmt-reservations/azure/mgmt/reservations/version.py @@ -1,9 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# 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. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "0.2.0"